FrmOfficeD.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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 CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Control;
  11. using Core.Mes.Client.Comm.Tool;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Core.StlMes.Client.Mcp.Mch.Entity;
  14. using com.steering.mes.mcp.entity;
  15. using Core.Mes.Client.Comm.Server;
  16. using Core.StlMes.Client.Mcp.Control;
  17. namespace Core.StlMes.Client.Mcp.Mch.MchResult
  18. {
  19. public partial class FrmOfficeD : FrmBase
  20. {
  21. UltraGridRow uge = null;
  22. string gx = "";
  23. public FrmOfficeD()
  24. {
  25. InitializeComponent();
  26. }
  27. public FrmOfficeD(OpeBase ob, UltraGridRow ugr,string GX)
  28. {
  29. InitializeComponent();
  30. this.ob = ob;
  31. uge = ugr;
  32. gx = GX;
  33. }
  34. //public override void ToolBar_Click(object sender, string ToolbarKey)
  35. //{
  36. // switch (ToolbarKey)
  37. // {
  38. // case "doQuery":
  39. // get_PurUoms();
  40. // break;
  41. // case "doAdd":
  42. // add_PurUoms();
  43. // break;
  44. // //case "doModify":
  45. // // upd_PurUoms();
  46. // // break;
  47. // case "doDelete":
  48. // del_PurUoms();
  49. // break;
  50. // case "Close":
  51. // this.Close();
  52. // break;
  53. // }
  54. //}
  55. /// <summary>
  56. /// 查询离线去向
  57. /// </summary>
  58. /// <param name="configureMEntity"></param>
  59. public void Query()
  60. {
  61. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmOfficeD.doQuery", new object[] { textheatNo.Text.Trim(), textPline.Text.Trim() }, this.ob);
  62. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  63. }
  64. /// <summary>
  65. /// 增加离线去向
  66. ///// </summary>
  67. ///// <param name="configureMEntity"></param>
  68. public void Add()
  69. {
  70. string heatno = "";
  71. string lotno = "";
  72. string pline = "";
  73. string process = "";
  74. string officed = "";
  75. if (txtheatno.Text != "" && txtheatno.Text != null)
  76. {
  77. heatno = txtheatno.Text;
  78. }
  79. else
  80. {
  81. MessageUtil.ShowTips("请输入炉号!");
  82. return;
  83. }
  84. if (txtlotno.Text != "" && txtlotno.Text != null)
  85. {
  86. lotno = txtlotno.Text;
  87. }
  88. else
  89. {
  90. MessageUtil.ShowTips("请输入批号!");
  91. return;
  92. }
  93. if (txtpline.Text != "" && txtpline.Text != null)
  94. {
  95. pline = txtpline.Text;
  96. }
  97. else
  98. {
  99. MessageUtil.ShowTips("请输入生产产线!");
  100. return;
  101. }
  102. if (txtprocess.Text != "" && txtprocess.Text != null)
  103. {
  104. process = txtprocess.Text;
  105. }
  106. else
  107. {
  108. MessageUtil.ShowTips("请输入工序!");
  109. return;
  110. }
  111. if (txtdirect.Text != "" && txtdirect.Text != null)
  112. {
  113. officed = txtdirect.Text;
  114. }
  115. else
  116. {
  117. MessageUtil.ShowTips("请输入离线去向!");
  118. return;
  119. }
  120. CoreClientParam ccp = new CoreClientParam();
  121. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmOfficeD";
  122. ccp.MethodName = "addOfficeD";
  123. ccp.ServerParams = new Object[] { heatno, lotno, pline, process, officed };
  124. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  125. if (ccp.ReturnCode != -1)
  126. {
  127. MessageUtil.ShowTips(ccp.ReturnInfo);
  128. if (ccp.ReturnInfo.Equals("新增成功!"))
  129. {
  130. Query();
  131. }
  132. }
  133. //ConfigureClassCommon.doActiveSelRow(ultraGrid1, "UomCode", UomsEntity.UomCode);//激活当前行
  134. }
  135. /////// <summary>
  136. /////// 修改离线去向
  137. /////// </summary>
  138. /////// <param name="configureMEntity"></param>
  139. //public void upd_PurUoms()
  140. //{
  141. // UltraGridRow urg = ultraGrid1.ActiveRow;
  142. // FrmMchPersonentity result = new FrmMchPersonentity();
  143. // result.Name = urg.Cells["NAME"].Value.ToString();
  144. // result.PlineCode = txt_pline.Text;
  145. // result.ProBc = txt_banci.Text;
  146. // CoreClientParam ccp = new CoreClientParam();
  147. // ccp.ServerName = "com.steering.mes.mcp.Mch.FrmMchPerson";
  148. // ccp.MethodName = "updatePerson";
  149. // ccp.ServerParams = new Object[] { result, txtheatno.Text };
  150. // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  151. // if (ccp.ReturnCode != -1)
  152. // {
  153. // MessageUtil.ShowTips(ccp.ReturnInfo);
  154. // if (ccp.ReturnInfo.Equals("修改成功!"))
  155. // {
  156. // get_PurUoms();
  157. // }
  158. // }
  159. //}
  160. private void FrmOfficeD_Load(object sender, EventArgs e)
  161. {
  162. if (uge == null)
  163. {
  164. return;
  165. }
  166. else
  167. {
  168. init();
  169. }
  170. //产线
  171. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMchPerson.doQuerypline", null, this.ob);//如果是“”里面添加的是条件
  172. //pline.DataSource = dt;
  173. //pline.DisplayMember = "PLINE_NAME";
  174. //pline.ValueMember = "PLINE_CODE";
  175. //YdmBaseClass.SetComboItemHeight(pline);
  176. //txt_pline.DataSource = dt;
  177. //txt_pline.DisplayMember = "PLINE_NAME";
  178. //txt_pline.ValueMember = "PLINE_CODE";
  179. //YdmBaseClass.SetComboItemHeight(txt_pline);
  180. }
  181. //界面初始化
  182. private void init()
  183. {
  184. try
  185. {
  186. this.Cursor = Cursors.WaitCursor;
  187. String heatplanno = uge.Cells["HEAT_PLAN_NO"].Value.ToString();
  188. String lotno = uge.Cells["LAST_BATCH_NO"].Value.ToString();
  189. String plinename = uge.Cells["PLINE_NAME"].Value.ToString();
  190. txtheatno.Value = heatplanno.Trim().ToString();
  191. txtlotno.Value = lotno.Trim().ToString();
  192. txtprocess.Value = gx.Trim().ToString();
  193. txtpline.Value = plinename.Trim().ToString();
  194. }
  195. catch (Exception ex)
  196. {
  197. MessageUtil.ShowTips("加载数据失败:" + ex.Message);
  198. }
  199. finally
  200. {
  201. this.Cursor = Cursors.Default;
  202. }
  203. }
  204. ///// <summary>
  205. ///// 删除离线去向
  206. ///// </summary>
  207. ///// <param name="configureMEntity"></param>
  208. public void Delete()
  209. {
  210. if (ultraGrid1.ActiveRow != null)
  211. {
  212. UltraGridRow urg = ultraGrid1.ActiveRow;
  213. if (urg != null)
  214. {
  215. CoreClientParam ccp = new CoreClientParam();
  216. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmOfficeD";
  217. ccp.MethodName = "deletePerson";
  218. ccp.ServerParams = new Object[] { urg.Cells["OFFICE_D"].Value.ToString() };
  219. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  220. if (ccp.ReturnCode != -1)
  221. {
  222. MessageUtil.ShowTips(ccp.ReturnInfo);
  223. if (ccp.ReturnInfo.Equals("删除成功!"))
  224. {
  225. Query();
  226. }
  227. }
  228. }
  229. else
  230. {
  231. MessageUtil.ShowTips("请选择一条数据");
  232. return;
  233. }
  234. }
  235. }
  236. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  237. {
  238. switch (e.Tool.Key.ToString())
  239. {
  240. case "Query":
  241. Query();
  242. break;
  243. case "Add":
  244. Add();
  245. break;
  246. case "Delete":
  247. Delete();
  248. break;
  249. case "Close":
  250. this.Close();
  251. break;
  252. }
  253. }
  254. }
  255. }