FrmMchOffice.cs 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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 FrmMchOffice : FrmBase
  20. {
  21. UltraGridRow uge = null;
  22. string gx = "";
  23. public FrmMchOffice()
  24. {
  25. InitializeComponent();
  26. }
  27. public FrmMchOffice(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. string startTim = "";
  62. string endTim = "";
  63. if (chkTim.Checked)
  64. {
  65. if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
  66. {
  67. MessageUtil.ShowTips("选择时间区间错误,请重新选择!");
  68. return;
  69. }
  70. else
  71. {
  72. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  73. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  74. }
  75. }
  76. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmReason.doQuery", new object[] { startTim,endTim }, this.ob);
  77. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  78. }
  79. /// <summary>
  80. /// 增加废品原因
  81. ///// </summary>
  82. ///// <param name="configureMEntity"></param>
  83. //public void Add()
  84. //{
  85. // string heatno = "";
  86. // string lotno = "";
  87. // string pline = "";
  88. // string process = "";
  89. // string officed = "";
  90. // if (txtheatno.Text != "" && txtheatno.Text != null)
  91. // {
  92. // heatno = txtheatno.Text;
  93. // }
  94. // else
  95. // {
  96. // MessageUtil.ShowTips("请输入炉号!");
  97. // return;
  98. // }
  99. // if (txtlotno.Text != "" && txtlotno.Text != null)
  100. // {
  101. // lotno = txtlotno.Text;
  102. // }
  103. // else
  104. // {
  105. // MessageUtil.ShowTips("请输入批号!");
  106. // return;
  107. // }
  108. // if (txtpline.Text != "" && txtpline.Text != null)
  109. // {
  110. // pline = txtpline.Text;
  111. // }
  112. // else
  113. // {
  114. // MessageUtil.ShowTips("请输入生产产线!");
  115. // return;
  116. // }
  117. // if (txtprocess.Text != "" && txtprocess.Text != null)
  118. // {
  119. // process = txtprocess.Text;
  120. // }
  121. // else
  122. // {
  123. // MessageUtil.ShowTips("请输入工序!");
  124. // return;
  125. // }
  126. // if (txtdirect.Text != "" && txtdirect.Text != null)
  127. // {
  128. // officed = txtdirect.Text;
  129. // }
  130. // else
  131. // {
  132. // MessageUtil.ShowTips("请输入离线去向!");
  133. // return;
  134. // }
  135. // CoreClientParam ccp = new CoreClientParam();
  136. // ccp.ServerName = "com.steering.mes.mcp.Mch.FrmReason";
  137. // ccp.MethodName = "addOfficeD";
  138. // ccp.ServerParams = new Object[] { heatno, lotno, pline, process, officed };
  139. // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  140. // if (ccp.ReturnCode != -1)
  141. // {
  142. // MessageUtil.ShowTips(ccp.ReturnInfo);
  143. // if (ccp.ReturnInfo.Equals("新增成功!"))
  144. // {
  145. // Query();
  146. // }
  147. // }
  148. // //ConfigureClassCommon.doActiveSelRow(ultraGrid1, "UomCode", UomsEntity.UomCode);//激活当前行
  149. //}
  150. /////// <summary>
  151. /////// 修改离线去向
  152. /////// </summary>
  153. /////// <param name="configureMEntity"></param>
  154. //public void upd_PurUoms()
  155. //{
  156. // UltraGridRow urg = ultraGrid1.ActiveRow;
  157. // FrmMchPersonentity result = new FrmMchPersonentity();
  158. // result.Name = urg.Cells["NAME"].Value.ToString();
  159. // result.PlineCode = txt_pline.Text;
  160. // result.ProBc = txt_banci.Text;
  161. // CoreClientParam ccp = new CoreClientParam();
  162. // ccp.ServerName = "com.steering.mes.mcp.Mch.FrmMchPerson";
  163. // ccp.MethodName = "updatePerson";
  164. // ccp.ServerParams = new Object[] { result, txtheatno.Text };
  165. // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  166. // if (ccp.ReturnCode != -1)
  167. // {
  168. // MessageUtil.ShowTips(ccp.ReturnInfo);
  169. // if (ccp.ReturnInfo.Equals("修改成功!"))
  170. // {
  171. // get_PurUoms();
  172. // }
  173. // }
  174. //}
  175. private void FrmReason_Load(object sender, EventArgs e)
  176. {
  177. if (uge == null)
  178. {
  179. return;
  180. }
  181. else
  182. {
  183. init();
  184. }
  185. //产线
  186. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMchPerson.doQuerypline", null, this.ob);//如果是“”里面添加的是条件
  187. //pline.DataSource = dt;
  188. //pline.DisplayMember = "PLINE_NAME";
  189. //pline.ValueMember = "PLINE_CODE";
  190. //YdmBaseClass.SetComboItemHeight(pline);
  191. //txt_pline.DataSource = dt;
  192. //txt_pline.DisplayMember = "PLINE_NAME";
  193. //txt_pline.ValueMember = "PLINE_CODE";
  194. //YdmBaseClass.SetComboItemHeight(txt_pline);
  195. }
  196. //界面初始化
  197. private void init()
  198. {
  199. try
  200. {
  201. this.Cursor = Cursors.WaitCursor;
  202. String heatplanno = uge.Cells["HEAT_PLAN_NO"].Value.ToString();
  203. String lotno = uge.Cells["BATCH_NO"].Value.ToString();
  204. String plinename = uge.Cells["PLINE_NAME"].Value.ToString();
  205. }
  206. catch (Exception ex)
  207. {
  208. MessageUtil.ShowTips("加载数据失败:" + ex.Message);
  209. }
  210. finally
  211. {
  212. this.Cursor = Cursors.Default;
  213. }
  214. }
  215. ///// <summary>
  216. ///// 删除废品原因
  217. ///// </summary>
  218. ///// <param name="configureMEntity"></param>
  219. public void Delete()
  220. {
  221. if (ultraGrid1.ActiveRow != null)
  222. {
  223. UltraGridRow urg = ultraGrid1.ActiveRow;
  224. if (urg != null)
  225. {
  226. CoreClientParam ccp = new CoreClientParam();
  227. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmReason";
  228. ccp.MethodName = "deletePerson";
  229. ccp.ServerParams = new Object[] { urg.Cells["FAIL_REASON"].Value.ToString() };
  230. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  231. if (ccp.ReturnCode != -1)
  232. {
  233. MessageUtil.ShowTips(ccp.ReturnInfo);
  234. if (ccp.ReturnInfo.Equals("删除成功!"))
  235. {
  236. Query();
  237. }
  238. }
  239. }
  240. else
  241. {
  242. MessageUtil.ShowTips("请选择一条数据");
  243. return;
  244. }
  245. }
  246. }
  247. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  248. {
  249. switch (e.Tool.Key.ToString())
  250. {
  251. case "Query":
  252. Query();
  253. break;
  254. //case "Add":
  255. // Add();
  256. // break;
  257. //case "Delete":
  258. // Delete();
  259. // break;
  260. case "Close":
  261. this.Close();
  262. break;
  263. }
  264. }
  265. private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
  266. {
  267. string heatno = "";
  268. UltraGridRow urg = ultraGrid4.ActiveRow;
  269. if(urg!=null)
  270. {
  271. heatno = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
  272. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmReason.queryfail", new object[] { heatno }, this.ob);
  273. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  274. }
  275. }
  276. }
  277. }