OrderSelect.cs 1.9 KB

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