frmDemandSetting.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Tool;
  10. using Core.StlMes.Client.YdmBcPipeManage.Entity;
  11. using CoreFS.CA06;
  12. namespace Core.StlMes.Client.YdmBcPipeManage.Demand
  13. {
  14. public partial class frmDemandSetting : FrmBase
  15. {
  16. public frmDemandSetting(OpeBase _ob)
  17. {
  18. InitializeComponent();
  19. EntityHelper.ShowGridCaption<TmsComUnloadingEntity>(ugStation.DisplayLayout.Bands[0]);
  20. all = EntityHelper.GetData<TmsComUnloadingEntity>(
  21. "com.steering.Demand.sever.TmsDemandServer.doQueryStation", null,
  22. _ob);
  23. tmsComUnloadingEntityBindingSource.DataSource = all;
  24. }
  25. private TmsComUnloadingEntity selectRow = null;
  26. private List<TmsComUnloadingEntity> all;
  27. public TmsComUnloadingEntity SelectRow
  28. {
  29. get { return selectRow; }
  30. set { selectRow = value; }
  31. }
  32. private void ugStation_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  33. {
  34. selectRow = e.Row.ListObject as TmsComUnloadingEntity;;
  35. this.DialogResult = DialogResult.OK;
  36. }
  37. private void txtQuery_KeyUp(object sender, KeyEventArgs e)
  38. {
  39. if(all==null) return;
  40. tmsComUnloadingEntityBindingSource.DataSource = string.IsNullOrWhiteSpace(txtQuery.Text.Trim())?all:
  41. all.Where(p => p.UnloadingDesc.IndexOf(txtQuery.Text.Trim(), StringComparison.Ordinal) >= 0).ToList();
  42. ugStation.UpdateData();
  43. ugStation.Update();
  44. ugStation.Refresh();
  45. }
  46. }
  47. }