PopupMscCastRForg.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using Core.Mes.Client.Comm.Tool;
  2. using CoreFS.CA06;
  3. using System;
  4. using System.Windows.Forms;
  5. namespace Core.StlMes.Client.Qcm
  6. {
  7. public delegate void MscCastRForgSucessHandler(object sender, MscCastRForgArgs e);
  8. public partial class PopupMscCastRForg : FrmBase
  9. {
  10. public event MscCastRForgSucessHandler MscCastRForgSucessEvent;
  11. private FrmMscCastRForg _frm;
  12. private string _process = "";
  13. private string _dimater = "";
  14. private string _height = "";
  15. private string _specCode = "";
  16. private string closeAction = "";
  17. public PopupMscCastRForg(string[] args, string exceptionMsg, OpeBase ob)
  18. {
  19. InitializeComponent();
  20. ExceptionHelper.RegistException();
  21. string str = args[0];
  22. string[] strs = str.Split(',');
  23. _process = strs[0].Trim();
  24. _dimater = strs[1].Trim();
  25. _height = strs[2].Trim();
  26. _specCode = strs[3].Trim();
  27. this.ob = ob;
  28. ultraStatusBar1.Panels["ExMsg"].Text = exceptionMsg;
  29. _frm = new FrmMscCastRForg();
  30. _frm.PopupLoad("", ob);
  31. this.panel5.Controls.Add(_frm.SplitContainer1);
  32. SetDefaltCondition();
  33. _frm.ToolBar_Click(null, "Query");
  34. }
  35. private void SetDefaltCondition()
  36. {
  37. _frm.SpecCode = _specCode;
  38. }
  39. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  40. {
  41. switch (e.Tool.Key)
  42. {
  43. case "查询":
  44. _frm.ToolBar_Click(null, "Query");
  45. break;
  46. case "保存":
  47. _frm.ToolBar_Click(null, "Save");
  48. break;
  49. case "关闭":
  50. this.Close();
  51. break;
  52. }
  53. }
  54. private void btnClose_Click(object sender, EventArgs e)
  55. {
  56. closeAction = "Ok";
  57. if (MscCastRForgSucessEvent != null)
  58. {
  59. if (_frm.UltraGrid1.ActiveRow == null)
  60. {
  61. MessageUtil.ShowWarning("请维护一条生产产线适用规格!");
  62. return;
  63. }
  64. MscCastRForgArgs e2 = new MscCastRForgArgs();
  65. e2.Result = "1";
  66. MscCastRForgSucessEvent(this, e2);
  67. }
  68. this.DialogResult = DialogResult.OK;
  69. }
  70. private void PopupMscCastRForg_FormClosing(object sender, FormClosingEventArgs e)
  71. {
  72. if (MscCastRForgSucessEvent != null && closeAction == "")
  73. {
  74. MscCastRForgArgs e2 = new MscCastRForgArgs();
  75. e2.Result = "0";
  76. MscCastRForgSucessEvent(this, e2);
  77. }
  78. }
  79. private void btnCancel_Click(object sender, EventArgs e)
  80. {
  81. this.Close();
  82. }
  83. }
  84. public class MscCastRForgArgs : EventArgs
  85. {
  86. private string _result = "";
  87. public string Result
  88. {
  89. get { return _result; }
  90. set { _result = value; }
  91. }
  92. }
  93. }