QcmRolledTubePassConfigFrm.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using Core.Mes.Client.Comm.Tool;
  2. using Core.StlMes.Client.Judge.Commons;
  3. using Core.StlMes.Client.Judge.Controls;
  4. using CoreFS.CA06;
  5. using System;
  6. namespace Core.StlMes.Client.Judge.Forms
  7. {
  8. public partial class QcmRolledTubePassConfigFrm : FrmBase
  9. {
  10. private QcmBcPassConfigCtrl _bcPassConfigCtrl;
  11. private Dal _d;
  12. public QcmRolledTubePassConfigFrm()
  13. {
  14. InitializeComponent();
  15. }
  16. public override void ToolBar_Click(object sender, string ToolbarKey)
  17. {
  18. base.ToolBar_Click(sender, ToolbarKey);
  19. switch (ToolbarKey)
  20. {
  21. case "Query":
  22. Query();
  23. break;
  24. case "Save":
  25. Save();
  26. break;
  27. case "Delete":
  28. Delete();
  29. break;
  30. case "Close":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. private void QcmRolledTubePassConfigFrm_Load(object sender, EventArgs e)
  36. {
  37. _d = new Dal(ob);
  38. _bcPassConfigCtrl = new QcmBcPassConfigCtrl(this, ob);
  39. }
  40. private void Query()
  41. {
  42. _bcPassConfigCtrl.Query();
  43. }
  44. private void Save()
  45. {
  46. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow == null)
  47. {
  48. MessageUtil.ShowWarning("请选择记录!");
  49. return;
  50. }
  51. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow.GetValue("type") == "")
  52. {
  53. MessageUtil.ShowWarning("请选择类型!", _bcPassConfigCtrl.UltraGrid1, _bcPassConfigCtrl.UltraGrid1.ActiveRow.Cells["type"]);
  54. return;
  55. }
  56. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow.GetValue("judgeResult") == "")
  57. {
  58. MessageUtil.ShowWarning("请选择判定结果!", _bcPassConfigCtrl.UltraGrid1, _bcPassConfigCtrl.UltraGrid1.ActiveRow.Cells["judgeResult"]);
  59. return;
  60. }
  61. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow.GetValue("auditUnitDesc") == "")
  62. {
  63. MessageUtil.ShowWarning("请选择审核科室!", _bcPassConfigCtrl.UltraGrid1, _bcPassConfigCtrl.UltraGrid1.ActiveRow.Cells["auditUnitDesc"]);
  64. return;
  65. }
  66. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow.GetValue("seamArea") == "")
  67. {
  68. MessageUtil.ShowWarning("请选择所属区域!", _bcPassConfigCtrl.UltraGrid1, _bcPassConfigCtrl.UltraGrid1.ActiveRow.Cells["seamArea"]);
  69. return;
  70. }
  71. if (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == System.Windows.Forms.DialogResult.No)
  72. {
  73. return;
  74. }
  75. var row = _bcPassConfigCtrl.UltraGrid1.ActiveRow;
  76. string[] parm = new string[] { row.GetValue("judgeResult"), row.GetValue("auditStep"), row.GetValue("auditUnit"),
  77. row.GetValue("type"),row.GetValue("seamArea") };
  78. var ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubePassApply.passConfigSave", new object[] { parm });
  79. if (ccp.ReturnInfo != "")
  80. {
  81. MessageUtil.ShowError(ccp.ReturnInfo);
  82. return;
  83. }
  84. MessageUtil.ShowTips("保存成功!");
  85. _bcPassConfigCtrl.Query();
  86. }
  87. private void Delete()
  88. {
  89. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow == null)
  90. {
  91. MessageUtil.ShowWarning("请选择记录!");
  92. return;
  93. }
  94. var row = _bcPassConfigCtrl.UltraGrid1.ActiveRow;
  95. if (row.GetValue("auditStep") == "")
  96. {
  97. MessageUtil.ShowWarning("没保存的记录不需要删除!");
  98. return;
  99. }
  100. if (MessageUtil.ShowYesNoAndQuestion("是否确认删除?") == System.Windows.Forms.DialogResult.No)
  101. {
  102. return;
  103. }
  104. string[] parm = new string[] { row.GetValue("judgeResult"), row.GetValue("auditStep"), row.GetValue("type"), row.GetValue("seamArea") };
  105. var ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubePassApply.passConfigDelete", new object[] { parm });
  106. if (ccp.ReturnInfo != "")
  107. {
  108. MessageUtil.ShowError(ccp.ReturnInfo);
  109. return;
  110. }
  111. MessageUtil.ShowTips("删除成功!");
  112. _bcPassConfigCtrl.Query();
  113. }
  114. }
  115. }