9e0366d48143d70c6d9afc3dea00bcca041dc142.svn-base 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  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 Microsoft.Office.Interop.Excel;
  14. using System.Diagnostics;
  15. namespace Core.LZMes.Client.QCM
  16. {
  17. public partial class QCM030707 : FrmBase
  18. {
  19. public QCM030707()
  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. ugr.Delete();
  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 = "4001LG0";
  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=" + "4001LG0";
  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=" + "4001LG0";
  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. if (lock_type_code == "C")
  309. {
  310. CoreClientParam ccp2 = new CoreClientParam();
  311. ccp2.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  312. ccp2.MethodName = "JfJudge";
  313. ccp2.ServerParams = new object[] { material, lock_seq };
  314. ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
  315. if (ccp2.ReturnCode == -1)
  316. {
  317. if (MessageBox.Show(this, ccp2.ReturnInfo + ",是否对" + material + "进行放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  318. {
  319. return;
  320. }
  321. }
  322. }
  323. unlock_type_code = "0";
  324. //QCM030720 dlg = new QCM030720();
  325. //dlg.StartPosition = FormStartPosition.CenterParent;
  326. //dlg.design_key = design_key;
  327. //dlg.heat_no = heat_no;
  328. //dlg.grade_name = grade_name;
  329. //dlg.ob = this.ob;
  330. //if (dlg.ShowDialog() != DialogResult.OK)
  331. //{
  332. // return;
  333. //}
  334. //assay_no = dlg.assay_no;
  335. //if (assay_no == "")
  336. //{
  337. // MessageBox.Show("请选择成分实绩!");
  338. // return;
  339. //}
  340. }
  341. else if (comboBox1.Text.Trim().ToString() == "复样")
  342. {
  343. unlock_type_code = "1";
  344. }
  345. else if (comboBox1.Text.Trim().ToString() == "修磨")
  346. {
  347. unlock_type_code = "2";
  348. }
  349. else if (comboBox1.Text.Trim().ToString() == "改尺")
  350. {
  351. unlock_type_code = "3";
  352. }
  353. else if (comboBox1.Text.Trim().ToString() == "判次")
  354. {
  355. unlock_type_code = "4";
  356. }
  357. else if (comboBox1.Text.Trim().ToString() == "判废")
  358. {
  359. unlock_type_code = "5";
  360. }
  361. else if (comboBox1.Text.Trim().ToString() == "脱单")
  362. {
  363. unlock_type_code = "6";
  364. }
  365. else if (comboBox1.Text.Trim().ToString() == "关闭")
  366. {
  367. unlock_type_code = "11";
  368. }
  369. else if (comboBox1.Text.Trim().ToString() == "复样+放行")
  370. {
  371. unlock_type_code = "12";
  372. QCM030720 dlg = new QCM030720();
  373. dlg.StartPosition = FormStartPosition.CenterParent;
  374. dlg.design_key = design_key;
  375. dlg.heat_no = heat_no;
  376. dlg.grade_name = grade_name;
  377. dlg.ob = this.ob;
  378. if (dlg.ShowDialog() != DialogResult.OK)
  379. {
  380. return;
  381. }
  382. assay_no = dlg.assay_no;
  383. if (assay_no == "")
  384. {
  385. MessageBox.Show("请选择成分实绩!");
  386. return;
  387. }
  388. //CoreClientParam ccp = new CoreClientParam();
  389. //ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  390. //ccp.MethodName = "JudgeCheck1";
  391. //ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LG0", "0" };
  392. //this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  393. //if (ccp.ReturnCode == 2)
  394. //{
  395. // QCM030718 dlg = new QCM030718();
  396. // dlg.StartPosition = FormStartPosition.CenterParent;
  397. // dlg.design_key = design_key;
  398. // dlg.heat_no = heat_no;
  399. // dlg.grade_name = grade_name;
  400. // dlg.ob = this.ob;
  401. // if (dlg.ShowDialog() != DialogResult.OK)
  402. // {
  403. // return;
  404. // }
  405. //}
  406. }
  407. else if (comboBox1.Text.Trim().ToString() == "验样")
  408. {
  409. unlock_type_code = "13";
  410. }
  411. else if (comboBox1.Text.Trim().ToString() == "验样+放行")
  412. {
  413. unlock_type_code = "14";
  414. CoreClientParam ccp = new CoreClientParam();
  415. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  416. ccp.MethodName = "JudgeCheck1";
  417. ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LG0", "1" };
  418. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  419. if (ccp.ReturnCode == 2)
  420. {
  421. QCM030718 dlg = new QCM030718();
  422. dlg.StartPosition = FormStartPosition.CenterParent;
  423. dlg.design_key = design_key;
  424. dlg.heat_no = heat_no;
  425. dlg.grade_name = grade_name;
  426. dlg.ob = this.ob;
  427. if (dlg.ShowDialog() != DialogResult.OK)
  428. {
  429. return;
  430. }
  431. }
  432. }
  433. string unlock_memo = this.comboBox3.Text.Trim().ToString();
  434. if (string.IsNullOrEmpty(unlock_memo) && lock_type_code == "C" && "0".Equals(unlock_type_code))
  435. {
  436. this.alert("处理备注为空,请选择相应审理人员!");
  437. return;
  438. }
  439. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  440. al.Add(material);
  441. al.Add(lock_seq);
  442. al.Add(lock_type_code);
  443. al.Add(unlock_type_code);
  444. al.Add(unlock_memo);
  445. al.Add(username);
  446. al.Add(lock_id);
  447. al.Add(this.comboBox4.Text.ToString());
  448. al.Add("");
  449. al.Add("");
  450. al.Add(assay_no);
  451. CoreClientParam ccp1 = new CoreClientParam();
  452. ccp1.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  453. ccp1.MethodName = "doInformationLgSure";
  454. ccp1.ServerParams = new object[] { al };
  455. ccp1 = this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  456. if (ccp1.ReturnCode == -1)
  457. {
  458. return;
  459. }
  460. lists.Add(ugr);
  461. }
  462. else
  463. {
  464. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  465. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  466. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  467. string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
  468. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  469. string username = this.UserInfo.GetUserName();
  470. string grade_name = ugr.Cells["STEEL_NAME"].Value.ToString();
  471. string unlock_type_code = "";
  472. if (comboBox1.Text.Trim().ToString() == "改判")
  473. {
  474. unlock_type_code = "7";
  475. }
  476. else if (comboBox1.Text.Trim().ToString() == "改判+放行")
  477. {
  478. unlock_type_code = "15";
  479. CoreClientParam ccp = new CoreClientParam();
  480. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  481. ccp.MethodName = "JudgeCheck1";
  482. ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LG0", "2" };
  483. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  484. if (ccp.ReturnCode == 2)
  485. {
  486. QCM030718 dlg = new QCM030718();
  487. dlg.StartPosition = FormStartPosition.CenterParent;
  488. dlg.design_key = design_key;
  489. dlg.heat_no = heat_no;
  490. dlg.grade_name = grade_name;
  491. dlg.ob = this.ob;
  492. if (dlg.ShowDialog() != DialogResult.OK)
  493. {
  494. return;
  495. }
  496. }
  497. }
  498. string unlock_memo = this.comboBox3.Text.Trim().ToString();
  499. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  500. al.Add(material);
  501. al.Add(lock_seq);
  502. al.Add(lock_type_code);
  503. al.Add(unlock_type_code);
  504. al.Add(unlock_memo);
  505. al.Add(username);
  506. al.Add(lock_id);
  507. al.Add(textBox3.Text.ToString());
  508. al.Add("");
  509. CoreClientParam ccp1 = new CoreClientParam();
  510. ccp1.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  511. ccp1.MethodName = "doInformationLgGp";
  512. ccp1.ServerParams = new object[] { al };
  513. ccp1 = this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  514. if (ccp1.ReturnCode == -1)
  515. {
  516. return;
  517. }
  518. lists.Add(ugr);
  519. }
  520. }
  521. }
  522. for (int i = 0; i < lists.Count; i++)
  523. {
  524. lists[i].Delete(false);
  525. }
  526. MessageBox.Show("异常处置成功!");
  527. }
  528. private void DoQuery()
  529. {
  530. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  531. {
  532. DoQueryMe();
  533. }
  534. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  535. {
  536. DoQueryRe();
  537. }
  538. }
  539. private void DoQueryMe()
  540. {
  541. try
  542. {
  543. this.dataSet1.Clear();
  544. string heatno = this.textBox4.Text.ToString();
  545. string material_no = this.textBox5.Text.ToString();
  546. string prod_name = this.comboBox2.Text.ToString();
  547. CoreClientParam ccp = new CoreClientParam();
  548. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  549. ccp.MethodName = "getLgInformation";
  550. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), heatno, material_no, prod_name, "3" };
  551. ccp.SourceDataTable = this.dataSet1.Tables[0];
  552. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  553. }
  554. catch (Exception ex)
  555. {
  556. System.Diagnostics.Debug.WriteLine(ex.ToString());
  557. MessageBox.Show("系统出错,请联系管理人员", "警告");
  558. }
  559. }
  560. private void DoQueryRe()
  561. {
  562. try
  563. {
  564. this.dataSet2.Clear();
  565. string heatno = this.textBox4.Text.ToString();
  566. string material_no = this.textBox5.Text.ToString();
  567. string prod_name = this.comboBox2.Text.ToString();
  568. CoreClientParam ccp = new CoreClientParam();
  569. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  570. ccp.MethodName = "getAbnormalRecordLgInfo";
  571. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), heatno, material_no, prod_name, "3" };
  572. ccp.SourceDataTable = this.dataSet2.Tables[0];
  573. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  574. foreach (UltraGridRow ugrs in this.ultraGrid2.Rows)
  575. {
  576. if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样"))
  577. {
  578. ugrs.Appearance.BackColor = Color.Pink;
  579. }
  580. }
  581. }
  582. catch (Exception ex)
  583. {
  584. System.Diagnostics.Debug.WriteLine(ex.ToString());
  585. MessageBox.Show("系统出错,请联系管理人员", "警告");
  586. }
  587. }
  588. private void label1_Click(object sender, EventArgs e)
  589. {
  590. }
  591. private void panel4_Paint(object sender, PaintEventArgs e)
  592. {
  593. }
  594. private void panel2_Paint(object sender, PaintEventArgs e)
  595. {
  596. }
  597. private void DoQueryC()
  598. {
  599. try
  600. {
  601. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  602. if (ugr == null)
  603. return;
  604. this.dataSet4.Clear();
  605. string design_key = ugr.Cells["design_key"].Value.ToString();
  606. string smp_no = ugr.Cells["smp_no"].Value.ToString();
  607. CoreClientParam ccp = new CoreClientParam();
  608. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  609. ccp.MethodName = "GetChemeInfo";
  610. ccp.ServerParams = new object[] { design_key, smp_no};
  611. ccp.SourceDataTable = this.dataSet4.Tables[0];
  612. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  613. }
  614. catch (Exception ex)
  615. {
  616. System.Diagnostics.Debug.WriteLine(ex.ToString());
  617. MessageBox.Show("系统出错,请联系管理人员", "警告");
  618. }
  619. }
  620. private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  621. {
  622. UltraGridRow ugr = e.Cell.Row;
  623. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  624. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  625. {
  626. QCM030705 dlg = new QCM030705();
  627. dlg.lock_id = lock_id;
  628. dlg.ob = this.ob;
  629. dlg.ShowDialog();
  630. }
  631. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  632. {
  633. QCM030704 dlg = new QCM030704();
  634. dlg.lock_id = lock_id;
  635. dlg.ob = this.ob;
  636. dlg.ShowDialog();
  637. }
  638. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  639. {
  640. QCM030701 dlg = new QCM030701();
  641. dlg.lock_id = lock_id;
  642. dlg.ob = this.ob;
  643. dlg.ShowDialog();
  644. }
  645. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  646. {
  647. QCM030702 dlg = new QCM030702();
  648. dlg.lock_id = lock_id;
  649. dlg.ob = this.ob;
  650. dlg.ShowDialog();
  651. }
  652. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  653. {
  654. QCM030703 dlg = new QCM030703();
  655. dlg.lock_id = lock_id;
  656. dlg.ob = this.ob;
  657. dlg.ShowDialog();
  658. }
  659. }
  660. private void button1_Click(object sender, EventArgs e)
  661. {
  662. int count = 0;
  663. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  664. foreach (UltraGridRow ugr1 in this.ultraGrid9.Rows)
  665. {
  666. if (ugr1.Cells["CHECK"].Value.ToString() == "True")
  667. {
  668. ugr = ugr1;
  669. count++;
  670. continue;
  671. }
  672. }
  673. if (count == 0)
  674. {
  675. MessageBox.Show("请选择数据!");
  676. return;
  677. }
  678. string prodline = "4001LG0";
  679. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  680. string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
  681. string steelname = "";
  682. QCM030710 dlg = new QCM030710();
  683. dlg.prodline = prodline;
  684. dlg.material_no = material_no;
  685. dlg.prod_name = prod_name;
  686. dlg.steel = steelname;
  687. dlg.ob = this.ob;
  688. dlg.ShowDialog();
  689. this.textBox3.Text = dlg.steelname;
  690. }
  691. private void QCM030707_Load(object sender, EventArgs e)
  692. {
  693. this.comboBox2.SelectedIndex = 0;
  694. this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  695. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  696. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  697. CoreClientParam ccp = new CoreClientParam();
  698. ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
  699. ccp.MethodName = "QueryMemo";
  700. ccp.ServerParams = new object[] { "LG" };
  701. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  702. System.Data.DataTable dt = new System.Data.DataTable();
  703. dt = ccp.SourceDataTable;
  704. DataRow dr = dt.NewRow();
  705. dt.Rows.Add(dr);
  706. comboBox3.DataSource = dt;
  707. comboBox3.ValueMember = "MEMO";
  708. comboBox3.DisplayMember = "MEMO";
  709. comboBox3.SelectedIndex = dt.Rows.Count - 1;
  710. }
  711. private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  712. {
  713. UltraGridRow ugr = e.Cell.Row;
  714. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  715. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  716. {
  717. QCM030705 dlg = new QCM030705();
  718. dlg.lock_id = lock_id;
  719. dlg.ob = this.ob;
  720. dlg.ShowDialog();
  721. }
  722. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  723. {
  724. QCM030704 dlg = new QCM030704();
  725. dlg.lock_id = lock_id;
  726. dlg.ob = this.ob;
  727. dlg.ShowDialog();
  728. }
  729. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  730. {
  731. QCM030701 dlg = new QCM030701();
  732. dlg.lock_id = lock_id;
  733. dlg.ob = this.ob;
  734. dlg.ShowDialog();
  735. }
  736. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  737. {
  738. QCM030702 dlg = new QCM030702();
  739. dlg.lock_id = lock_id;
  740. dlg.ob = this.ob;
  741. dlg.ShowDialog();
  742. }
  743. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  744. {
  745. QCM030703 dlg = new QCM030703();
  746. dlg.lock_id = lock_id;
  747. dlg.ob = this.ob;
  748. dlg.ShowDialog();
  749. }
  750. }
  751. private void ultraTabControl1_Click(object sender, EventArgs e)
  752. {
  753. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  754. {
  755. this.label4.Text = "处置时间";
  756. }
  757. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  758. {
  759. this.label4.Text = "封锁时间";
  760. }
  761. }
  762. private void DoExport()
  763. {
  764. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  765. {
  766. try
  767. {
  768. if (this.ultraGrid9.Rows.Count == 0)
  769. {
  770. MessageBox.Show("没有可以导出的数据", "提示");
  771. return;
  772. }
  773. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  774. {
  775. string fName = this.saveFileDialog1.FileName;
  776. this.ultraGridExcelExporter1.Export(this.ultraGrid9, fName);
  777. Process.Start(fName);
  778. }
  779. }
  780. catch (Exception ex)
  781. {
  782. System.Diagnostics.Debug.WriteLine(ex.ToString());
  783. }
  784. }
  785. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  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. }
  808. }