FrmEntrustApproval.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Server;
  10. using Core.Mes.Client.Comm.Tool;
  11. using CoreFS.CA06;
  12. namespace Core.StlMes.Client.Mcp.Treatment.HeatTreatment
  13. {
  14. public partial class FrmEntrustApproval : FrmBase
  15. {
  16. private int Type = 0;
  17. private List<string> SubNo;
  18. private string step = "";
  19. private string _name;
  20. public FrmEntrustApproval(OpeBase _ob, List<string> subNo, string step, string name, bool ShowPline= true,int type= 0,string[] validDataPurviewIds=null)
  21. {
  22. InitializeComponent();
  23. this.ob = _ob;
  24. SubNo = subNo;
  25. this.step = step;
  26. _name = name;
  27. Type = type;
  28. if (ShowPline)
  29. {
  30. if (step == "1")
  31. {
  32. chkFlag1.Visible = false;
  33. }
  34. //if (step == "3" && validDataPurviewIds!=null)
  35. //{
  36. // comm.InitDropPlinePowerW(cmbPline, validDataPurviewIds, ob);
  37. //}
  38. //else
  39. //{
  40. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.frmEntrust.doQueryPlineCode",
  41. new object[] { "" }, _ob);
  42. cmbPline.DataSource = dt;
  43. cmbPline.DisplayMember = "PLINE_NAME";
  44. cmbPline.ValueMember = "PLINE_CODE";
  45. //}
  46. }
  47. else
  48. {
  49. plPline.Visible = false;
  50. }
  51. }
  52. public string Note { get { return txtNote.Text; } }
  53. public string PlineCode { get { return cmbPline.SelectedIndex<0?"": cmbPline.Value.ToString(); } }
  54. public string transCode { get { return cmbTrans.SelectedIndex < 0 ? "" : cmbTrans.Value.ToString(); } }
  55. private void ultraButton1_Click(object sender, EventArgs e)
  56. {
  57. if (plPline.Visible && cmbPline.SelectedIndex < 0)
  58. {
  59. MessageBox.Show("请选择需要委托的产线");
  60. return;
  61. }
  62. /* if (plPline.Visible && cmbTrans.SelectedIndex < 0)
  63. {
  64. MessageBox.Show("请选择用车方式");
  65. return;
  66. }*/
  67. if (Type == 0)
  68. {
  69. var ccp = new CoreClientParam();
  70. ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust";
  71. ccp.MethodName = "ApprovalOk";
  72. ccp.ServerParams = new object[]
  73. {
  74. SubNo, step,PlineCode, Note, _name,chkFlag1.Checked,chkFlag2.Checked,transCode
  75. };
  76. ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  77. if (ccp.ReturnCode != -1)
  78. {
  79. MessageUtil.ShowTips(ccp.ReturnInfo);
  80. if (ccp.ReturnInfo.Equals("审核通过成功!"))
  81. this.DialogResult = DialogResult.OK;
  82. }
  83. }
  84. if (Type == 1)
  85. {
  86. var ccp = new CoreClientParam();
  87. ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust";
  88. ccp.MethodName = "ApprovalFail";
  89. ccp.ServerParams = new object[]
  90. {
  91. SubNo, step, Note, _name
  92. };
  93. ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  94. if (ccp.ReturnCode != -1)
  95. {
  96. MessageUtil.ShowTips(ccp.ReturnInfo);
  97. if (ccp.ReturnInfo.Equals("审核不通过成功!"))
  98. this.DialogResult = DialogResult.OK;
  99. }
  100. }
  101. if (Type == 2)
  102. {
  103. var ccp = new CoreClientParam();
  104. ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust";
  105. ccp.MethodName = "CancelApproval";
  106. ccp.ServerParams = new object[]
  107. {
  108. SubNo, step, Note, _name
  109. };
  110. ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  111. if (ccp.ReturnCode != -1)
  112. {
  113. MessageUtil.ShowTips(ccp.ReturnInfo);
  114. if (ccp.ReturnInfo.Equals("撤销审核成功!"))
  115. this.DialogResult = DialogResult.OK;
  116. }
  117. }
  118. if (Type == 3)
  119. {
  120. var ccp = new CoreClientParam();
  121. ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust";
  122. ccp.MethodName = "MarkCompleted";
  123. ccp.ServerParams = new object[]
  124. {
  125. SubNo, step, Note, _name
  126. };
  127. ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  128. if (ccp.ReturnCode != -1)
  129. {
  130. MessageUtil.ShowTips(ccp.ReturnInfo);
  131. if (ccp.ReturnInfo.Equals("委托完成!"))
  132. this.DialogResult = DialogResult.OK;
  133. }
  134. }
  135. if (Type == 4)
  136. {
  137. var ccp = new CoreClientParam();
  138. ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust";
  139. ccp.MethodName = "CancleMarkCompleted";
  140. ccp.ServerParams = new object[]
  141. {
  142. SubNo, step, Note, _name
  143. };
  144. ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  145. if (ccp.ReturnCode != -1)
  146. {
  147. MessageUtil.ShowTips(ccp.ReturnInfo);
  148. if (ccp.ReturnInfo.Equals("撤销委托完成!"))
  149. this.DialogResult = DialogResult.OK;
  150. }
  151. }
  152. }
  153. }
  154. }