FrmCouplingApplPh.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. using com.steering.mes.mcp.entity;
  2. using Core.Mes.Client.Comm.Control;
  3. using Core.Mes.Client.Comm.Format;
  4. using Core.Mes.Client.Comm.Server;
  5. using Core.Mes.Client.Comm.Tool;
  6. using Core.StlMes.Client.Mcp.BaseMethod;
  7. using Core.StlMes.Client.Mcp.CollarMaterial;
  8. using Core.StlMes.Client.Mcp.Common;
  9. using Core.StlMes.Client.Mcp.Control;
  10. using Core.StlMes.Client.Mcp.Entity;
  11. using CoreFS.CA06;
  12. using Infragistics.Win;
  13. using Infragistics.Win.UltraWinGrid;
  14. using System;
  15. using System.Collections;
  16. using System.Collections.Generic;
  17. using System.ComponentModel;
  18. using System.Data;
  19. using System.Drawing;
  20. using System.Linq;
  21. using System.Text;
  22. using System.Windows.Forms;
  23. namespace Core.StlMes.Client.Mcp.Coupling
  24. {
  25. public partial class FrmCouplingApplPh : FrmBase
  26. {
  27. private string[] arr = null;
  28. private string departm = "";//获取部门ID
  29. private string[] plineCode = null;//获取产线代码
  30. private string cutGx = "";//交库工序
  31. public FrmCouplingApplPh()
  32. {
  33. InitializeComponent();
  34. this.IsLoadUserView = true;
  35. }
  36. private void FrmCouplingApplPh_Load(object sender, EventArgs e)
  37. {
  38. DateTime now = DateTime.Now;
  39. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  40. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  41. this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  42. this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  43. EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  44. EntityHelper.ShowGridCaption<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity>(ultraGrid3.DisplayLayout.Bands[0]);
  45. this.IsLoadUserView = true;
  46. arr = this.ValidDataPurviewIds;
  47. //departm = UserInfo.GetDeptid();
  48. //plineCode = McpBaseHelper.GetPCodePline(departm, this.ob);
  49. ////获取交库工序
  50. //DataTable dt3 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "700313" }, this.ob);
  51. //if (dt3.Rows.Count > 0)
  52. //{
  53. // cutGx = dt3.Rows[0]["BASECODE"].ToString();
  54. //}
  55. //PipeManageClass.BindComBaseInfo(cmbStroage, this.ob);
  56. }
  57. public override void ToolBar_Click(object sender, string ToolbarKey)
  58. {
  59. switch (ToolbarKey)
  60. {
  61. case "DoQuery":
  62. if (ultraTabControl1.SelectedTab.Index == 0)
  63. {
  64. QuerySinglePlan();
  65. }
  66. else if (ultraTabControl1.SelectedTab.Index == 1)
  67. {
  68. QueryZgJugdeApply();
  69. }
  70. break;
  71. case "DoDecision":
  72. DoDecision();//申请判定
  73. break;
  74. case "cancelDoDecision":
  75. cancelDoDecision();//撤销申请判定
  76. break;
  77. case "UpdateProWgt":
  78. updateProWgt();
  79. break;
  80. case "DoPrint":
  81. Print();
  82. break;
  83. case "DoPrint2":
  84. Print2();
  85. break;
  86. case "ExportData":
  87. if (ultraTabControl1.SelectedTab.Index == 0)
  88. {
  89. GridHelper.ulGridToExcel(ultraGrid1, "接箍炉次信息");
  90. }
  91. else if (ultraTabControl1.SelectedTab.Index == 1)
  92. {
  93. GridHelper.ulGridToExcel(ultraGrid3, "接箍申请判定信息");
  94. }
  95. break;
  96. case "DoClose":
  97. this.Close();
  98. break;
  99. }
  100. }
  101. /// <summary>
  102. /// 打印接箍缴库单
  103. /// </summary>
  104. private void Print()
  105. {
  106. this.ultraGrid1.UpdateData();
  107. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  108. if (uRow == null) return;
  109. string woId = uRow.Cells["WoId"].Text.Trim();
  110. string batchNo = uRow.Cells["BatchNo"].Value.ToString();
  111. string strurl = "";
  112. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepJgProductsPayment.cpt" + "&WO_ID=" + woId + "&BATCH_NO=" + batchNo;
  113. FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
  114. fBug.AutoSize = true;
  115. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  116. fBug.WindowState = FormWindowState.Maximized;
  117. fBug.Text = "接箍缴库单";
  118. fBug.Show();
  119. }
  120. /// <summary>
  121. /// 打印废品鉴定单
  122. /// </summary>
  123. private void Print2()
  124. {
  125. this.ultraGrid1.UpdateData();
  126. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  127. if (uRow == null) return;
  128. string woId = uRow.Cells["WoId"].Text.Trim();
  129. string strurl = "";
  130. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepJgWaster.cpt" + "&WO_ID=" + woId;
  131. FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
  132. fBug.AutoSize = true;
  133. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  134. fBug.WindowState = FormWindowState.Maximized;
  135. fBug.Text = "废品鉴定单";
  136. fBug.Show();
  137. }
  138. /// <summary>
  139. /// 查询送判数据
  140. /// </summary>
  141. private void QueryZgJugdeApply()
  142. {
  143. string Woid = "";
  144. string jugeNo = "";
  145. string startTim = "";
  146. string endTim = "";
  147. ArrayList list = new ArrayList();
  148. if (this.chkwoId.Checked && this.txtWoId.Text.Trim() != "")
  149. {
  150. Woid = this.txtWoId.Text.Trim();
  151. }
  152. if (this.chkJuNo.Checked && this.txtJudgeStoveNO.Text.Trim() != "")
  153. {
  154. jugeNo = this.txtJudgeStoveNO.Text.Trim();
  155. }
  156. if (chkTim2.Checked)
  157. {
  158. if (DateTime.Parse(this.StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
  159. {
  160. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  161. return;
  162. }
  163. else
  164. {
  165. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  166. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  167. }
  168. }
  169. list.Add(startTim);
  170. list.Add(endTim);
  171. list.Add(jugeNo);
  172. list.Add(this.ultraOptionSet1.CheckedItem.DataValue.ToString());
  173. list.Add(Woid);
  174. QcmZgJudgebindingSource1.Clear();
  175. List<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity>(
  176. "com.steering.mes.mcp.coup.FrmCouplingApplPh.QueryZgJugdeApply", new object[] { list, arr }, this.ob);
  177. QcmZgJudgebindingSource1.DataSource = listSource;
  178. // WriteTextToGrid();
  179. }
  180. /// <summary>
  181. /// 回报过磅重量
  182. /// </summary>
  183. private void updateProWgt()
  184. {
  185. this.ultraGrid1.UpdateData();
  186. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  187. if (uRow == null)
  188. {
  189. MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
  190. return;
  191. }
  192. if (!StringUtil.IsDouble(uRow.Cells["ProWt"].Value.ToString3()))
  193. {
  194. MessageUtil.ShowTips("过磅重量应输入数字!");
  195. return;
  196. }
  197. if (Double.Parse(uRow.Cells["ProWt"].Value.ToString3()) <= 0)
  198. {
  199. MessageUtil.ShowTips("请输入正确的过磅重量!");
  200. return;
  201. }
  202. ArrayList list = new ArrayList();
  203. list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
  204. list.Add(uRow.Cells["ProWt"].Value.ToString3());
  205. list.Add(uRow.Cells["BelongCode"].Value.ToString());
  206. ArrayList ArrList = new ArrayList();
  207. IQueryable<UltraGridRow> checkMags = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  208. if (checkMags.Count() == 0)
  209. {
  210. MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
  211. }
  212. else
  213. {
  214. foreach (UltraGridRow urg in checkMags)
  215. {
  216. ArrayList arrList = new ArrayList();
  217. if (!StringUtil.IsDouble(urg.Cells["ProWt"].Value.ToString3()))
  218. {
  219. MessageUtil.ShowTips("过磅重量应输入数字!");
  220. return;
  221. }
  222. if (Double.Parse(urg.Cells["ProWt"].Value.ToString3()) < 0)
  223. {
  224. MessageUtil.ShowTips("请输入正确的过磅重量!");
  225. return;
  226. }
  227. arrList.Add(urg.Cells["JudgeStoveNo"].Value.ToString());
  228. arrList.Add(urg.Cells["ProWt"].Value.ToString3());
  229. arrList.Add(urg.Cells["BelongCode"].Value.ToString());
  230. arrList.Add(urg.Cells["BatchNo"].Value.ToString());
  231. arrList.Add(urg.Cells["JgOrderno"].Value.ToString());
  232. ArrList.Add(arrList);
  233. }
  234. }
  235. CoreClientParam ccp = new CoreClientParam();
  236. ccp.ServerName = "com.steering.mes.mcp.coup.FrmCouplingApplPh";
  237. ccp.MethodName = "updateProWgt";
  238. ccp.ServerParams = new object[] { list, ArrList };
  239. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  240. if (ccp.ReturnCode != -1)
  241. {
  242. if (ccp.ReturnInfo.Equals("回报成功!"))
  243. {
  244. QuerySinglePlan();
  245. MessageUtil.ShowTips(ccp.ReturnInfo);
  246. }
  247. else
  248. {
  249. MessageUtil.ShowTips(ccp.ReturnInfo);
  250. }
  251. }
  252. }
  253. /// <summary>
  254. /// 撤销申请判定
  255. /// </summary>
  256. private void cancelDoDecision()
  257. {
  258. this.ultraGrid1.UpdateData();
  259. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  260. if (uRow == null) return;
  261. string plinCode = uRow.Cells["PlineCode"].Text.ToString();
  262. IQueryable<UltraGridRow> checkMags = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  263. if (checkMags.Count() == 0)
  264. {
  265. MessageUtil.ShowTips("请选择需要撤销送判的炉批信息!");
  266. return;
  267. }
  268. ArrayList parmList = new ArrayList();
  269. foreach (UltraGridRow row in checkMags)
  270. {
  271. string valueFlag = "";
  272. string instock = "";
  273. string processDesc = "";
  274. DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmCouplingApplPh.SelectValueFlag",
  275. new object[] { row.Cells["DeterNo"].Value.ToString(), row.Cells["DeterNoSeq"].Value.ToString(),
  276. row.Cells["JudgeStoveNo"].Value.ToString(),row.Cells["BatchNo"].Value.ToString(),
  277. plinCode },
  278. this.ob);
  279. if (dtPln.Rows.Count > 0)
  280. {
  281. valueFlag = dtPln.Rows[0]["VALIDFLAG"].ToString();
  282. instock = dtPln.Rows[0]["INSTOCK_FLAG"].ToString();
  283. }
  284. if (!valueFlag.Equals("00") && !valueFlag.Equals("10"))
  285. {
  286. MessageUtil.ShowTips("该炉批已不是初始状态/撤判状态,不允许撤销申请判定!");
  287. return;
  288. }
  289. if (instock.Equals("1"))
  290. {
  291. MessageUtil.ShowTips("质保部已经接收不允许撤销!");
  292. return;
  293. }
  294. PlnZyJgWorkbillEntity matBcEntity = (PlnZyJgWorkbillEntity)row.ListObject;
  295. if (matBcEntity.DeterNo.Equals(""))
  296. {
  297. MessageUtil.ShowTips("炉批未送判,不允许撤销申请判定!");
  298. return;
  299. }
  300. string matEntity = JSONFormat.Format(matBcEntity);
  301. parmList.Add(matEntity);
  302. }
  303. CoreClientParam ccp = new CoreClientParam();
  304. ccp.ServerName = "com.steering.mes.mcp.coup.FrmCouplingApplPh";
  305. ccp.MethodName = "cancelDoDecision";
  306. ccp.ServerParams = new object[] { parmList };
  307. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  308. if (ccp.ReturnCode != -1)
  309. {
  310. if (ccp.ReturnInfo.Equals("撤销成功!"))
  311. {
  312. string applyCode = ccp.ReturnObject.ToString();
  313. QuerySinglePlan();
  314. //this.txtMemo.Text = "";
  315. MessageUtil.ShowTips(ccp.ReturnInfo);
  316. }
  317. else
  318. {
  319. MessageUtil.ShowTips(ccp.ReturnInfo);
  320. }
  321. }
  322. }
  323. private void QuerySinglePlan()
  324. {
  325. string Woid = "";
  326. string jugeNo = "";
  327. string startTim = "";
  328. string endTim = "";
  329. ArrayList list = new ArrayList();
  330. if (this.chkwoId.Checked && this.txtWoId.Text.Trim() != "")
  331. {
  332. Woid = this.txtWoId.Text.Trim();
  333. }
  334. if (this.chkJuNo.Checked && this.txtJudgeStoveNO.Text.Trim() != "")
  335. {
  336. jugeNo = this.txtJudgeStoveNO.Text.Trim();
  337. }
  338. if (chkTim2.Checked)
  339. {
  340. if (DateTime.Parse(this.StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
  341. {
  342. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  343. return;
  344. }
  345. else
  346. {
  347. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  348. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  349. }
  350. }
  351. list.Add(startTim);
  352. list.Add(endTim);
  353. list.Add(jugeNo);
  354. list.Add(this.ultraOptionSet1.CheckedItem.DataValue.ToString());
  355. list.Add(Woid);
  356. PlnZyWorkBillbindingSource.Clear();
  357. List<PlnZyJgWorkbillEntity> listSource = EntityHelper.GetData<PlnZyJgWorkbillEntity>(
  358. "com.steering.mes.mcp.coup.FrmCouplingApplPh.doQueryMat", new object[] { list, arr }, this.ob);
  359. PlnZyWorkBillbindingSource.DataSource = listSource;
  360. double mater = 0.0;
  361. double proWt = 0.0;
  362. double loadWt = 0.0;
  363. foreach(UltraGridRow urg in ultraGrid1.Rows)
  364. {
  365. proWt += Convert.ToDouble(urg.Cells["ProWt"].Value.ToString());
  366. loadWt += Convert.ToDouble(urg.Cells["RealBlWt"].Value.ToString());
  367. }
  368. mater = proWt / loadWt;
  369. ultraGrid1.DisplayLayout.Bands[0].Summaries[9].DisplayFormat = Math.Round(mater*100, 2).ToString() + "%";
  370. }
  371. /// <summary>
  372. /// 编辑区Gird
  373. /// </summary>
  374. /// <param name="sender"></param>
  375. /// <param name="e"></param>
  376. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  377. {
  378. string woid = "";
  379. string judgeNo = "";
  380. UltraGridRow urg = ultraGrid1.ActiveRow;
  381. if (urg == null)
  382. {
  383. return;
  384. }
  385. else
  386. {
  387. woid = urg.Cells["WoId"].Value.ToString();
  388. judgeNo = urg.Cells["JudgeStoveNo"].Value.ToString();
  389. }
  390. ultraGrid1.UpdateData();
  391. if (urg.Cells["ProWt"].Text != "")
  392. {
  393. string count = "";
  394. DataTable dtHtt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmCouplingApplPh.doQueryJudgeBathCount",
  395. new object[] { woid, judgeNo, this.ultraOptionSet1.CheckedItem.DataValue.ToString() },
  396. this.ob); //热处理类型
  397. if (dtHtt.Rows.Count > 0)
  398. {
  399. count =
  400. (Convert.ToDouble(urg.Cells["ProWt"].Text.ToString()) /
  401. Convert.ToDouble(urg.Cells["ProNum"].Text.ToString())).ToString("f6");
  402. }
  403. //foreach (UltraGridRow row in this.ultraGrid2.Rows)
  404. //{
  405. // // row.Cells["PonderGrossWt"].Value = (Convert.ToDouble(count) * Convert.ToInt32(dtHtt.Rows[i]["COUNT"].ToString())).ToString("f3");
  406. // row.Cells["ProWt"].Value =
  407. // (Convert.ToDouble(count) * Convert.ToInt32(row.Cells["ProNum"].Text.ToString())).ToString("f3");
  408. // row.Cells["CHK"].Value = "True";
  409. // row.Update();
  410. //}
  411. }
  412. }
  413. private void DoDecision()
  414. {
  415. this.ultraGrid1.UpdateData();
  416. UltraGridRow sRow = this.ultraGrid1.ActiveRow;
  417. if (sRow == null) return;
  418. string PlinCode = sRow.Cells["PlineCode"].Value.ToString();
  419. string judgeNo = sRow.Cells["JudgeStoveNo"].Value.ToString();
  420. string batchNo = sRow.Cells["BatchNo"].Value.ToString();
  421. IQueryable<UltraGridRow> checkMags = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  422. if (checkMags.Count() == 0)
  423. {
  424. MessageUtil.ShowTips("请选择需要送判的炉批信息!");
  425. return;
  426. }
  427. ArrayList parmList = new ArrayList();
  428. foreach (UltraGridRow row in checkMags)
  429. {
  430. PlnZyJgWorkbillEntity matBcEntity = (PlnZyJgWorkbillEntity)row.ListObject;
  431. if (!matBcEntity.DeterNo.Equals(""))
  432. {
  433. MessageUtil.ShowTips("炉批已进行送判,不允许重复送判!");
  434. return;
  435. }
  436. string matEntity = JSONFormat.Format(matBcEntity);
  437. parmList.Add(matEntity);
  438. }
  439. CoreClientParam ccp = new CoreClientParam();
  440. ccp.ServerName = "com.steering.mes.mcp.coup.FrmCouplingApplPh";
  441. ccp.MethodName = "doDecision";
  442. ccp.ServerParams = new object[] { parmList,UserInfo.GetUserName() };
  443. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  444. if (ccp.ReturnCode != -1)
  445. {
  446. if (ccp.ReturnInfo.Equals("申请判定成功!"))
  447. {
  448. QuerySinglePlan();
  449. MessageUtil.ShowTips("申请判定成功!");
  450. }
  451. else
  452. {
  453. MessageUtil.ShowTips(ccp.ReturnInfo);
  454. }
  455. }
  456. }
  457. /// <summary>
  458. /// ultraGrid2 触发事件
  459. /// </summary>
  460. /// <param name="sender"></param>
  461. /// <param name="e"></param>
  462. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  463. {
  464. UltraGridRow row = ultraGrid1.ActiveRow;
  465. if (row == null)
  466. {
  467. //List<CouplingComInfoEntity> listSource = new List<Entity.CouplingComInfoEntity>();
  468. //CouplingComInfoEntity.DataSource = listSource;
  469. //GridHelper.RefreshAndAutoSize(ultraGrid3);
  470. }
  471. else
  472. {
  473. //List<CouplingComInfoEntity> listSource = EntityHelper.GetData<CouplingComInfoEntity>
  474. // ("com.steering.mes.mcp.coup.FrmInLibrary.doQueryInfoResult", new object[] { row.Cells["ZY_PLAN_ID"].Text.ToString(), row.Cells["WO_ID"].Text.ToString() }, this.ob);
  475. //CouplingComInfoEntity.DataSource = listSource;
  476. //GridHelper.RefreshAndAutoSize(ultraGrid3);
  477. }
  478. }
  479. private void chkStarts_CheckedChanged(object sender, EventArgs e)
  480. {
  481. if (chkJuNo.Checked) { txtJudgeStoveNO.Enabled = true; } else { txtJudgeStoveNO.Enabled = false; }
  482. // if (chkPlnNo.Checked) { txtPlnNo.Enabled = true; } else { txtPlnNo.Enabled = false; }
  483. if (chkwoId.Checked) { txtWoId.Enabled = true; } else { txtWoId.Enabled = false; }
  484. }
  485. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  486. {
  487. if (toolMenu == null) return;
  488. if (ultraTabControl1.SelectedTab.Index == 0)
  489. {
  490. chkTim2.Text = "入库日期";
  491. }
  492. else if (ultraTabControl1.SelectedTab.Index == 1)
  493. {
  494. chkTim2.Text = "送判日期";
  495. }
  496. }
  497. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  498. {
  499. }
  500. /// <summary>
  501. /// 查询炉批信息
  502. /// </summary>
  503. // private void doQueryJudgeBath(string woid, string judgeNo, string jugdeApplyCode)
  504. // {
  505. // UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  506. // if (uRow == null)
  507. // {
  508. // return;
  509. // }
  510. // List<CouplingMatMEntity1> listSource = EntityHelper.GetData<CouplingMatMEntity1>(
  511. // "com.steering.mes.mcp.coup.FrmCouplingApplPh.doQueryJudgeBath", new object[] { woid, judgeNo, jugdeApplyCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  512. // CouplingMatMbindingSource1.DataSource = listSource;
  513. // foreach (UltraGridRow row in this.ultraGrid2.Rows)
  514. // {
  515. // row.Cells["CHK"].Value = "True";
  516. // row.Update();
  517. // }
  518. // List<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity> listSource1 = EntityHelper.GetData<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity>(
  519. //"com.steering.mes.mcp.coup.FrmCouplingApplPh.doQueryQcmZgApplyData", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  520. // if(listSource1.Count>0)
  521. // {
  522. // ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
  523. // foreach (UltraGridRow row in this.ultraGrid2.Rows)
  524. // {
  525. // row.Cells["isFlag"].Value = "是";
  526. // }
  527. // }
  528. // else
  529. // {
  530. // ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
  531. // foreach (UltraGridRow row in this.ultraGrid2.Rows)
  532. // {
  533. // row.Cells["isFlag"].Value = "否";
  534. // }
  535. // }
  536. // }
  537. private void ultraGrid3_ClickCellButton(object sender, CellEventArgs e)
  538. {
  539. this.ultraGrid3.UpdateData();
  540. if (e.Cell.Column.Key == "JugdeApplyCode")
  541. {
  542. string jugdeApplyCode = ultraGrid3.ActiveRow.Cells["JugdeApplyCode"].Value.ToString();
  543. string judgeStoveNo = ultraGrid3.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
  544. string ordenNo = ultraGrid3.ActiveRow.Cells["ProOrderNo"].Value.ToString();
  545. FrmQcmAddAsk orderZg = new FrmQcmAddAsk(jugdeApplyCode, judgeStoveNo, ordenNo, this.ob);
  546. orderZg.ShowDialog();
  547. }
  548. }
  549. private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
  550. {
  551. this.ultraGrid1.UpdateData();
  552. IQueryable<UltraGridRow> checkMags = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  553. foreach (UltraGridRow row in checkMags)
  554. {
  555. PlnZyJgWorkbillEntity matBcEntity = (PlnZyJgWorkbillEntity)row.ListObject;
  556. if (!matBcEntity.DeterNo.Equals(""))
  557. {
  558. MessageUtil.ShowTips("炉批已进行送判,不允许修改重量!");
  559. return;
  560. }
  561. }
  562. if (e.Cell.Column.Key == "ProWt")
  563. {
  564. string jugdeApplyCode = ultraGrid1.ActiveRow.Cells["CodeJg"].Value.ToString();
  565. string woId = ultraGrid1.ActiveRow.Cells["WoId"].Value.ToString();
  566. string piece = ultraGrid1.ActiveRow.Cells["ProNum"].Value.ToString();
  567. FrmQcmJgWt orderZg = new FrmQcmJgWt(jugdeApplyCode,woId, this.ob);
  568. orderZg.ShowDialog();
  569. ComMscJgEntity slmEntity = orderZg.SlmEntity;
  570. if (slmEntity==null)
  571. {
  572. return;
  573. }
  574. QuerySinglePlan();
  575. //e.Cell.Row.Cells["ProWt"].Value = Convert.ToDecimal((Convert.ToDouble(slmEntity.WeightJg)/1000) * int.Parse(piece));
  576. ultraGrid1_CellChange(null, null);
  577. }
  578. }
  579. }
  580. }