DtMscBl.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using CoreFS.CA06;
  4. using Infragistics.Win.UltraWinGrid;
  5. using System;
  6. using System.Collections;
  7. using System.Data;
  8. using System.Windows.Forms;
  9. namespace Core.StlMes.Client.Qcm
  10. {
  11. class DtMscBl : DtBaseQcm
  12. {
  13. private CtrlMscBl _ctrlMscBl;
  14. private UltraGridRow[] _rows;
  15. public DtMscBl(CtrlMscBl ctrlMscBl)
  16. {
  17. _ctrlMscBl = ctrlMscBl;
  18. RegistQuery(Query, "DefaultQuery");
  19. RegistAction(Add, ActionType.Add);
  20. RegistAction(Modify, ActionType.Modify);
  21. RegistAction(Save, ActionType.Save);
  22. RegistAction(Delete, ActionType.Delete);
  23. RegistAction(Resume, ActionType.Resume);
  24. RegistAction(SubMitAudit, ActionType.SubMitAudit);
  25. RegistAction(Audit, ActionType.Audit);
  26. RegistAction(Group, ActionType.Group);
  27. }
  28. protected void Query()
  29. {
  30. FrmProPSCMSC2 frm = _ctrlMscBl.FrmProPscMsc2;
  31. UltraGrid gridMsc = frm.ControlMsc.GridMsc;
  32. CheckBox checkBox = frm.ckbDeleteFilter;
  33. if (gridMsc.ActiveRow == null) return;
  34. string msc = frm.ControlMsc.MscRow.Cells["MSC"].Value.ToString();
  35. ArrayList list = new ArrayList();
  36. list.Add(msc);
  37. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.queryWithMsc",
  38. new Object[] { list }, frm.ob);
  39. GridHelper.CopyDataToDatatable(dt, _ctrlMscBl.DataTableBl, true);
  40. GridHelper.RefreshAndAutoSize(_ctrlMscBl.GridBl);
  41. }
  42. protected bool Add()
  43. {
  44. throw new NotImplementedException();
  45. }
  46. protected bool Group()
  47. {
  48. FrmProPSCMSC2 frm = _ctrlMscBl.FrmProPscMsc2;
  49. ArrayList list = new ArrayList();
  50. PopupGroup popupGroup = new PopupGroup();
  51. if (popupGroup.ShowDialog() == DialogResult.OK)
  52. {
  53. foreach (UltraGridRow row in _rows)
  54. {
  55. ArrayList listSub = new ArrayList();
  56. listSub.Add(popupGroup.NumGroupNum.Value.ToString());
  57. listSub.Add(row.Cells["MSC"].Value.ToString());
  58. listSub.Add(row.Cells["PSC_BL"].Value.ToString());
  59. list.Add(listSub);
  60. }
  61. ServerHelper.SetData("com.steering.pss.qcm.BLCodeManage.group", new object[] { list }, frm.ob);
  62. }
  63. else
  64. {
  65. return false;
  66. }
  67. return true;
  68. }
  69. protected bool Modify()
  70. {
  71. throw new NotImplementedException();
  72. }
  73. protected bool Save()
  74. {
  75. throw new NotImplementedException();
  76. }
  77. protected bool Delete()
  78. {
  79. throw new NotImplementedException();
  80. }
  81. protected bool Resume()
  82. {
  83. throw new NotImplementedException();
  84. }
  85. protected bool SubMitAudit()
  86. {
  87. throw new NotImplementedException();
  88. }
  89. protected bool Audit()
  90. {
  91. throw new NotImplementedException();
  92. }
  93. protected override bool CheckData(ActionType actionType, out ArrayList parm, out string msg)
  94. {
  95. msg = "";
  96. parm = new ArrayList();
  97. UltraGrid gridMsc = _ctrlMscBl.FrmProPscMsc2.ControlMsc.GridMsc;
  98. if (gridMsc.ActiveRow == null)
  99. {
  100. msg = "请先维护冶金规范,然后再进行操作!";
  101. return false;
  102. }
  103. return true;
  104. }
  105. protected ArrayList[] GetParms(ActionType actionType)
  106. {
  107. return new ArrayList[1];
  108. }
  109. protected override bool IsSelectData(ActionType actionType, out string msg)
  110. {
  111. msg = "";
  112. _rows = GridHelper.GetRowsWithKey(_ctrlMscBl.GridBl,
  113. new string[] { "CHK" }, new string[] { "True" });
  114. if (_rows.Length == 0)
  115. {
  116. return false;
  117. }
  118. return true;
  119. }
  120. private static DataTable GetMscTabByMsc(string msc, OpeBase ob)
  121. {
  122. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreFrmProPSCMSC2.getComMscByMsc",
  123. new object[] { msc }, ob);
  124. return dt;
  125. }
  126. }
  127. }