FrmDetectResult.cs 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  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.StlMes.Client.Mcp.Control;
  11. using Core.Mes.Client.Comm.Server;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Infragistics.Win.UltraWinGrid;
  14. using Core.Mes.Client.Comm.Control;
  15. using System.Collections;
  16. using com.steering.mes.mcp.entity;
  17. using Core.StlMes.Client.Mcp.Mch.MchResult;
  18. namespace Core.StlMes.Client.Mcp.Mch
  19. {
  20. public partial class FrmDetectResult : FrmBase
  21. {
  22. private string dingwei = "";
  23. private string SlGx = "";//湿磁粉探伤工序
  24. private string SlGxname = "";
  25. private string plineCode = "";
  26. private string[] plineCodes;
  27. private string departm = "";
  28. private string storageNo = "";//仓库
  29. public static string REsultno = "";
  30. private string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  31. public FrmDetectResult()
  32. {
  33. InitializeComponent();
  34. this.IsLoadUserView = true;
  35. }
  36. private void FrmDetectResult_Load(object sender, EventArgs e)
  37. {
  38. //cmbDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
  39. //cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
  40. departm = UserInfo.GetDepartment();
  41. //plineCode = YdmBaseClass.GetPCode(departm, this.ob);//获取 用户 对应的产线
  42. plineCodes = comm.GetPlineCode(this.ValidDataPurviewIds,"G",this.CustomInfo,ob);
  43. //获取工序
  44. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "701302" }, this.ob);
  45. if (dt2.Rows.Count > 0)
  46. {
  47. SlGx = dt2.Rows[0]["BASECODE"].ToString();
  48. SlGxname = dt2.Rows[0]["BASENAME"].ToString();
  49. }
  50. frmDetectResultControl1.Ob = this.ob;
  51. frmDetectResultControl1.init();
  52. frmDetectResultControl1.init1();
  53. frmDetectResultControl1.type();
  54. frmDetectResultControl1.species();
  55. //查询仓库代码
  56. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getStorageDep", new object[] { this.UserInfo.GetDeptid(), Core.Mes.Client.Comm.Server.ClsBaseInfo.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob), "800202", "800304" }, this.ob);
  57. if (dt.Rows.Count > 0)
  58. {
  59. storageNo = dt.Rows[0]["STORAGE_NO"].ToString();
  60. }
  61. QuerySinglePlan();
  62. initControl();
  63. }
  64. protected override void OnLoad(EventArgs e)
  65. {
  66. base.OnLoad(e);
  67. this.frmDetectResultControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  68. }
  69. public override void ToolBar_Click(object sender, string ToolbarKey)
  70. {
  71. //base.ToolBar_Click(sender, ToolbarKey);
  72. switch (ToolbarKey)
  73. {
  74. case "DoQuery":
  75. QuerySinglePlan();
  76. break;
  77. case "DoSave":
  78. DoSave();
  79. break;
  80. case "DoReturn":
  81. DoReturn();
  82. break;
  83. case "DoUpdate":
  84. DoUpdate();
  85. break;
  86. case "DoBeside":
  87. DoBeside();
  88. break;
  89. case "CelBeside":
  90. DoCelBeside();
  91. break;
  92. case "doBesideQuery":
  93. DoBesideQuery();
  94. break;
  95. case "doQueryOffice":
  96. DoQueryOffice();
  97. break;
  98. case "doPrint":
  99. DoTransferPrint();
  100. break;
  101. case "doInsert":
  102. DoInsert();//绝废录入
  103. break;
  104. case "DoClose":
  105. this.Close();
  106. break;
  107. }
  108. }
  109. ///
  110. /// 绝废录入
  111. /// <summary>
  112. private void DoInsert()
  113. {
  114. UltraGridRow row = ultraGrid1.ActiveRow;
  115. if (row == null) return;
  116. string batchgroudno = row.Cells["BATCH_GROUD_NO"].Text.ToString();
  117. string outnumcut = row.Cells["OUTNUM_CUT"].Text.ToString();
  118. string linenum = row.Cells["num"].Text.ToString();
  119. string plineName = row.Cells["PLINE_NAME"].Text.ToString();
  120. string synum = row.Cells["snum"].Text.ToString();
  121. string heartNo = row.Cells["HEAT_PLAN_NO"].Text.ToString();
  122. DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmDetectResult.getQueryExpandResultStuts", new object[] { row.Cells["HEAT_PLAN_NO"].Text.ToString(), row.Cells["PLINE_CODE"].Text.ToString() }, this.ob);
  123. if (dt1.Rows.Count > 0)
  124. {
  125. if (dt1.Rows[0]["STATION_STATUS"].ToString() == "2")
  126. {
  127. MessageUtil.ShowTips("该工序已经结炉,不允许录入绝废支数!");
  128. return;
  129. }
  130. }
  131. FrmScrapNumMeasureFail matfrm = new FrmScrapNumMeasureFail(heartNo, SlGx, SlGxname, batchgroudno, outnumcut, plineCodes, REsultno, linenum, plineName, this.ob);
  132. matfrm.ShowDialog();
  133. this.ultraGrid1.UpdateData();
  134. dingwei = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  135. QuerySinglePlan();
  136. }
  137. /// <summary>
  138. ///传递卡打印
  139. /// </summary>
  140. private void DoTransferPrint()
  141. {
  142. this.ultraGrid1.UpdateData();
  143. string jugeNo = "";
  144. string batchNo = "";
  145. string groupNo = "";
  146. string plinCode = "";
  147. string heatNo = "";
  148. //int count = 0;
  149. //ArrayList list = new ArrayList();
  150. //foreach (UltraGridRow uRow in ultraGrid1.Rows)
  151. //{
  152. // if (Convert.ToBoolean(uRow.Cells["CHK"].Text.ToString()) == true)
  153. // {
  154. // count += 1;
  155. UltraGridRow uRow = ultraGrid1.ActiveRow;
  156. if (uRow == null)
  157. {
  158. MessageUtil.ShowTips("请选择要打印的炉信息!");
  159. return;
  160. }
  161. else
  162. {
  163. heatNo = uRow.Cells["HEAT_PLAN_NO"].Text.ToString(); //炉计划ID
  164. jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Value.ToString(); //炉号
  165. batchNo = uRow.Cells["BATCH_NO"].Value.ToString(); //批号
  166. groupNo = uRow.Cells["BATCH_GROUD_NO"].Value.ToString(); //组号
  167. plinCode = uRow.Cells["PLINE_CODE"].Value.ToString(); //产线
  168. }
  169. // list.Add(jugeNo);
  170. // }
  171. // }
  172. //if (count == 0)
  173. //{
  174. // MessageUtil.ShowTips("请选择需要打印的炉信息!");
  175. // return;
  176. //}
  177. //string str = string.Join("','", (string[])list.ToArray(typeof(string)));
  178. string strurl = "";
  179. if (plinCode.Equals("C021"))//镦粗
  180. {
  181. strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=MchDeliveryCard.cpt&heatNo=" + heatNo + "&judgeNo=" + jugeNo + "&plineCode=" + plinCode + "&groupNo=" + groupNo + "&batchNo=" + batchNo + "&abc=湿磁粉探伤";
  182. //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=MchDeliveryCard.cpt&T.HEAT_PLAN_NO=" + heatNo + "&T.JUDGE_STOVE_NO=" + jugeNo + "&T.PLINE_CODE=" + plinCode + "&T2.BATCH_GROUD_NO=" + batchNo + "&TT.STATION_DESC='上料'" ;
  183. }
  184. else
  185. {
  186. strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=MchDeliveryCard.cpt&heatNo=" + heatNo + "&judgeNo=" + jugeNo + "&plineCode=" + plinCode + "&groupNo=" + groupNo + "&batchNo=" + batchNo + "&abc=湿磁粉探伤";
  187. //strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=MchDeliveryCard.cpt&T.HEAT_PLAN_NO=" + heatNo + "&T.JUDGE_STOVE_NO=" + jugeNo + "&T.PLINE_CODE" + plinCode + "&T2.BATCH_GROUD_NO=" + batchNo + "&TT.STATION_DESC='上料'";
  188. }
  189. FrmRepExcel fre = new FrmRepExcel(this.ob, strurl);
  190. fre.AutoSize = true;
  191. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  192. fre.WindowState = FormWindowState.Maximized;
  193. fre.Show();
  194. }
  195. private void DoQueryOffice()
  196. {
  197. string heatno = "";
  198. string plinename = "";
  199. UltraGridRow urg = ultraGrid1.ActiveRow;
  200. if (urg != null)
  201. {
  202. heatno = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
  203. plinename = urg.Cells["PLINE_NAME"].Text.ToString();
  204. }
  205. FrmOfficeDirect matfrm = new FrmOfficeDirect(this.ob, urg, SlGxname);
  206. matfrm.ShowDialog();
  207. }
  208. private void DoBesideQuery()
  209. {
  210. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmCrackDetectResult.getMchBugD", new object[] { txtZyBatchId.Text.ToString(), txtRollBatchId.Text.ToString(), plineCode, start }, this.ob);
  211. //GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  212. string heatno = "";
  213. string lotno = "";
  214. string plinename = "";
  215. UltraGridRow urg = ultraGrid1.ActiveRow;
  216. if (urg != null)
  217. {
  218. heatno = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
  219. lotno = urg.Cells["BATCH_NO"].Value.ToString();
  220. plinename = urg.Cells["PLINE_NAME"].Text.ToString();
  221. }
  222. FrmReason matfrm = new FrmReason(this.ob, urg, SlGxname);
  223. matfrm.ShowDialog();
  224. }
  225. private void DoCelBeside()
  226. {
  227. UltraGridRow row = ultraGrid2.ActiveRow;
  228. if (row == null) return;
  229. ArrayList list = new ArrayList();
  230. list.Add(row.Cells["HEAT_PLAN_NO"].Value.ToString());
  231. list.Add(row.Cells["PLINE_CODE"].Value.ToString());
  232. list.Add(SlGx);
  233. if (MessageUtil.ShowYesNoAndQuestion("是否撤销结炉?") == DialogResult.No)
  234. {
  235. return;
  236. }
  237. CoreClientParam ccp = new CoreClientParam();
  238. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmDetectResult";
  239. ccp.MethodName = "undoBeside";
  240. ccp.ServerParams = new Object[] { list };
  241. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  242. if (ccp.ReturnCode != -1)
  243. {
  244. MessageUtil.ShowTips(ccp.ReturnInfo);
  245. if (ccp.ReturnInfo.Equals("撤销结炉成功!"))
  246. {
  247. dingwei = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  248. QuerySinglePlan();
  249. initControl();
  250. }
  251. }
  252. }
  253. /// <summary>
  254. /// 工序结炉
  255. /// </summary>
  256. private void DoBeside()
  257. {
  258. UltraGridRow row = ultraGrid2.ActiveRow;
  259. if (row == null)
  260. {
  261. MessageUtil.ShowTips("请选择需要结炉的工单号!");
  262. return;
  263. }
  264. ArrayList list = new ArrayList();
  265. list.Add(row.Cells["HEAT_PLAN_NO"].Value.ToString());
  266. list.Add(row.Cells["PLINE_CODE"].Value.ToString());
  267. list.Add(SlGx);
  268. if (MessageUtil.ShowYesNoAndQuestion("是否结炉?") == DialogResult.No)
  269. {
  270. return;
  271. }
  272. CoreClientParam ccp = new CoreClientParam();
  273. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmDetectResult";
  274. ccp.MethodName = "updateDoBeside";
  275. ccp.ServerParams = new Object[] { list };
  276. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  277. if (ccp.ReturnCode != -1)
  278. {
  279. MessageUtil.ShowTips(ccp.ReturnInfo);
  280. if (ccp.ReturnInfo.Equals("结炉成功!"))
  281. {
  282. dingwei = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  283. QuerySinglePlan();
  284. initControl();
  285. }
  286. }
  287. }
  288. /// <summary>
  289. /// 简单查询
  290. /// </summary>
  291. private void QuerySinglePlan()
  292. {
  293. string starts = "";
  294. string plnNo = "";
  295. string judgeStoveNo = "";
  296. string index = "";
  297. string dobeside = "";
  298. #region 条件
  299. if (chkPlnNo.Checked)
  300. {
  301. if (string.IsNullOrEmpty(txtRollBatchId.Text.Trim()))
  302. {
  303. MessageUtil.ShowTips("请输入炉次计划号!");
  304. return;
  305. }
  306. else
  307. {
  308. plnNo = txtRollBatchId.Text.ToString().Trim();
  309. }
  310. }
  311. if (chkJuNo.Checked)
  312. {
  313. if (string.IsNullOrEmpty(txtZyBatchId.Text.Trim()))
  314. {
  315. MessageUtil.ShowTips("请输入炉号!");
  316. return;
  317. }
  318. else
  319. {
  320. judgeStoveNo = txtZyBatchId.Text.ToString().Trim();
  321. }
  322. }
  323. #endregion
  324. //string[] start = contorlPlanStatus1.statusArr;
  325. if (ultraOptionSet1.CheckedIndex.ToString() == "0")
  326. {
  327. index = "0";
  328. dobeside = this.ultraOptionSet1.CheckedItem.DataValue.ToString();
  329. }
  330. else
  331. {
  332. index = "1";
  333. dobeside = this.ultraOptionSet1.CheckedItem.DataValue.ToString();
  334. }
  335. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getSingleJGPlan", new object[] { judgeStoveNo, plnNo, plineCodes, dobeside, index }, this.ob);
  336. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  337. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  338. foreach (UltraGridRow urg in ultraGrid1.Rows)
  339. {
  340. if (urg.Cells["PLANSTATUS"].Text.Equals("生产中"))
  341. {
  342. urg.Cells["PLANSTATUS"].Appearance.BackColor = Color.LightGreen;
  343. }
  344. if (urg.Cells["PLANSTATUS"].Text.Equals("生产完成"))
  345. {
  346. urg.Cells["PLANSTATUS"].Appearance.BackColor = Color.Red;
  347. }
  348. if (urg.Cells["PLANSTATUS"].Text.Equals("关闭"))
  349. {
  350. urg.Cells["PLANSTATUS"].Appearance.BackColor = Color.Red;
  351. }
  352. if (urg.Cells["BESIDE_STATUS"].Text.Equals("湿磁粉探伤结束"))
  353. {
  354. urg.Cells["BESIDE_STATUS"].Appearance.BackColor = Color.LightGray;
  355. }
  356. }
  357. foreach (UltraGridRow urg in ultraGrid1.Rows)
  358. {
  359. if (urg != null)
  360. {
  361. urg.Cells["snum"].Appearance.BackColor = Color.OrangeRed;
  362. }
  363. }
  364. if (dt.Rows.Count > 0)
  365. {
  366. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  367. {
  368. if (ultraGrid1.Rows[i].Cells["HEAT_PLAN_NO"].Value.ToString() == dingwei)
  369. {
  370. UltraGridRow row = ultraGrid1.Rows[i];
  371. row.Activate();
  372. }
  373. }
  374. }
  375. dingwei = "";
  376. }
  377. /// <summary>
  378. /// 上料计划详情
  379. /// </summary>
  380. /// <param name="sender"></param>
  381. /// <param name="e"></param>
  382. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  383. {
  384. this.getUltraGrid1AfterRowActivate();
  385. }
  386. private void getUltraGrid1AfterRowActivate()
  387. {
  388. UltraGridRow urg = ultraGrid1.ActiveRow;
  389. if (urg == null) return;
  390. ultraGrid2.UpdateData();
  391. UltraGridRow row = ultraGrid2.ActiveRow;
  392. if (row == null) return;
  393. string outnumcut = urg.Cells["OUTNUM_CUT"].Text.ToString();
  394. string heatNo = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  395. frmDetectResultControl1.ResultNo = row.Cells["RESULT_NO"].Value.ToString();
  396. string resultno = row.Cells["RESULT_NO"].Value.ToString();
  397. REsultno = row.Cells["RESULT_NO"].Value.ToString();
  398. //查询加工管号队列合格的支、吨
  399. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryRCLPortVrp2", new object[] { heatNo }, ob);
  400. MchMtResultEntity result = new MchMtResultEntity();
  401. //if (row.Cells["IF_MONITOR_RCL"].Text.ToString().Equals("是"))
  402. //{
  403. // this.instructionCardControl1.Grid.DisplayLayout.Bands[0].Columns["Producer"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  404. // this.instructionCardControl1.Grid.DisplayLayout.Bands[0].Columns["ProducerTime"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  405. //}
  406. //else
  407. //{
  408. // this.instructionCardControl1.Grid.DisplayLayout.Bands[0].Columns["Producer"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  409. // this.instructionCardControl1.Grid.DisplayLayout.Bands[0].Columns["ProducerTime"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  410. //}
  411. //instructionCardControl1.JudNo = row.Cells["HEATNO_LAST"].Text.ToString();
  412. //instructionCardControl1.BatchNo = row.Cells["ZG_BATCH_NO"].Text.ToString();
  413. //instructionCardControl1.GroupNo = row.Cells["BATCH_GROUD_NO"].Text.ToString();
  414. //instructionCardControl1.Ob = this.ob;
  415. //string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  416. //result.ProNum = row.Cells["ACT_COUNT"].Text.ToString();
  417. // result.ProWt = row.Cells["ACT_WEIGHT"].Text.ToString();
  418. result.ProShift = UserInfo.GetUserOrder();
  419. result.ProGroup = UserInfo.GetUserGroup();
  420. //result.CreateUser = UserInfo.GetUserName();
  421. //result.ColTime = time;
  422. result.CreateTime = row.Cells["CREATE_TIME"].Text.ToString();
  423. result.CreateUser = row.Cells["CREATE_USER"].Text.ToString();
  424. result.CtrStiCurInt = row.Cells["CTR_STI_CUR_INT"].Text.ToString();
  425. result.DemagVol = row.Cells["DEMAG_VOL"].Text.ToString();
  426. result.DubiousNum = row.Cells["DUBIOUS_NUM"].Text.ToString();
  427. result.FailNum = row.Cells["FAIL_NUM"].Text.ToString();
  428. result.FpassNum = row.Cells["FPASS_NUM"].Text.ToString();
  429. result.FtestingNum = row.Cells["FTESTING_NUM"].Text.ToString();
  430. result.HeatPlanNo = row.Cells["HEAT_PLAN_NO"].Text.ToString();
  431. result.MagSuspLiqCon = row.Cells["MAG_SUSP_LIQ_CON"].Text.ToString();
  432. result.MtNote = row.Cells["MT_NOTE"].Text.ToString();
  433. result.MtType = row.Cells["MT_TYPE"].Text.ToString();
  434. result.ProGroup = row.Cells["PRO_GROUP"].Value.ToString();
  435. result.ProShift = row.Cells["PRO_SHIFT"].Text.ToString();
  436. result.ShimMagIndic = row.Cells["SHIM_MAG_INDIC"].Text.ToString();
  437. result.ShimMagType = row.Cells["SHIM_MAG_TYPE"].Text.ToString();
  438. result.SignMan = row.Cells["SIGN_ISSUED"].Text.ToString();
  439. result.SignManGrade = row.Cells["SIGN_MAN_GRADE"].Text.ToString();
  440. result.TestingGrade1 = row.Cells["TESTING_GRADE1"].Text.ToString();
  441. result.TestingGrade2 = row.Cells["TESTING_GRADE2"].Text.ToString();
  442. result.TestingGrade3 = row.Cells["TESTING_GRADE3"].Text.ToString();
  443. result.TestingGrade4 = row.Cells["TESTING_GRADE4"].Text.ToString();
  444. result.TestingStandard1 = row.Cells["TESTING_STANDARD1"].Text.ToString();
  445. result.TestingStandard2 = row.Cells["TESTING_STANDARD2"].Text.ToString();
  446. result.TestingStandard3 = row.Cells["TESTING_STANDARD3"].Text.ToString();
  447. result.TestingStandard4 = row.Cells["TESTING_STANDARD4"].Text.ToString();
  448. result.TetNum = row.Cells["TET_NUM"].Text.ToString();
  449. result.UpdateName = row.Cells["UPDATE_NAME"].Text.ToString();
  450. result.UpdateTime = row.Cells["UPDATE_TIME"].Text.ToString();
  451. result.ProNum = dt2.Rows[0]["ACT_COUNT"].ToString();
  452. this.frmDetectResultControl1.Value = result;
  453. if(row.Cells["FAIL_NUM"].Value.ToString()=="0")
  454. {
  455. CoreClientParam ccp = new CoreClientParam();
  456. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmCrackDetectResult";
  457. ccp.MethodName = "getqueryfailnum";
  458. ccp.ServerParams = new Object[] { resultno };
  459. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  460. }
  461. //查询实绩里不同分切数的加工支数
  462. DataTable dt3 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmDetectResult.getQueryNum", new object[] { heatNo, outnumcut }, ob);
  463. int num = 0;
  464. int fnum = 0;
  465. UltraGridRow uggr = ultraGrid2.ActiveRow;
  466. string outnum = uggr.Cells["OUTNUM_CUT"].Text.ToString();
  467. foreach (UltraGridRow ugr in ultraGrid2.Rows)
  468. {
  469. if (ugr.Cells["OUTNUM_CUT"].Text.ToString() == outnum)
  470. {
  471. num = num + Convert.ToInt32(dt3.Rows[0]["TET_NUM"].ToString());
  472. fnum = fnum + Convert.ToInt32(dt3.Rows[0]["FAIL_NUM"].ToString());
  473. }
  474. }
  475. UltraGridRow uug = ultraGrid1.ActiveRow;
  476. if (uug != null)
  477. {
  478. uug.Cells["num"].Value = num;
  479. if (FrmScrapNumMeasureFail.CrNum != 0)
  480. {
  481. uug.Cells["snum"].Value = Convert.ToInt32(dt2.Rows[0]["ACT_COUNT"].ToString()) - num - Convert.ToInt32(FrmScrapNumMeasureFail.CrNum);
  482. }
  483. else
  484. {
  485. uug.Cells["snum"].Value = Convert.ToInt32(dt2.Rows[0]["ACT_COUNT"].ToString()) - num;
  486. }
  487. if (Convert.ToInt32(uug.Cells["snum"].Value) <= 0)
  488. {
  489. uug.Cells["snum"].Value = 0;
  490. }
  491. }
  492. frmDetectResultControl1.fenum = uug.Cells["snum"].Value.ToString();
  493. }
  494. /// <summary>
  495. /// 根据计划号查询湿磁粉探伤实绩
  496. /// </summary>
  497. /// <param name="planNo"></param>
  498. public void GetLoadResult(string heatNo)
  499. {
  500. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmDetectResult.getQueryExpandResult", new object[] { heatNo }, this.ob);
  501. GridHelper.CopyDataToDatatable(ref dt, ref dtLoadRecord, true);
  502. }
  503. /// <summary>
  504. /// 初始化控件
  505. /// </summary>
  506. private void initControl()
  507. {
  508. ultraGrid1.UpdateData();
  509. UltraGridRow row = ultraGrid1.ActiveRow;
  510. if (row == null) return;
  511. string outnumcut = row.Cells["OUTNUM_CUT"].Text.ToString();
  512. string heatNo = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  513. //查询加工管号队列合格的支、吨
  514. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryRCLPortVrp3", new object[] { heatNo,outnumcut }, ob);
  515. MchMtResultEntity result = new MchMtResultEntity();
  516. //string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  517. //DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMcpLoading.getTime", null, this.ob);
  518. result.ProShift = UserInfo.GetUserOrder();
  519. result.ProGroup = UserInfo.GetUserGroup();
  520. result.CreateUser = UserInfo.GetUserName();
  521. //result.ColTime = time;
  522. result.CreateTime = time;
  523. result.ProducerTime = time;
  524. result.ProNum = dt2.Rows[0]["ACT_COUNT"].ToString();
  525. this.frmDetectResultControl1.Value = result;
  526. }
  527. /// <summary>
  528. /// 湿磁粉探伤实绩保存
  529. /// </summary>
  530. private void DoSave()
  531. {
  532. if (this.frmDetectResultControl1.ValidInput1())
  533. {
  534. string batchgroudno = "";//组号
  535. string outnumcut = "";//分切数
  536. string lengthin = "";//长度
  537. string lengthmaxin = "";//长度上限
  538. string lengthminin = "";//长度下限
  539. int synum = 0;
  540. ArrayList dname = new ArrayList();
  541. ArrayList fname = new ArrayList();
  542. if (Core.StlMes.Client.Mcp.Control.FrmScrap.dName != null)
  543. {
  544. dname = Core.StlMes.Client.Mcp.Control.FrmScrap.dName;
  545. }
  546. if (Core.StlMes.Client.Mcp.Control.FrmScrap.fName != null)
  547. {
  548. fname = Core.StlMes.Client.Mcp.Control.FrmScrap.fName;
  549. }
  550. ArrayList jfname = new ArrayList();
  551. if (FrmScrapNumMeasureFail.CrName != null)
  552. {
  553. jfname = FrmScrapNumMeasureFail.CrName;
  554. }
  555. UltraGridRow row = ultraGrid1.ActiveRow;
  556. if (row != null)
  557. {
  558. synum = Convert.ToInt32(row.Cells["snum"].Text.ToString());
  559. if (synum <= 0)
  560. {
  561. MessageUtil.ShowTips("剩余支数小于等于0,无法新增!");
  562. return;
  563. }
  564. batchgroudno = row.Cells["BATCH_GROUD_NO"].Text.ToString();
  565. outnumcut = row.Cells["OUTNUM_CUT"].Text.ToString();
  566. lengthin = row.Cells["LENGTH_IN"].Text.ToString();
  567. lengthminin = row.Cells["LENGTHMIN_IN"].Text.ToString();
  568. lengthmaxin = row.Cells["LENGTHMAX_IN"].Text.ToString();
  569. this.frmDetectResultControl1.UpdateData();
  570. MchMtResultEntity result = this.frmDetectResultControl1.Value;
  571. if (result.ProNum == "" || result.ProNum == null)
  572. {
  573. result.ProNum = "0";
  574. }
  575. if (result.FailNum == "" || result.FailNum == null)
  576. {
  577. result.FailNum = "0";
  578. }
  579. if (result.DubiousNum == "" || result.DubiousNum == null)
  580. {
  581. result.DubiousNum = "0";
  582. }
  583. if (result.FpassNum == "" || result.FpassNum == null)
  584. {
  585. result.FpassNum = "0";
  586. }
  587. if (result.FtestingNum == "" || result.FtestingNum == null)
  588. {
  589. result.FtestingNum = "0";
  590. }
  591. result.ZyBatchId = row.Cells["ZY_BATCH_ID"].Value.ToString();
  592. result.HeatPlanNo = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  593. if (result.ProNum == "0")
  594. {
  595. MessageUtil.ShowTips("检验支数是零,不允许新增!");
  596. return;
  597. }
  598. string tetnum = "";
  599. foreach (UltraGridRow rgg in ultraGrid2.Rows)
  600. {
  601. if (rgg != null)
  602. {
  603. tetnum = Convert.ToString(Convert.ToInt32(rgg.Cells["TET_NUM"].Value.ToString()) + Convert.ToInt32(result.TetNum));
  604. }
  605. }
  606. string heatNo = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  607. //查询加工管号队列合格的支、吨
  608. int count = 0;
  609. double weghit = 0;
  610. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryRCLPortVrp2", new object[] { heatNo }, ob);
  611. if (dt2.Rows.Count > 0)
  612. {
  613. count = int.Parse(dt2.Rows[0]["ACT_COUNT"].ToString());
  614. weghit = Double.Parse(dt2.Rows[0]["ACT_WEIGHT"].ToString());
  615. }
  616. if (int.Parse(result.ProNum) > count)
  617. {
  618. MessageUtil.ShowTips("合格支数不能超过管号队列合格的支数!");
  619. return;
  620. }
  621. if (result.ProNum.Equals("0") && result.FailNum.Equals("0"))
  622. {
  623. MessageUtil.ShowTips("合格支数与废品支数都是零,无法新增!!");
  624. return;
  625. }
  626. //查询探伤实绩合格支数的和
  627. DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmDetectResult.getQueryExpandResult1", new object[] { row.Cells["HEAT_PLAN_NO"].Value.ToString() }, this.ob);
  628. //VrpLoadingResultEntity result1 = new VrpLoadingResultEntity();
  629. //this.planExpanQuery1.Value = result;
  630. string pronum = "";
  631. if (dt1.Rows.Count > 0)
  632. {
  633. pronum = dt1.Rows[0]["PRO_NUM"].ToString();
  634. }
  635. else
  636. {
  637. pronum = "0";
  638. }
  639. if (count == 0)
  640. {
  641. if (int.Parse(pronum) + int.Parse(result.ProNum) >= count)
  642. {
  643. MessageUtil.ShowTips("探伤实绩合格支数和作业实绩合格支数的和超过或等于管号队列合格支数,无法新增!!");
  644. return;
  645. }
  646. }
  647. else
  648. {
  649. if (int.Parse(pronum) + int.Parse(result.ProNum) > count)
  650. {
  651. MessageUtil.ShowTips("探伤实绩合格支数和作业实绩合格支数的和超过管号队列合格支数,无法新增!!");
  652. return;
  653. }
  654. }
  655. if (FrmScrapNumMeasureFail.CrNum != 0)
  656. {
  657. result.ProNum = Convert.ToString(int.Parse(result.ProNum) - FrmScrapNumMeasureFail.CrNum);
  658. if (result.ProWt == null || result.ProWt=="")
  659. {
  660. result.ProWt = "0.00";
  661. }
  662. else
  663. {
  664. result.ProWt = Convert.ToString(FrmScrapNumMeasureFail.CrNum * (int.Parse(result.ProNum) / double.Parse(result.ProWt)));
  665. }
  666. }
  667. CoreClientParam ccp = new CoreClientParam();
  668. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmDetectResult";
  669. ccp.MethodName = "saveExpandResult";
  670. ccp.ServerParams = new Object[] { result, heatNo, SlGx, row.Cells["PLINE_CODE"].Value.ToString(), tetnum, batchgroudno, outnumcut, lengthin, lengthmaxin, lengthminin, dname, fname, jfname };
  671. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  672. if (ccp.ReturnCode != -1)
  673. {
  674. MessageUtil.ShowTips(ccp.ReturnInfo);
  675. if (ccp.ReturnInfo.Equals("新增湿磁粉探伤成功!"))
  676. {
  677. dingwei = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  678. QuerySinglePlan();
  679. initControl();
  680. jfname.Clear();
  681. fname.Clear();
  682. FrmScrapNumMeasureFail.query(heatNo);
  683. }
  684. }
  685. }
  686. }
  687. }
  688. /// <summary>
  689. /// 撤销湿磁粉探伤
  690. /// </summary>
  691. private void DoReturn()
  692. {
  693. int nnum = 0;
  694. UltraGridRow row = ultraGrid2.ActiveRow;
  695. UltraGridRow Rows = ultraGrid2.ActiveRow;
  696. if (Rows == null) return;
  697. if (row != null)
  698. {
  699. int detCount = 0;
  700. detCount = int.Parse(row.Cells["FAIL_NUM"].Text.ToString());
  701. string outnumcut = row.Cells["OUTNUM_CUT"].Text.ToString();
  702. int delCount = 0;
  703. ArrayList list = new ArrayList();
  704. delCount += 1;
  705. ArrayList list1 = new ArrayList();
  706. list1.Add(Rows.Cells["RESULT_NO"].Value.ToString());
  707. list1.Add(Rows.Cells["ZY_BATCH_ID"].Value.ToString());
  708. list1.Add(Rows.Cells["HEAT_PLAN_NO"].Value.ToString());
  709. if (delCount == 0)
  710. {
  711. MessageUtil.ShowTips("请选择湿磁粉探伤信息!");
  712. return;
  713. }
  714. string tetnum = "";
  715. UltraGridRow urg = ultraGrid2.ActiveRow;
  716. if (urg != null)
  717. {
  718. tetnum = urg.Cells["TET_NUM"].Value.ToString();
  719. }
  720. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmDriftDiameterResult.getQueryJFailNum", new object[] { row.Cells["RESULT_NO"].Value.ToString(), row.Cells["HEAT_PLAN_NO"].Value.ToString(), row.Cells["PLINE_CODE"].Value.ToString() }, this.ob);
  721. if (dt.Rows.Count > 0)
  722. {
  723. nnum = int.Parse(dt.Rows[0]["FAIL_NUM"].ToString());
  724. }
  725. CoreClientParam ccp = new CoreClientParam();
  726. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmDetectResult";
  727. ccp.MethodName = "deleteVrpExpandResult";
  728. ccp.ServerParams = new Object[] { list1, Rows.Cells["HEAT_PLAN_NO"].Value.ToString(), row.Cells["PLINE_CODE"].Value.ToString(), SlGx, tetnum, outnumcut, nnum,detCount };
  729. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  730. if (ccp.ReturnCode != -1)
  731. {
  732. MessageUtil.ShowTips(ccp.ReturnInfo);
  733. if (ccp.ReturnInfo.Equals("删除湿磁粉探伤成功!"))
  734. {
  735. dingwei = row.Cells["HEAT_PLAN_NO"].Value.ToString();
  736. QuerySinglePlan();
  737. initControl();
  738. }
  739. }
  740. this.getUltraGrid1AfterRowActivate();
  741. }
  742. }
  743. /// <summary>
  744. /// 修改
  745. /// </summary>
  746. private void DoUpdate()
  747. {
  748. UltraGridRow row = ultraGrid1.ActiveRow;
  749. UltraGridRow urg = ultraGrid2.ActiveRow;
  750. if (urg == null) return;
  751. if (row == null) return;
  752. if (this.frmDetectResultControl1.ValidInput1())
  753. {
  754. this.frmDetectResultControl1.UpdateData();
  755. MchMtResultEntity result = this.frmDetectResultControl1.Value;
  756. //ArrayList list1 = new ArrayList();
  757. result.HeatPlanNo = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
  758. result.ResultNo = urg.Cells["RESULT_NO"].Value.ToString();
  759. CoreClientParam ccp = new CoreClientParam();
  760. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmDetectResult";
  761. ccp.MethodName = "updateVrpExpandResult";
  762. ccp.ServerParams = new Object[] { result, urg.Cells["RESULT_NO"].Value.ToString(), row.Cells["PLINE_CODE"].Value.ToString(), SlGx };
  763. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  764. if (ccp.ReturnCode != -1)
  765. {
  766. MessageUtil.ShowTips(ccp.ReturnInfo);
  767. }
  768. this.getUltraGrid1AfterRowActivate();
  769. }
  770. }
  771. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  772. {
  773. ultraGrid1.UpdateData();
  774. UltraGridRow urg = ultraGrid1.ActiveRow;
  775. if (urg == null) return;
  776. string outnumcut = urg.Cells["OUTNUM_CUT"].Text.ToString();
  777. string heatNo = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
  778. frmDetectResultControl1.heatNo = urg.Cells["HEAT_PLAN_NO"].Value.ToString();
  779. plineCode = urg.Cells["PLINE_CODE"].Value.ToString();
  780. //查询加工管号队列合格的支、吨
  781. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryRCLPortVrp3", new object[] { heatNo,outnumcut }, ob);
  782. if (urg != null)
  783. {
  784. urg.Cells["snum"].Value = dt2.Rows[0]["ACT_COUNT"].ToString();
  785. if (urg.Cells["num"].Value.ToString() == "" || urg.Cells["num"].Value.ToString() == null)
  786. {
  787. urg.Cells["num"].Value = "0";
  788. }
  789. }
  790. frmDetectResultControl1.fenum = urg.Cells["snum"].Text.ToString();
  791. MchMtResultEntity result = new MchMtResultEntity();
  792. //string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  793. //DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmMcpLoading.getTime", null, this.ob);
  794. //result.ProNum = row.Cells["ACT_COUNT"].Text.ToString();
  795. // result.ProWt = row.Cells["ACT_WEIGHT"].Text.ToString();
  796. result.ProShift = UserInfo.GetUserOrder();
  797. result.ProGroup = UserInfo.GetUserGroup();
  798. result.CreateUser = UserInfo.GetUserName();
  799. //result.RroTime = time;
  800. result.CreateTime = time;
  801. result.TetNum = dt2.Rows[0]["ACT_COUNT"].ToString();
  802. result.ProNum = dt2.Rows[0]["ACT_COUNT"].ToString();
  803. this.frmDetectResultControl1.Value = result;
  804. this.GetLoadResult(heatNo);
  805. frmDetectResultControl1.Ob = this.ob;
  806. frmDetectResultControl1.init(urg.Cells["PLINE_NAME"].Text.ToString());
  807. frmDetectResultControl1.plinCode = plineCode;
  808. frmDetectResultControl1.SlGx = SlGx;
  809. //查询管号队列
  810. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryJGPortVrphot", new object[] { heatNo }, this.ob);
  811. GridHelper.CopyDataToDatatable(ref dt, ref dataTable3, true);
  812. GridHelper.RefreshAndAutoSize(this.ultraGrid4);
  813. foreach (UltraGridRow urg1 in ultraGrid4.Rows)
  814. {
  815. if (urg1.Cells["MAT_STATUS"].Text.Equals("剔除"))
  816. {
  817. urg1.Cells["MAT_STATUS"].Appearance.ForeColor = Color.Red;
  818. }
  819. if (urg1.Cells["MAT_STATUS"].Text.Equals("绝废"))
  820. {
  821. urg1.Cells["MAT_STATUS"].Appearance.ForeColor = Color.Red;
  822. }
  823. }
  824. }
  825. private void chkStarts_CheckedChanged(object sender, EventArgs e)
  826. {
  827. if (chkPlnNo.Checked) { txtRollBatchId.Enabled = true; } else { txtRollBatchId.Enabled = false; }
  828. if (chkJuNo.Checked) { txtZyBatchId.Enabled = true; } else { txtZyBatchId.Enabled = false; }
  829. }
  830. private void BtOffline_Click(object sender, EventArgs e)
  831. {
  832. UltraGridRow row = ultraGrid1.ActiveRow;
  833. if (row == null) return;
  834. string batchgroudno = row.Cells["BATCH_GROUD_NO"].Text.ToString();
  835. string outnumcut = row.Cells["OUTNUM_CUT"].Text.ToString();
  836. UltraGridRow row3 = ultraGrid4.ActiveRow;
  837. if (row3 == null) return;
  838. MchMtResultEntity result = this.frmDetectResultControl1.Value;
  839. if (OfflineNum.Value.ToString().Equals("0"))
  840. {
  841. MessageUtil.ShowTips("请输入离线支数!");
  842. return;
  843. }
  844. ArrayList list = new ArrayList();
  845. list.Add(row.Cells["HEAT_PLAN_NO"].Value.ToString());
  846. list.Add(SlGx);
  847. list.Add(SlGxname);
  848. list.Add(this.UserInfo.GetUserName());
  849. list.Add(time);
  850. list.Add(this.UserInfo.GetUserOrder());
  851. list.Add(this.UserInfo.GetUserGroup());
  852. list.Add(OfflineNum.Value.ToString());
  853. if (MessageUtil.ShowYesNoAndQuestion("是否离线?") == DialogResult.No) return;
  854. CoreClientParam ccp = new CoreClientParam();
  855. try
  856. {
  857. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  858. if (Constant.WaitingForm == null)
  859. {
  860. Constant.WaitingForm = new WaitingForm();
  861. }
  862. Constant.WaitingForm.ShowToUser = true;
  863. Constant.WaitingForm.Show();
  864. Constant.WaitingForm.Update();
  865. ccp.ServerName = "com.steering.mes.mcp.Mch.FrmDetectResult";
  866. ccp.MethodName = "offLineExpandResult";
  867. ccp.ServerParams = new Object[] { result, list, row.Cells["PLINE_CODE"].Value.ToString(), storageNo, batchgroudno, outnumcut };
  868. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  869. this.Cursor = Cursors.Default;
  870. Constant.WaitingForm.ShowToUser = false;
  871. Constant.WaitingForm.Close();
  872. Constant.WaitingForm = null;
  873. }
  874. catch (Exception ex)
  875. {
  876. this.Cursor = Cursors.Default;
  877. Constant.WaitingForm.ShowToUser = false;
  878. Constant.WaitingForm.Close();
  879. Constant.WaitingForm = null;
  880. }
  881. if (ccp.ReturnCode != -1)
  882. {
  883. MessageUtil.ShowTips(ccp.ReturnInfo);
  884. if (ccp.ReturnInfo.Equals("离线成功!"))
  885. {
  886. QuerySinglePlan();
  887. }
  888. }
  889. }
  890. //工艺文件查询
  891. private void craftImg_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  892. {
  893. UltraGridRow row = ultraGrid1.ActiveRow;
  894. string craftPath = YdmBaseClass.getQueryCraftNo(row.Cells["CRAFT_FILE_NO"].Text.ToString(),row.Cells["CRAFT_SEQ"].Text.ToString(), ob);
  895. if (e.Button.Key.ToLower().Equals("select"))
  896. {
  897. FormFileDown down = new FormFileDown(ob, craftPath);
  898. down.CtrlFileDown1.Button3.Visible = false;
  899. down.ShowDialog();
  900. }
  901. }
  902. private void OfflineNum_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  903. {
  904. UltraGridRow row = ultraGrid1.ActiveRow;
  905. if (row == null) return;
  906. string batchgroudno = row.Cells["BATCH_GROUD_NO"].Text.ToString();
  907. string outnumcut = row.Cells["OUTNUM_CUT"].Text.ToString();
  908. string heno = row.Cells["HEAT_PLAN_NO"].Text.ToString();
  909. string linenum = row.Cells["num"].Text.ToString();
  910. string plineName = row.Cells["PLINE_NAME"].Text.ToString();
  911. DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.Mch.FrmDetectResult.getQueryExpandResultStuts", new object[] { heno, row.Cells["PLINE_CODE"].Text.ToString() }, this.ob);
  912. if (dt1.Rows.Count>0)
  913. {
  914. if (dt1.Rows[0]["STATION_STATUS"].ToString() == "2")
  915. {
  916. MessageUtil.ShowTips("该工序已经结炉,不允许录入离线数!");
  917. return;
  918. }
  919. }
  920. UltraGridRow urg = ultraGrid2.ActiveRow;
  921. if (urg == null) return;
  922. UltraGridRow row3 = ultraGrid4.ActiveRow;
  923. if (row3 == null) return;
  924. MchMtResultEntity result = this.frmDetectResultControl1.Value;
  925. FrmScrapNumDetect matfrm = new FrmScrapNumDetect(result, heno, SlGx, SlGxname, batchgroudno, outnumcut, storageNo, plineCode, REsultno,linenum,plineName, this.ob);
  926. matfrm.ShowDialog();
  927. this.ultraGrid1.UpdateData();
  928. QuerySinglePlan();
  929. }
  930. }
  931. }