QcmRolledJhyPassConfigFrm.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 QcmRolledJhyPassConfigFrm : FrmBase
  9. {
  10. private QcmJhyPassConfigCtrl _bcPassConfigCtrl;
  11. private Dal _d;
  12. public QcmRolledJhyPassConfigFrm()
  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 QcmJhyPassConfigCtrl(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 (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == System.Windows.Forms.DialogResult.No)
  67. {
  68. return;
  69. }
  70. var row = _bcPassConfigCtrl.UltraGrid1.ActiveRow;
  71. string[] parm = new string[] { row.GetValue("judgeResult"), row.GetValue("auditStep"), row.GetValue("auditUnit"),
  72. row.GetValue("type") };
  73. var ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledJhyPassApply.passConfigSave", new object[] { parm });
  74. if (ccp.ReturnInfo != "")
  75. {
  76. MessageUtil.ShowError(ccp.ReturnInfo);
  77. return;
  78. }
  79. MessageUtil.ShowTips("保存成功!");
  80. _bcPassConfigCtrl.Query();
  81. }
  82. private void Delete()
  83. {
  84. if (_bcPassConfigCtrl.UltraGrid1.ActiveRow == null)
  85. {
  86. MessageUtil.ShowWarning("请选择记录!");
  87. return;
  88. }
  89. var row = _bcPassConfigCtrl.UltraGrid1.ActiveRow;
  90. if (row.GetValue("auditStep") == "")
  91. {
  92. MessageUtil.ShowWarning("没保存的记录不需要删除!");
  93. return;
  94. }
  95. if (MessageUtil.ShowYesNoAndQuestion("是否确认删除?") == System.Windows.Forms.DialogResult.No)
  96. {
  97. return;
  98. }
  99. string[] parm = new string[] { row.GetValue("judgeResult"), row.GetValue("auditStep"), row.GetValue("type") };
  100. var ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledJhyPassApply.passConfigDelete", new object[] { parm });
  101. if (ccp.ReturnInfo != "")
  102. {
  103. MessageUtil.ShowError(ccp.ReturnInfo);
  104. return;
  105. }
  106. MessageUtil.ShowTips("删除成功!");
  107. _bcPassConfigCtrl.Query();
  108. }
  109. }
  110. }