PasListForm.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using DevExpress.Xpo;
  2. using DevExpress.XtraEditors;
  3. using DevExpress.XtraEditors.Controls;
  4. using Ips.Library.DxpLib;
  5. using Ips.Library.Entity;
  6. using Ips.Sps.Store;
  7. using Ips.Sps.Tsks;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. using System.Windows.Forms;
  17. namespace Ips.Sps.TskResults.Pases
  18. {
  19. public partial class PasListForm : DevExpress.XtraEditors.XtraForm
  20. {
  21. public PasListForm()
  22. {
  23. InitializeComponent();
  24. _pasStore = Stores.It.PasStore;
  25. _pasStore.ListSourceChanged += _pasStore_ListSourceChanged;
  26. }
  27. private void _pasStore_ListSourceChanged(object sender, EventArgs e)
  28. {
  29. pasGridListCtrl1.SetDataSource(_pasStore.ListSource);
  30. }
  31. PasStore _pasStore;
  32. private void PasListForm_Load(object sender, EventArgs e)
  33. {
  34. InitCtrl();
  35. }
  36. private void InitCtrl()
  37. {
  38. txtStartTime.UseTimeEdit();
  39. txtEndTime.UseTimeEdit();
  40. txtSigCategory.Properties.Items.Add("全部", null, -1);
  41. txtSigCategory.Properties.Items.AddEnum<SignalCategory>();
  42. pasGridListCtrl1.SetResourceList(xpcSatList, xpcEmtList);
  43. btnQuery.PerformClick();
  44. }
  45. private void txtClear_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
  46. {
  47. if (e.Button.Kind == ButtonPredefines.Clear)
  48. {
  49. ((BaseEdit)sender).EditValue = null;
  50. }
  51. }
  52. private void btnQuery_Click(object sender, EventArgs e)
  53. {
  54. var model = _pasStore.QueryModel;
  55. model.SigCategory = txtSigCategory.EditValue == null ? null : (SignalCategory)txtSigCategory.EditValue;
  56. model.StartTime = txtStartTime.EditValue == null ? null : txtStartTime.DateTime;
  57. model.EndTime = txtEndTime.EditValue == null ? null : txtEndTime.DateTime;
  58. model.SatId = txtSat.EditValue == null ? null : (int)txtSat.EditValue;
  59. model.EmtId = txtEmt.EditValue == null ? null : (int)txtEmt.EditValue;
  60. _pasStore.BindList();
  61. }
  62. private void btnClear_Click(object sender, EventArgs e)
  63. {
  64. txtStartTime.EditValue = null;
  65. txtEndTime.EditValue = null;
  66. txtSigCategory.EditValue = null;
  67. txtSat.EditValue = null;
  68. txtEmt.EditValue = null;
  69. }
  70. }
  71. }