FrmOutManagement.cs 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.Mcp.Common;
  5. using Core.StlMes.Client.Mcp.Control;
  6. using CoreFS.CA06;
  7. using Infragistics.Win;
  8. using Infragistics.Win.UltraWinGrid;
  9. using System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.Linq;
  16. using System.Text;
  17. using System.Windows.Forms;
  18. namespace Core.StlMes.Client.Mcp.Coupling
  19. {
  20. public partial class FrmOutManagement : FrmBase
  21. {
  22. public FrmOutManagement()
  23. {
  24. InitializeComponent();
  25. }
  26. private void FrmOutManagement_Load(object sender, EventArgs e)
  27. {
  28. McpBaseHelper.InitPlineUnit(cmbPlinCode, this.ValidDataPurviewIds, ob, "H");
  29. }
  30. public override void ToolBar_Click(object sender, string ToolbarKey)
  31. {
  32. switch (ToolbarKey)
  33. {
  34. case "Query":
  35. DoQuery();
  36. break;
  37. case "Add":
  38. DoAdd();
  39. break;
  40. case "Delete":
  41. DoDelete();
  42. break;
  43. case "CommEntrust":
  44. DoCommEntrust();
  45. break;
  46. case "NoCommEntrust":
  47. DoNoCommEntrust();
  48. break;
  49. case "Close":
  50. this.Close();
  51. break;
  52. }
  53. }
  54. /// <summary>
  55. /// 查询
  56. /// </summary>
  57. private void DoQuery() {
  58. string plnNo = "";
  59. string woId = "";
  60. string plinCode = "";
  61. if (chkPlnNo.Checked)
  62. {
  63. if (txtPlnNo.Text == "")
  64. {
  65. MessageUtil.ShowTips("炉计划号不能为空!");
  66. return;
  67. }
  68. else
  69. {
  70. plnNo = txtPlnNo.Text.ToString().Trim();
  71. }
  72. }
  73. if (chkwoId.Checked)
  74. {
  75. if (txtWoid.Text == "")
  76. {
  77. MessageUtil.ShowTips("工单号不能为空!");
  78. return;
  79. }
  80. else
  81. {
  82. woId = txtWoid.Text.Trim().ToString();
  83. }
  84. }
  85. if (chkPlin.Checked)
  86. {
  87. if (cmbPlinCode.Text == "")
  88. {
  89. MessageUtil.ShowTips("生产产线不能为空!");
  90. return ;
  91. }
  92. else
  93. {
  94. plinCode = cmbPlinCode.Value.ToString();
  95. }
  96. }
  97. ArrayList list = new ArrayList();
  98. list.Add(plnNo);
  99. list.Add(woId);
  100. list.Add(plinCode);
  101. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmOutManagement.geQueryPlnJgBill", new object[] { list }, ob);
  102. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  103. foreach (UltraGridRow row in ultraGridPlnWork.Rows)
  104. {
  105. if (row.Cells["COAT_TYPE"].Text.ToString().Equals("镀铜"))
  106. {
  107. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  108. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  109. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  110. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  111. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  112. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  113. row.Cells["IF_OUT_COAT"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  114. row.Cells["IF_OUT_COAT"].Appearance.BackHatchStyle = BackHatchStyle.None;
  115. row.Cells["IF_OUT_COAT"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  116. }
  117. else if (row.Cells["COAT_TYPE"].Text.ToString().Equals("磷化"))
  118. {
  119. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  120. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  121. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  122. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  123. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  124. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  125. row.Cells["IF_OUT_COAT"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  126. row.Cells["IF_OUT_COAT"].Appearance.BackHatchStyle = BackHatchStyle.None;
  127. row.Cells["IF_OUT_COAT"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  128. }
  129. else
  130. {
  131. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  132. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  133. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  134. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  135. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  136. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  137. row.Cells["IF_OUT_COAT"].Appearance.BackColor = Color.Transparent;
  138. row.Cells["IF_OUT_COAT"].Appearance.BackHatchStyle = BackHatchStyle.None;
  139. row.Cells["IF_OUT_COAT"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  140. }
  141. row.Cells["CJG_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;//打开界面不可编辑有条件后就可以编辑
  142. }
  143. DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmOutManagement.geQueryEntrusted", new object[] { list }, ob);
  144. GridHelper.CopyDataToDatatable(ref dt1, ref dataTable2, true);
  145. }
  146. /// <summary>
  147. /// 新增
  148. /// </summary>
  149. private void DoAdd()
  150. {
  151. UltraGridRow row = ultraGridPlnWork.ActiveRow;
  152. if (row == null) return;
  153. ultraGridPlnWork.UpdateData();
  154. int AddCount = 0;
  155. ArrayList list = new ArrayList();
  156. foreach (UltraGridRow urg in ultraGridPlnWork.Rows)
  157. {
  158. if (Convert.ToBoolean(urg.Cells["CHK"].Text) == true)
  159. {
  160. AddCount += 1;
  161. ArrayList list1 = new ArrayList();
  162. list1.Add(urg.Cells["ZY_PLAN_ID"].Text.ToString());
  163. list1.Add(urg.Cells["WO_ID"].Text.ToString());
  164. if (Convert.ToBoolean(urg.Cells["IF_OUT_CUT"].Text) == false)//切管
  165. {
  166. list1.Add("");
  167. }
  168. else
  169. {
  170. list1.Add(urg.Cells["CUT_PLN_NUMB"].Value.ToString());
  171. }
  172. if (Convert.ToBoolean(urg.Cells["IF_OUT_CJG"].Text) == false)//粗加工
  173. {
  174. list1.Add("");
  175. }
  176. else { list1.Add(urg.Cells["CJG_PLN_NUM"].Value.ToString()); }
  177. if (Convert.ToBoolean(urg.Cells["IF_OUT_IMPRESS"].Text) == false)//压印
  178. {
  179. list1.Add("");
  180. }
  181. else { list1.Add(urg.Cells["IMPRESS_PLN_NUM"].Value.ToString()); }
  182. if (Convert.ToBoolean(urg.Cells["IF_OUT_LATHE"].Text) == false)//车丝
  183. {
  184. list1.Add("");
  185. }
  186. else { list1.Add(urg.Cells["LATHE_PLN_NUM"].Value.ToString()); }
  187. if (Convert.ToBoolean(urg.Cells["IF_OUT_THREAD"].Text) == false)//螺纹检验
  188. {
  189. list1.Add("");
  190. }
  191. else { list1.Add(urg.Cells["THREAD_PLN_NUM"].Value.ToString()); }
  192. if (Convert.ToBoolean(urg.Cells["IF_OUT_DETECT"].Text) == false)//探伤
  193. {
  194. list1.Add("");
  195. }
  196. else { list1.Add(urg.Cells["DETECT_PLN_NUM"].Value.ToString()); }
  197. if (Convert.ToBoolean(urg.Cells["IF_OUT_BLAST"].Text) == false)//喷砂
  198. {
  199. list1.Add("");
  200. }
  201. else { list1.Add(urg.Cells["BLAST_PLN_NUM"].Value.ToString()); }
  202. if (Convert.ToBoolean(urg.Cells["IF_OUT_COAT"].Text) == false)//涂层
  203. {
  204. list1.Add("");
  205. list1.Add("");
  206. }
  207. else { list1.Add(urg.Cells["PLT_PLN_NUM"].Value.ToString());
  208. list1.Add(urg.Cells["PHOS_PLN_NUM"].Value.ToString()); }
  209. list1.Add(urg.Cells["COPPER_PLN_NUM"].Value.ToString());
  210. list1.Add(urg.Cells["PLAN_BL_NUM"].Value.ToString());
  211. list1.Add(this.UserInfo.GetUserName());
  212. list1.Add(this.UserInfo.GetUserOrder());
  213. list1.Add(this.UserInfo.GetUserGroup());
  214. list.Add(list1);
  215. }
  216. }
  217. if (AddCount == 0) { MessageUtil.ShowTips("请选中要生成委托单的离线工单信息!"); return; }
  218. if (MessageUtil.ShowYesNoAndQuestion("是否新增委托单?") == DialogResult.No)
  219. {
  220. return;
  221. }
  222. CoreClientParam ccp = new CoreClientParam();
  223. try
  224. {
  225. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  226. if (Constant.WaitingForm == null)
  227. {
  228. Constant.WaitingForm = new WaitingForm();
  229. }
  230. Constant.WaitingForm.ShowToUser = true;
  231. Constant.WaitingForm.Show();
  232. Constant.WaitingForm.Update();
  233. ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutManagement";
  234. ccp.MethodName = "addEntrustedResult";
  235. ccp.ServerParams = new object[] { list };
  236. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  237. this.Cursor = Cursors.Default;
  238. Constant.WaitingForm.ShowToUser = false;
  239. Constant.WaitingForm.Close();
  240. Constant.WaitingForm = null;
  241. }
  242. catch (Exception ex)
  243. {
  244. this.Cursor = Cursors.Default;
  245. Constant.WaitingForm.ShowToUser = false;
  246. Constant.WaitingForm.Close();
  247. Constant.WaitingForm = null;
  248. }
  249. if (ccp.ReturnCode == -1) return;
  250. MessageUtil.ShowTips(ccp.ReturnInfo);
  251. if (ccp.ReturnInfo.Equals("新增成功!"))
  252. {
  253. DoQuery();
  254. }
  255. }
  256. /// <summary>
  257. /// 删除
  258. /// </summary>
  259. private void DoDelete()
  260. {
  261. UltraGridRow row = ultraGrid1.ActiveRow;
  262. if (row == null) return;
  263. ultraGridPlnWork.UpdateData();
  264. int AddCount = 0;
  265. ArrayList list = new ArrayList();
  266. foreach (UltraGridRow urg in ultraGrid1.Rows)
  267. {
  268. if (Convert.ToBoolean(urg.Cells["CHK"].Text) == true)
  269. {
  270. AddCount += 1;
  271. ArrayList list1 = new ArrayList();
  272. list1.Add(urg.Cells["ZY_PLAN_ID"].Text.ToString());
  273. list1.Add(urg.Cells["WO_ID"].Text.ToString());
  274. list1.Add(urg.Cells["ENTRUSTED_NO"].Text.ToString());
  275. list.Add(list1);
  276. }
  277. }
  278. if (AddCount == 0) { MessageUtil.ShowTips("请选中要删除的委托单!"); return; }
  279. if (MessageUtil.ShowYesNoAndQuestion("是否删除委托单?") == DialogResult.No)
  280. {
  281. return;
  282. }
  283. CoreClientParam ccp = new CoreClientParam();
  284. try
  285. {
  286. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  287. if (Constant.WaitingForm == null)
  288. {
  289. Constant.WaitingForm = new WaitingForm();
  290. }
  291. Constant.WaitingForm.ShowToUser = true;
  292. Constant.WaitingForm.Show();
  293. Constant.WaitingForm.Update();
  294. ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutManagement";
  295. ccp.MethodName = "deleteEntrustedResult";
  296. ccp.ServerParams = new object[] { list };
  297. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  298. this.Cursor = Cursors.Default;
  299. Constant.WaitingForm.ShowToUser = false;
  300. Constant.WaitingForm.Close();
  301. Constant.WaitingForm = null;
  302. }
  303. catch (Exception ex)
  304. {
  305. this.Cursor = Cursors.Default;
  306. Constant.WaitingForm.ShowToUser = false;
  307. Constant.WaitingForm.Close();
  308. Constant.WaitingForm = null;
  309. }
  310. if (ccp.ReturnCode == -1) return;
  311. MessageUtil.ShowTips(ccp.ReturnInfo);
  312. if (ccp.ReturnInfo.Equals("删除成功!"))
  313. {
  314. DoQuery();
  315. }
  316. }
  317. /// <summary>
  318. /// 申请委托
  319. /// </summary>
  320. private void DoCommEntrust()
  321. {
  322. UltraGridRow row = ultraGrid1.ActiveRow;
  323. if (row == null) return;
  324. ultraGridPlnWork.UpdateData();
  325. int AddCount = 0;
  326. ArrayList list = new ArrayList();
  327. foreach (UltraGridRow urg in ultraGrid1.Rows)
  328. {
  329. if (Convert.ToBoolean(urg.Cells["CHK"].Text) == true)
  330. {
  331. AddCount += 1;
  332. ArrayList list1 = new ArrayList();
  333. list1.Add(urg.Cells["ZY_PLAN_ID"].Text.ToString());
  334. list1.Add(urg.Cells["WO_ID"].Text.ToString());
  335. list1.Add(urg.Cells["ENTRUSTED_NO"].Text.ToString());
  336. list.Add(list1);
  337. }
  338. }
  339. if (AddCount == 0) { MessageUtil.ShowTips("请选中要申请委托记录!"); return; }
  340. if (MessageUtil.ShowYesNoAndQuestion("是否申请委托?") == DialogResult.No)
  341. {
  342. return;
  343. }
  344. CoreClientParam ccp = new CoreClientParam();
  345. try
  346. {
  347. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  348. if (Constant.WaitingForm == null)
  349. {
  350. Constant.WaitingForm = new WaitingForm();
  351. }
  352. Constant.WaitingForm.ShowToUser = true;
  353. Constant.WaitingForm.Show();
  354. Constant.WaitingForm.Update();
  355. ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutManagement";
  356. ccp.MethodName = "commEntrustedResult";
  357. ccp.ServerParams = new object[] { list };
  358. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  359. this.Cursor = Cursors.Default;
  360. Constant.WaitingForm.ShowToUser = false;
  361. Constant.WaitingForm.Close();
  362. Constant.WaitingForm = null;
  363. }
  364. catch (Exception ex)
  365. {
  366. this.Cursor = Cursors.Default;
  367. Constant.WaitingForm.ShowToUser = false;
  368. Constant.WaitingForm.Close();
  369. Constant.WaitingForm = null;
  370. }
  371. if (ccp.ReturnCode == -1) return;
  372. MessageUtil.ShowTips(ccp.ReturnInfo);
  373. if (ccp.ReturnInfo.Equals("委托申请成功!"))
  374. {
  375. DoQuery();
  376. }
  377. }
  378. /// <summary>
  379. /// 撤销委托
  380. /// </summary>
  381. private void DoNoCommEntrust()
  382. {
  383. UltraGridRow row = ultraGrid1.ActiveRow;
  384. if (row == null) return;
  385. ultraGridPlnWork.UpdateData();
  386. int AddCount = 0;
  387. ArrayList list = new ArrayList();
  388. foreach (UltraGridRow urg in ultraGrid1.Rows)
  389. {
  390. if (Convert.ToBoolean(urg.Cells["CHK"].Text) == true)
  391. {
  392. AddCount += 1;
  393. ArrayList list1 = new ArrayList();
  394. list1.Add(urg.Cells["ZY_PLAN_ID"].Text.ToString());
  395. list1.Add(urg.Cells["WO_ID"].Text.ToString());
  396. list1.Add(urg.Cells["ENTRUSTED_NO"].Text.ToString());
  397. list.Add(list1);
  398. }
  399. }
  400. if (AddCount == 0) { MessageUtil.ShowTips("请选中要撤销的委托单!"); return; }
  401. if (MessageUtil.ShowYesNoAndQuestion("是否撤销委托?") == DialogResult.No)
  402. {
  403. return;
  404. }
  405. CoreClientParam ccp = new CoreClientParam();
  406. try
  407. {
  408. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  409. if (Constant.WaitingForm == null)
  410. {
  411. Constant.WaitingForm = new WaitingForm();
  412. }
  413. Constant.WaitingForm.ShowToUser = true;
  414. Constant.WaitingForm.Show();
  415. Constant.WaitingForm.Update();
  416. ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutManagement";
  417. ccp.MethodName = "kownCommEntrustedResult";
  418. ccp.ServerParams = new object[] { list };
  419. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  420. this.Cursor = Cursors.Default;
  421. Constant.WaitingForm.ShowToUser = false;
  422. Constant.WaitingForm.Close();
  423. Constant.WaitingForm = null;
  424. }
  425. catch (Exception ex)
  426. {
  427. this.Cursor = Cursors.Default;
  428. Constant.WaitingForm.ShowToUser = false;
  429. Constant.WaitingForm.Close();
  430. Constant.WaitingForm = null;
  431. }
  432. if (ccp.ReturnCode == -1) return;
  433. MessageUtil.ShowTips(ccp.ReturnInfo);
  434. if (ccp.ReturnInfo.Equals("撤销委托成功!"))
  435. {
  436. DoQuery();
  437. }
  438. }
  439. private void chkStarts_CheckedChanged(object sender, EventArgs e)
  440. {
  441. if (chkwoId.Checked) { txtWoid.Enabled = true; } else { txtWoid.Enabled = false; }
  442. if (chkPlin.Checked) { cmbPlinCode.Enabled = true; } else { cmbPlinCode.Enabled = false; }
  443. if (chkPlnNo.Checked) { txtPlnNo.Enabled = true; } else { txtPlnNo.Enabled = false; }
  444. }
  445. /// <summary>
  446. /// 改变Grid事件
  447. /// </summary>
  448. /// <param name="sender"></param>
  449. /// <param name="e"></param>
  450. private void ultraGridPlnWork_CellChange(object sender, CellEventArgs e)
  451. {
  452. UltraGridRow row = ultraGridPlnWork.ActiveRow;
  453. if (row == null) return;
  454. ultraGridPlnWork.UpdateData();
  455. if (e.Cell.Column.Key.Equals("IF_ALL_OUT_WORK"))
  456. {
  457. if (Convert.ToBoolean(row.Cells["IF_ALL_OUT_WORK"].Text) == true)
  458. {
  459. //row.Cells["PLAN_BL_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  460. //row.Cells["PLAN_BL_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  461. //row.Cells["PLAN_BL_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  462. }
  463. else
  464. {
  465. row.Cells["PLAN_BL_NUM"].Appearance.BackColor = Color.Transparent;
  466. row.Cells["PLAN_BL_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  467. row.Cells["PLAN_BL_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  468. }
  469. }
  470. //锯切
  471. if (e.Cell.Column.Key.Equals("IF_OUT_CUT"))
  472. {
  473. if (Convert.ToBoolean(row.Cells["IF_OUT_CUT"].Text) == true)
  474. {
  475. row.Cells["CUT_PLN_NUMB"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  476. row.Cells["CUT_PLN_NUMB"].Appearance.BackHatchStyle = BackHatchStyle.None;
  477. row.Cells["CUT_PLN_NUMB"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  478. }
  479. else
  480. {
  481. row.Cells["CUT_PLN_NUMB"].Appearance.BackColor = Color.Transparent;
  482. row.Cells["CUT_PLN_NUMB"].Appearance.BackHatchStyle = BackHatchStyle.None;
  483. row.Cells["CUT_PLN_NUMB"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  484. }
  485. }
  486. //粗加工
  487. if (e.Cell.Column.Key.Equals("IF_OUT_CJG"))
  488. {
  489. if (Convert.ToBoolean(row.Cells["IF_OUT_CJG"].Text) == true)
  490. {
  491. row.Cells["CJG_PLN_NUM"].Value = row.Cells["CUT_PLN_NUMB"].Value.ToString();
  492. row.Cells["CJG_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  493. row.Cells["CJG_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  494. row.Cells["CJG_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  495. }
  496. else
  497. {
  498. row.Cells["CJG_PLN_NUM"].Value = "";
  499. row.Cells["CJG_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  500. row.Cells["CJG_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  501. row.Cells["CJG_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  502. }
  503. }
  504. //压印
  505. if (e.Cell.Column.Key.Equals("IF_OUT_IMPRESS"))
  506. {
  507. if (Convert.ToBoolean(row.Cells["IF_OUT_IMPRESS"].Text) == true)
  508. {
  509. row.Cells["IMPRESS_PLN_NUM"].Value = row.Cells["CJG_PLN_NUM"].Value.ToString();
  510. row.Cells["IMPRESS_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  511. row.Cells["IMPRESS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  512. row.Cells["IMPRESS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  513. }
  514. else
  515. {
  516. row.Cells["IMPRESS_PLN_NUM"].Value = "";
  517. row.Cells["IMPRESS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  518. row.Cells["IMPRESS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  519. row.Cells["IMPRESS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  520. }
  521. }
  522. //车丝
  523. if (e.Cell.Column.Key.Equals("IF_OUT_LATHE"))
  524. {
  525. if (Convert.ToBoolean(row.Cells["IF_OUT_LATHE"].Text) == true)
  526. {
  527. row.Cells["LATHE_PLN_NUM"].Value = row.Cells["IMPRESS_PLN_NUM"].Value.ToString();
  528. row.Cells["LATHE_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  529. row.Cells["LATHE_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  530. row.Cells["LATHE_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  531. }
  532. else
  533. {
  534. row.Cells["LATHE_PLN_NUM"].Value = "";
  535. row.Cells["LATHE_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  536. row.Cells["LATHE_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  537. row.Cells["LATHE_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  538. }
  539. }
  540. //探伤
  541. if (e.Cell.Column.Key.Equals("IF_OUT_DETECT"))
  542. {
  543. if (Convert.ToBoolean(row.Cells["IF_OUT_DETECT"].Text) == true)
  544. {
  545. row.Cells["DETECT_PLN_NUM"].Value = row.Cells["LATHE_PLN_NUM"].Value.ToString();
  546. row.Cells["DETECT_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  547. row.Cells["DETECT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  548. row.Cells["DETECT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  549. }
  550. else
  551. {
  552. row.Cells["DETECT_PLN_NUM"].Value = "";
  553. row.Cells["DETECT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  554. row.Cells["DETECT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  555. row.Cells["DETECT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  556. }
  557. }
  558. //喷砂
  559. if (e.Cell.Column.Key.Equals("IF_OUT_BLAST"))
  560. {
  561. if (Convert.ToBoolean(row.Cells["IF_OUT_BLAST"].Text) == true)
  562. {
  563. row.Cells["BLAST_PLN_NUM"].Value = row.Cells["DETECT_PLN_NUM"].Value.ToString();
  564. row.Cells["BLAST_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  565. row.Cells["BLAST_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  566. row.Cells["BLAST_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  567. }
  568. else
  569. {
  570. row.Cells["BLAST_PLN_NUM"].Value = "";
  571. row.Cells["BLAST_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  572. row.Cells["BLAST_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  573. row.Cells["BLAST_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  574. }
  575. }
  576. //螺纹检验
  577. if (e.Cell.Column.Key.Equals("IF_OUT_THREAD"))
  578. {
  579. if (Convert.ToBoolean(row.Cells["IF_OUT_THREAD"].Text) == true)
  580. {
  581. row.Cells["THREAD_PLN_NUM"].Value = row.Cells["BLAST_PLN_NUM"].Value.ToString();
  582. row.Cells["THREAD_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  583. row.Cells["THREAD_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  584. row.Cells["THREAD_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  585. }
  586. else
  587. {
  588. row.Cells["THREAD_PLN_NUM"].Value = "";
  589. row.Cells["THREAD_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  590. row.Cells["THREAD_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  591. row.Cells["THREAD_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  592. }
  593. }
  594. //喷标
  595. if (e.Cell.Column.Key.Equals("IF_OUT_COPPER"))
  596. {
  597. if (Convert.ToBoolean(row.Cells["IF_OUT_COPPER"].Text) == true)
  598. {
  599. row.Cells["COPPER_PLN_NUM"].Value = row.Cells["THREAD_PLN_NUM"].Value.ToString();
  600. row.Cells["COPPER_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  601. row.Cells["COPPER_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  602. row.Cells["COPPER_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  603. }
  604. else
  605. {
  606. row.Cells["COPPER_PLN_NUM"].Value = "";
  607. row.Cells["COPPER_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  608. row.Cells["COPPER_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  609. row.Cells["COPPER_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  610. }
  611. }
  612. if (e.Cell.Column.Key.Equals("IF_OUT_COAT"))
  613. {
  614. if (row.Cells["COAT_TYPE"].Text.ToString().Equals("镀铜"))
  615. {
  616. if (Convert.ToBoolean(row.Cells["IF_OUT_COAT"].Text) == true)
  617. {
  618. row.Cells["PLT_PLN_NUM"].Value = row.Cells["PHOS_PLN_NUM"].Value.ToString();
  619. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  620. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  621. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  622. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  623. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  624. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  625. }
  626. else
  627. {
  628. row.Cells["PLT_PLN_NUM"].Value = "";
  629. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  630. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  631. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  632. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  633. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  634. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  635. }
  636. }
  637. else if (row.Cells["COAT_TYPE"].Text.ToString().Equals("磷化"))
  638. {
  639. if (Convert.ToBoolean(row.Cells["IF_OUT_COAT"].Text) == true)
  640. {
  641. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.FromArgb(255, 255, 192);
  642. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  643. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  644. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  645. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  646. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  647. }
  648. else
  649. {
  650. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  651. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  652. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  653. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  654. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  655. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  656. }
  657. }
  658. else
  659. {
  660. row.Cells["PHOS_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  661. row.Cells["PHOS_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  662. row.Cells["PHOS_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  663. row.Cells["PLT_PLN_NUM"].Appearance.BackColor = Color.Transparent;
  664. row.Cells["PLT_PLN_NUM"].Appearance.BackHatchStyle = BackHatchStyle.None;
  665. row.Cells["PLT_PLN_NUM"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  666. row.Cells["IF_OUT_COAT"].Appearance.BackColor = Color.Transparent;
  667. row.Cells["IF_OUT_COAT"].Appearance.BackHatchStyle = BackHatchStyle.None;
  668. row.Cells["IF_OUT_COAT"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  669. }
  670. }
  671. }
  672. private void ultraGridPlnWork_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
  673. {
  674. try
  675. {
  676. ultraGridPlnWork.UpdateData();
  677. foreach (UltraGridRow row in ultraGridPlnWork.Rows)
  678. {
  679. row.Cells["CHK"].Value = row.Selected;
  680. }
  681. }
  682. catch { }
  683. }
  684. private void ultraGrid1_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
  685. {
  686. try
  687. {
  688. ultraGrid1.UpdateData();
  689. foreach (UltraGridRow row in ultraGrid1.Rows)
  690. {
  691. row.Cells["CHK"].Value = row.Selected;
  692. }
  693. }
  694. catch { }
  695. }
  696. }
  697. }