QCM030708.cs 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  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 System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. using Core.LZMes.Client.QCM.QCM03;
  13. using Infragistics.Win;
  14. using System.Diagnostics;
  15. namespace Core.LZMes.Client.QCM
  16. {
  17. public partial class QCM030708 : FrmBase
  18. {
  19. public QCM030708()
  20. {
  21. InitializeComponent();
  22. }
  23. public override void ToolBar_Click(object sender, string ToolbarKey)
  24. {
  25. switch (ToolbarKey)
  26. {
  27. case "Query":
  28. this.DoQuery();
  29. break;
  30. case "Exit":
  31. this.Close();
  32. break;
  33. case "Unlock":
  34. this.Judge();
  35. break;
  36. case "SteelInfo":
  37. this.steelinfo();
  38. break;
  39. case "Fr_report":
  40. this.fr_report();
  41. break;
  42. case "Fr_report2":
  43. this.fr_report2();
  44. break;
  45. case "Export2":
  46. this.DoExport();
  47. break;
  48. case "ReBack":
  49. this.Reback();
  50. break;
  51. }
  52. }
  53. private void Reback()
  54. {
  55. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  56. if(ugr == null)
  57. {
  58. MessageBox.Show("请选择数据!");
  59. return;
  60. }
  61. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  62. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  63. CoreClientParam ccp = new CoreClientParam();
  64. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  65. ccp.MethodName = "Reback";
  66. ccp.ServerParams = new object[] { material_no,lock_seq};
  67. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  68. if (ccp.ReturnCode == -1)
  69. {
  70. return;
  71. }
  72. MessageBox.Show("回退成功!");
  73. DoQuery();
  74. }
  75. private void steelinfo()
  76. {
  77. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  78. if (ugr == null)
  79. return;
  80. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  81. string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
  82. string prodline = "4001LGX";
  83. string grade_name = this.textBox3.Text.ToString();
  84. if (grade_name == "")
  85. return;
  86. QCM030712 dlg = new QCM030712();
  87. dlg.material_no = material_no;
  88. dlg.prod_name = prod_name;
  89. dlg.prodline = prodline;
  90. dlg.grade_name = grade_name;
  91. dlg.ob = this.ob;
  92. dlg.ShowDialog();
  93. }
  94. private void fr_report()
  95. {
  96. ultraGrid2.UpdateData();
  97. if (ultraGrid2.ActiveRow != null)
  98. {
  99. string current_class = this.UserInfo.GetUserOrder();
  100. string userName = this.UserInfo.GetUserID();
  101. UltraGridRow ugr = ultraGrid2.ActiveRow;
  102. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  103. string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
  104. if (string.IsNullOrEmpty(prod_name))
  105. {
  106. MessageBox.Show("选择的处理信息,产品名称为空!");
  107. return;
  108. }
  109. string platetype = "";
  110. if ("方坯".Equals(prod_name))
  111. {
  112. platetype = "2";
  113. }
  114. else if ("板坯".Equals(prod_name))
  115. {
  116. platetype = "1";
  117. }
  118. string url = "http://172.16.0.155/FineReport/decision/view/report?viewlet=XGCX%252Fcffx.cpt&ref_t=design&ref_c=7683bd3a-1031-4f0a-908b-62b6524f80ab&current_class=" + current_class;
  119. url += "&lock_id=" + lock_id;
  120. url += "&create_man=" + userName;
  121. url += "&platetype=" + platetype;
  122. url += "&prodline=" + "4001LGX";
  123. QCM030715 frm = new QCM030715(ob, url);
  124. frm.Text = "连铸坯成分处置放行通知单";
  125. frm.ShowDialog();
  126. return;
  127. }
  128. else
  129. {
  130. MessageBox.Show("请选择处理信息!");
  131. return;
  132. }
  133. }
  134. private void fr_report2()
  135. {
  136. ultraGrid2.UpdateData();
  137. if (ultraGrid2.ActiveRow != null)
  138. {
  139. string current_class = this.UserInfo.GetUserOrder();
  140. string userName = this.UserInfo.GetUserID();
  141. UltraGridRow ugr = ultraGrid2.ActiveRow;
  142. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  143. string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
  144. if (string.IsNullOrEmpty(prod_name))
  145. {
  146. MessageBox.Show("选择的处理信息,产品名称为空!");
  147. return;
  148. }
  149. string platetype = "";
  150. if ("方坯".Equals(prod_name))
  151. {
  152. platetype = "2";
  153. }
  154. else if ("板坯".Equals(prod_name))
  155. {
  156. platetype = "1";
  157. }
  158. string url = "http://172.16.0.155/FineReport/decision/view/report?viewlet=XGCX%252Fbhgtzd.cpt&ref_t=design&ref_c=b16af811-10fa-4cb7-bc62-be902d81b522&current_class=" + current_class;
  159. url += "&lock_id=" + lock_id;
  160. url += "&create_man=" + userName;
  161. url += "&platetype=" + platetype;
  162. url += "&prodline=" + "4001LGX";
  163. QCM030715 frm = new QCM030715(ob, url);
  164. frm.Text = "不合格品通知/审理单";
  165. frm.ShowDialog();
  166. return;
  167. }
  168. else
  169. {
  170. MessageBox.Show("请选择处理信息!");
  171. return;
  172. }
  173. }
  174. private void Judge()
  175. {
  176. if (this.ultraGrid9.Selected.Rows.Count == 0)
  177. this.ultraGrid9.ActiveRow.Selected = true;
  178. List<UltraGridRow> lists = new List<UltraGridRow>();
  179. if (comboBox1.Text.Trim().ToString() == "")
  180. {
  181. MessageBox.Show("请选择异常材处置放向!");
  182. return;
  183. }
  184. if (comboBox1.Text.Trim().ToString() == "放行")
  185. {
  186. if (MessageBox.Show(this, "是否放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  187. {
  188. return;
  189. }
  190. }
  191. else if (comboBox1.Text.Trim().ToString() == "复样")
  192. {
  193. if (MessageBox.Show(this, "是否复样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  194. {
  195. return;
  196. }
  197. }
  198. else if (comboBox1.Text.Trim().ToString() == "修磨")
  199. {
  200. if (MessageBox.Show(this, "是否修磨处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  201. {
  202. return;
  203. }
  204. }
  205. else if (comboBox1.Text.Trim().ToString() == "改尺")
  206. {
  207. if (MessageBox.Show(this, "是否改尺处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  208. {
  209. return;
  210. }
  211. }
  212. else if (comboBox1.Text.Trim().ToString() == "判次")
  213. {
  214. if (MessageBox.Show(this, "是否判次处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  215. {
  216. return;
  217. }
  218. }
  219. else if (comboBox1.Text.Trim().ToString() == "化废")
  220. {
  221. if (MessageBox.Show(this, "是否化废处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  222. {
  223. return;
  224. }
  225. }
  226. else if (comboBox1.Text.Trim().ToString() == "脱单")
  227. {
  228. if (MessageBox.Show(this, "是否脱单处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  229. {
  230. return;
  231. }
  232. }
  233. else if (comboBox1.Text.Trim().ToString() == "关闭")
  234. {
  235. if (MessageBox.Show(this, "是否关闭处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  236. {
  237. return;
  238. }
  239. }
  240. else if (comboBox1.Text.Trim().ToString() == "复样+放行")
  241. {
  242. if (MessageBox.Show(this, "是否复样+放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  243. {
  244. return;
  245. }
  246. }
  247. else if (comboBox1.Text.Trim().ToString() == "验样")
  248. {
  249. if (MessageBox.Show(this, "是否验样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  250. {
  251. return;
  252. }
  253. }
  254. else if (comboBox1.Text.Trim().ToString() == "验样+放行")
  255. {
  256. if (MessageBox.Show(this, "是否验样+放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  257. {
  258. return;
  259. }
  260. }
  261. else if (comboBox1.Text.Trim().ToString() == "改判+放行")
  262. {
  263. if (textBox3.Text.ToString() == "")
  264. {
  265. MessageBox.Show("请选择改判牌号!");
  266. return;
  267. }
  268. if (MessageBox.Show(this, "是否改判+放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  269. {
  270. return;
  271. }
  272. }
  273. else if (comboBox1.Text.Trim().ToString() == "改判")
  274. {
  275. if (textBox3.Text.ToString() == "")
  276. {
  277. MessageBox.Show("请选择改判牌号!");
  278. return;
  279. }
  280. if (MessageBox.Show(this, "是否改判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  281. {
  282. return;
  283. }
  284. }
  285. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  286. {
  287. if(ugr.Cells["CHECK"].Value.ToString() == "True")
  288. {
  289. ArrayList al = new ArrayList();
  290. if (comboBox1.Text.Trim().ToString() != "改判" && comboBox1.Text.Trim().ToString() != "改判+放行")
  291. {
  292. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  293. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  294. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  295. string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
  296. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  297. //if (string.IsNullOrEmpty(design_key))
  298. //{
  299. // lists.Add(ugr);
  300. // continue;
  301. //}
  302. string username = this.UserInfo.GetUserName();
  303. string grade_name = ugr.Cells["STEEL_NAME"].Value.ToString();
  304. string unlock_type_code = "";
  305. string assay_no = "";
  306. if (comboBox1.Text.Trim().ToString() == "放行")
  307. {
  308. unlock_type_code = "0";
  309. //QCM030720 dlg = new QCM030720();
  310. //dlg.StartPosition = FormStartPosition.CenterParent;
  311. //dlg.design_key = design_key;
  312. //dlg.heat_no = heat_no;
  313. //dlg.grade_name = grade_name;
  314. //dlg.ob = this.ob;
  315. //if (dlg.ShowDialog() != DialogResult.OK)
  316. //{
  317. // return;
  318. //}
  319. //assay_no = dlg.assay_no;
  320. //if (assay_no == "")
  321. //{
  322. // MessageBox.Show("请选择成分实绩!");
  323. // return;
  324. //}
  325. }
  326. else if (comboBox1.Text.Trim().ToString() == "复样")
  327. {
  328. unlock_type_code = "1";
  329. }
  330. else if (comboBox1.Text.Trim().ToString() == "修磨")
  331. {
  332. unlock_type_code = "2";
  333. }
  334. else if (comboBox1.Text.Trim().ToString() == "改尺")
  335. {
  336. unlock_type_code = "3";
  337. }
  338. else if (comboBox1.Text.Trim().ToString() == "判次")
  339. {
  340. unlock_type_code = "4";
  341. }
  342. else if (comboBox1.Text.Trim().ToString() == "化废")
  343. {
  344. unlock_type_code = "5";
  345. }
  346. else if (comboBox1.Text.Trim().ToString() == "脱单")
  347. {
  348. unlock_type_code = "6";
  349. }
  350. else if (comboBox1.Text.Trim().ToString() == "关闭")
  351. {
  352. unlock_type_code = "11";
  353. }
  354. else if (comboBox1.Text.Trim().ToString() == "复样+放行")
  355. {
  356. unlock_type_code = "12";
  357. QCM030720 dlg = new QCM030720();
  358. dlg.StartPosition = FormStartPosition.CenterParent;
  359. dlg.design_key = design_key;
  360. dlg.heat_no = heat_no;
  361. dlg.grade_name = grade_name;
  362. dlg.ob = this.ob;
  363. if (dlg.ShowDialog() != DialogResult.OK)
  364. {
  365. return;
  366. }
  367. assay_no = dlg.assay_no;
  368. if (assay_no == "")
  369. {
  370. MessageBox.Show("请选择成分实绩!");
  371. return;
  372. }
  373. //CoreClientParam ccp = new CoreClientParam();
  374. //ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  375. //ccp.MethodName = "JudgeCheck1";
  376. //ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LGX", "0" };
  377. //this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  378. //if (ccp.ReturnCode == 2)
  379. //{
  380. // QCM030718 dlg = new QCM030718();
  381. // dlg.StartPosition = FormStartPosition.CenterParent;
  382. // dlg.design_key = design_key;
  383. // dlg.heat_no = heat_no;
  384. // dlg.grade_name = grade_name;
  385. // dlg.ob = this.ob;
  386. // if (dlg.ShowDialog() != DialogResult.OK)
  387. // {
  388. // return;
  389. // }
  390. //}
  391. }
  392. else if (comboBox1.Text.Trim().ToString() == "验样")
  393. {
  394. unlock_type_code = "13";
  395. }
  396. else if (comboBox1.Text.Trim().ToString() == "验样+放行")
  397. {
  398. unlock_type_code = "14";
  399. CoreClientParam ccp = new CoreClientParam();
  400. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  401. ccp.MethodName = "JudgeCheck1";
  402. ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LGX", "1" };
  403. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  404. if (ccp.ReturnCode == 2)
  405. {
  406. QCM030718 dlg = new QCM030718();
  407. dlg.StartPosition = FormStartPosition.CenterParent;
  408. dlg.design_key = design_key;
  409. dlg.heat_no = heat_no;
  410. dlg.grade_name = grade_name;
  411. dlg.ob = this.ob;
  412. if (dlg.ShowDialog() != DialogResult.OK)
  413. {
  414. return;
  415. }
  416. }
  417. }
  418. string unlock_memo = this.comboBox3.Text.Trim().ToString();
  419. if (string.IsNullOrEmpty(unlock_memo) && lock_type_code == "C" && "0".Equals(unlock_type_code))
  420. {
  421. this.alert("处理备注为空,请选择相应审理人员!");
  422. return;
  423. }
  424. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  425. al.Add(material);
  426. al.Add(lock_seq);
  427. al.Add(lock_type_code);
  428. al.Add(unlock_type_code);
  429. al.Add(unlock_memo);
  430. al.Add(username);
  431. al.Add(lock_id);
  432. al.Add(this.comboBox4.Text.ToString());
  433. al.Add(checkBoxComboBox2.Text.ToString());
  434. al.Add(checkBoxComboBox1.Text.ToString());
  435. al.Add(assay_no);
  436. CoreClientParam ccp1 = new CoreClientParam();
  437. ccp1.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  438. ccp1.MethodName = "doInformationLgSure";
  439. ccp1.ServerParams = new object[] { al };
  440. ccp1 = this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  441. if (ccp1.ReturnCode == -1)
  442. {
  443. return;
  444. }
  445. lists.Add(ugr);
  446. }
  447. else
  448. {
  449. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  450. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  451. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  452. string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
  453. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  454. string username = this.UserInfo.GetUserName();
  455. string grade_name = ugr.Cells["STEEL_NAME"].Value.ToString();
  456. string unlock_type_code = "";
  457. if (comboBox1.Text.Trim().ToString() == "改判")
  458. {
  459. unlock_type_code = "7";
  460. }
  461. else if (comboBox1.Text.Trim().ToString() == "改判+放行")
  462. {
  463. unlock_type_code = "15";
  464. CoreClientParam ccp = new CoreClientParam();
  465. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  466. ccp.MethodName = "JudgeCheck1";
  467. ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LGX", "2" };
  468. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  469. if (ccp.ReturnCode == 2)
  470. {
  471. QCM030718 dlg = new QCM030718();
  472. dlg.StartPosition = FormStartPosition.CenterParent;
  473. dlg.design_key = design_key;
  474. dlg.heat_no = heat_no;
  475. dlg.grade_name = grade_name;
  476. dlg.ob = this.ob;
  477. if (dlg.ShowDialog() != DialogResult.OK)
  478. {
  479. return;
  480. }
  481. }
  482. }
  483. string unlock_memo = this.comboBox3.Text.Trim().ToString();
  484. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  485. string qx = this.comboBox5.Text.ToString();
  486. al.Add(material);
  487. al.Add(lock_seq);
  488. al.Add(lock_type_code);
  489. al.Add(unlock_type_code);
  490. al.Add(unlock_memo);
  491. al.Add(username);
  492. al.Add(lock_id);
  493. al.Add(textBox3.Text.ToString());
  494. al.Add(qx);
  495. CoreClientParam ccp1 = new CoreClientParam();
  496. ccp1.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  497. ccp1.MethodName = "doInformationLgGp";
  498. ccp1.ServerParams = new object[] { al };
  499. ccp1 = this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  500. if (ccp1.ReturnCode == -1)
  501. {
  502. return;
  503. }
  504. lists.Add(ugr);
  505. }
  506. }
  507. }
  508. for (int i = 0; i < lists.Count; i++)
  509. {
  510. lists[i].Delete(false);
  511. }
  512. MessageBox.Show("异常处置成功!");
  513. DoQuery();
  514. }
  515. private void DoQuery()
  516. {
  517. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  518. {
  519. DoQueryMe();
  520. }
  521. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  522. {
  523. DoQueryRe();
  524. }
  525. }
  526. private void DoQueryMe()
  527. {
  528. try
  529. {
  530. this.dataSet1.Clear();
  531. string heatno = this.textBox4.Text.ToString();
  532. string material_no = this.textBox5.Text.ToString();
  533. string prod_name = this.comboBox2.Text.ToString();
  534. CoreClientParam ccp = new CoreClientParam();
  535. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  536. ccp.MethodName = "getLgInformation";
  537. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"),heatno,material_no,prod_name,"4" };
  538. ccp.SourceDataTable = this.dataSet1.Tables[0];
  539. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  540. }
  541. catch (Exception ex)
  542. {
  543. System.Diagnostics.Debug.WriteLine(ex.ToString());
  544. MessageBox.Show("系统出错,请联系管理人员", "警告");
  545. }
  546. }
  547. private void DoQueryRe()
  548. {
  549. try
  550. {
  551. this.dataSet2.Clear();
  552. string heatno = this.textBox4.Text.ToString();
  553. string material_no = this.textBox5.Text.ToString();
  554. string prod_name = this.comboBox2.Text.ToString();
  555. CoreClientParam ccp = new CoreClientParam();
  556. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  557. ccp.MethodName = "getAbnormalRecordLgInfo";
  558. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), heatno, material_no, prod_name, "4" };
  559. ccp.SourceDataTable = this.dataSet2.Tables[0];
  560. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  561. foreach (UltraGridRow ugrs in this.ultraGrid2.Rows)
  562. {
  563. if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样"))
  564. {
  565. ugrs.Appearance.BackColor = Color.Pink;
  566. }
  567. }
  568. }
  569. catch (Exception ex)
  570. {
  571. System.Diagnostics.Debug.WriteLine(ex.ToString());
  572. MessageBox.Show("系统出错,请联系管理人员", "警告");
  573. }
  574. }
  575. private void label1_Click(object sender, EventArgs e)
  576. {
  577. }
  578. private void panel4_Paint(object sender, PaintEventArgs e)
  579. {
  580. }
  581. private void panel2_Paint(object sender, PaintEventArgs e)
  582. {
  583. }
  584. private void DoQueryC()
  585. {
  586. try
  587. {
  588. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  589. if (ugr == null)
  590. return;
  591. this.dataSet4.Clear();
  592. string design_key = ugr.Cells["design_key"].Value.ToString();
  593. string smp_no = ugr.Cells["smp_no"].Value.ToString();
  594. CoreClientParam ccp = new CoreClientParam();
  595. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  596. ccp.MethodName = "GetChemeInfo";
  597. ccp.ServerParams = new object[] { design_key, smp_no};
  598. ccp.SourceDataTable = this.dataSet4.Tables[0];
  599. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  600. }
  601. catch (Exception ex)
  602. {
  603. System.Diagnostics.Debug.WriteLine(ex.ToString());
  604. MessageBox.Show("系统出错,请联系管理人员", "警告");
  605. }
  606. }
  607. private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  608. {
  609. UltraGridRow ugr = e.Cell.Row;
  610. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  611. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  612. {
  613. QCM030705 dlg = new QCM030705();
  614. dlg.lock_id = lock_id;
  615. dlg.ob = this.ob;
  616. dlg.ShowDialog();
  617. }
  618. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  619. {
  620. QCM030704 dlg = new QCM030704();
  621. dlg.lock_id = lock_id;
  622. dlg.ob = this.ob;
  623. dlg.ShowDialog();
  624. }
  625. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  626. {
  627. QCM030701 dlg = new QCM030701();
  628. dlg.lock_id = lock_id;
  629. dlg.ob = this.ob;
  630. dlg.ShowDialog();
  631. }
  632. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  633. {
  634. QCM030702 dlg = new QCM030702();
  635. dlg.lock_id = lock_id;
  636. dlg.ob = this.ob;
  637. dlg.ShowDialog();
  638. }
  639. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  640. {
  641. QCM030703 dlg = new QCM030703();
  642. dlg.lock_id = lock_id;
  643. dlg.ob = this.ob;
  644. dlg.ShowDialog();
  645. }
  646. }
  647. private void button1_Click(object sender, EventArgs e)
  648. {
  649. int count = 0;
  650. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  651. foreach (UltraGridRow ugr1 in this.ultraGrid9.Rows)
  652. {
  653. if (ugr1.Cells["CHECK"].Value.ToString() == "True")
  654. {
  655. ugr = ugr1;
  656. count++;
  657. continue;
  658. }
  659. }
  660. if (count == 0)
  661. {
  662. MessageBox.Show("请选择数据!");
  663. return;
  664. }
  665. string prodline = "4001LGX";
  666. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  667. string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
  668. string steelname = "";
  669. QCM030710 dlg = new QCM030710();
  670. dlg.prodline = prodline;
  671. dlg.material_no = material_no;
  672. dlg.prod_name = prod_name;
  673. dlg.steel = steelname;
  674. dlg.ob = this.ob;
  675. dlg.ShowDialog();
  676. this.textBox3.Text = dlg.steelname;
  677. }
  678. public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
  679. {
  680. if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
  681. return null;
  682. ArrayList alist = new ArrayList();
  683. ValueList vlist = new ValueList();
  684. for (int i = 0; i < table.Rows.Count; i++)
  685. {
  686. try
  687. {
  688. if (!alist.Contains(table.Rows[i][strKey]))
  689. {
  690. alist.Add(table.Rows[i][strKey]);
  691. vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
  692. }
  693. }
  694. catch { }
  695. }
  696. return vlist;
  697. }
  698. private void QCM030708_Load(object sender, EventArgs e)
  699. {
  700. this.comboBox2.SelectedIndex = 0;
  701. this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  702. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  703. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  704. //CoreClientParam ccp = new CoreClientParam();
  705. //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  706. //ccp.MethodName = "findXmMemo";
  707. //ccp.ServerParams = new object[] { };
  708. //ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  709. //DataTable table1 = ccp.SourceDataTable;
  710. //ValueList valueList1 = GeneralValuelist(ref table1, "SM_CD", "SM_CFNM");
  711. //this.checkBoxComboBox1.DataSource = valueList1.ValueListItems;
  712. //ccp = new CoreClientParam();
  713. //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  714. //ccp.MethodName = "findCcMemo";
  715. //ccp.ServerParams = new object[] { };
  716. //ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  717. //DataTable table2 = ccp.SourceDataTable;
  718. //ValueList valueList2 = GeneralValuelist(ref table2, "SM_CD", "SM_CFNM");
  719. //this.checkBoxComboBox2.DataSource = valueList2.ValueListItems;
  720. CoreClientParam ccp = new CoreClientParam();
  721. ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
  722. ccp.MethodName = "QueryMemo";
  723. ccp.ServerParams = new object[] { "LG" };
  724. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  725. System.Data.DataTable dt = new System.Data.DataTable();
  726. dt = ccp.SourceDataTable;
  727. DataRow dr = dt.NewRow();
  728. dt.Rows.Add(dr);
  729. comboBox3.DataSource = dt;
  730. comboBox3.ValueMember = "MEMO";
  731. comboBox3.DisplayMember = "MEMO";
  732. comboBox3.SelectedIndex = dt.Rows.Count - 1;
  733. }
  734. private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  735. {
  736. UltraGridRow ugr = e.Cell.Row;
  737. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  738. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  739. {
  740. QCM030705 dlg = new QCM030705();
  741. dlg.lock_id = lock_id;
  742. dlg.ob = this.ob;
  743. dlg.ShowDialog();
  744. }
  745. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  746. {
  747. QCM030704 dlg = new QCM030704();
  748. dlg.lock_id = lock_id;
  749. dlg.ob = this.ob;
  750. dlg.ShowDialog();
  751. }
  752. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  753. {
  754. QCM030701 dlg = new QCM030701();
  755. dlg.lock_id = lock_id;
  756. dlg.ob = this.ob;
  757. dlg.ShowDialog();
  758. }
  759. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  760. {
  761. QCM030702 dlg = new QCM030702();
  762. dlg.lock_id = lock_id;
  763. dlg.ob = this.ob;
  764. dlg.ShowDialog();
  765. }
  766. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  767. {
  768. QCM030703 dlg = new QCM030703();
  769. dlg.lock_id = lock_id;
  770. dlg.ob = this.ob;
  771. dlg.ShowDialog();
  772. }
  773. }
  774. private void ultraTabControl1_Click(object sender, EventArgs e)
  775. {
  776. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  777. {
  778. this.label4.Text = "处置时间";
  779. }
  780. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  781. {
  782. this.label4.Text = "封锁时间";
  783. }
  784. }
  785. private void DoExport()
  786. {
  787. try
  788. {
  789. if (this.ultraGrid2.Rows.Count == 0)
  790. {
  791. MessageBox.Show("没有可以导出的数据", "提示");
  792. return;
  793. }
  794. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  795. {
  796. string fName = this.saveFileDialog1.FileName;
  797. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  798. Process.Start(fName);
  799. }
  800. }
  801. catch (Exception ex)
  802. {
  803. System.Diagnostics.Debug.WriteLine(ex.ToString());
  804. }
  805. }
  806. }
  807. }