FrmCollarDialog.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Core.Mes.Client.Comm.Tool;
  2. using Core.StlMes.Client.Mcp.Entity;
  3. using CoreFS.CA06;
  4. using Infragistics.Win.UltraWinGrid;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Windows.Forms;
  13. namespace Core.StlMes.Client.Mcp.CollarLibrary
  14. {
  15. public partial class FrmCollarDialog : FrmBase
  16. {
  17. private OpeBase _ob;
  18. private ComMscJgEntity baseEntity = null;
  19. public FrmCollarDialog(OpeBase ob)
  20. {
  21. _ob = ob;
  22. InitializeComponent();
  23. }
  24. private void FrmCollarDialog_Load(object sender, EventArgs e)
  25. {
  26. EntityHelper.ShowGridCaption<ComMscJgEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  27. DoQueryPsc();
  28. }
  29. public ComMscJgEntity BaseEntity
  30. {
  31. get { return baseEntity; }
  32. set { baseEntity = value; }
  33. }
  34. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  35. {
  36. switch (e.Tool.Key)
  37. {
  38. case "save"://确认
  39. doSave();
  40. break;
  41. case "Close":
  42. this.Close();
  43. break;
  44. default:
  45. break;
  46. }
  47. }
  48. private void DoQueryPsc()
  49. {
  50. List<ComMscJgEntity> listSource = EntityHelper.GetData<ComMscJgEntity>(
  51. "com.steering.mes.mcp.CollarLibrary.FrmCollarInventory.getPsc", null, _ob);
  52. ComMscJgEntitySource.DataSource = listSource;
  53. }
  54. private void doSave()
  55. {
  56. UltraGridRow ugrM = ultraGrid1.ActiveRow;
  57. if (ugrM == null) return;
  58. baseEntity = (ComMscJgEntity)ugrM.ListObject;
  59. this.Close();
  60. }
  61. }
  62. }