260a24d88761d6279357fab647728faa615c7742.svn-base 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  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;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Core.LZMes.Client.QCM.QCM03;
  14. using System.Diagnostics;
  15. using Infragistics.Win.UltraWinEditors;
  16. namespace Core.LZMes.Client.QCM
  17. {
  18. public partial class QCM030706 : FrmBase
  19. {
  20. private string judge_type = "";//用于区分1检测中心和2轧钢厂
  21. public QCM030706()
  22. {
  23. InitializeComponent();
  24. }
  25. public override void ToolBar_Click(object sender, string ToolbarKey)
  26. {
  27. switch (ToolbarKey)
  28. {
  29. case "Query":
  30. this.DoQuery();
  31. break;
  32. case "Exit":
  33. this.Close();
  34. break;
  35. case "Unlock":
  36. this.Judge();
  37. break;
  38. case "Export":
  39. this.DoExport();
  40. break;
  41. case "CancelFy":
  42. CancelFy();
  43. break;
  44. case "CancelFx":
  45. CancelFx();
  46. break;
  47. case "CancelPf":
  48. CancelPf();
  49. break;
  50. }
  51. }
  52. private void CancelFx()
  53. {
  54. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  55. if (ugr == null)
  56. {
  57. MessageBox.Show("请选择数据!");
  58. return;
  59. }
  60. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  61. if (MessageBox.Show(this, "是否对" + material_no + "取消放行操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  62. {
  63. return;
  64. }
  65. QCM030607 frm = new QCM030607();
  66. string remark = "";
  67. if (frm.ShowDialog() == DialogResult.OK)
  68. {
  69. remark = frm._memo;
  70. if (remark == "")
  71. {
  72. MessageBox.Show("请录入备注信息!");
  73. return;
  74. }
  75. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  76. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  77. string username = this.UserInfo.GetUserName();
  78. CoreClientParam ccp = new CoreClientParam();
  79. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  80. ccp.MethodName = "CancelFx";
  81. ccp.ServerParams = new object[] { material_no, lock_type_code, lock_seq, username, remark };
  82. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  83. if (ccp.ReturnCode == -1)
  84. {
  85. return;
  86. }
  87. MessageBox.Show("取消放行成功!");
  88. DoQuery();
  89. }
  90. }
  91. private void CancelPf()
  92. {
  93. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  94. if (ugr == null)
  95. {
  96. MessageBox.Show("请选择数据!");
  97. return;
  98. }
  99. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  100. if (MessageBox.Show(this, "是否对" + material_no + "取消判废操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  101. {
  102. return;
  103. }
  104. QCM030607 frm = new QCM030607();
  105. string remark = "";
  106. if (frm.ShowDialog() == DialogResult.OK)
  107. {
  108. remark = frm._memo;
  109. if (remark == "")
  110. {
  111. MessageBox.Show("请录入备注信息!");
  112. return;
  113. }
  114. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  115. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  116. string username = this.UserInfo.GetUserName();
  117. CoreClientParam ccp = new CoreClientParam();
  118. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  119. ccp.MethodName = "CancelPf";
  120. ccp.ServerParams = new object[] { material_no, lock_type_code, lock_seq, username, remark };
  121. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  122. if (ccp.ReturnCode == -1)
  123. {
  124. return;
  125. }
  126. MessageBox.Show("取消判废成功!");
  127. DoQuery();
  128. }
  129. }
  130. private void CancelFy()
  131. {
  132. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  133. if (ugr == null)
  134. {
  135. MessageBox.Show("请选择数据!");
  136. return;
  137. }
  138. string batch_no = ugr.Cells["BATCH_NO"].Value.ToString();
  139. if (MessageBox.Show(this, "是否对" + batch_no + "取消复样操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  140. {
  141. return;
  142. }
  143. QCM030607 frm = new QCM030607();
  144. string remark = "";
  145. if (frm.ShowDialog() == DialogResult.OK)
  146. {
  147. remark = frm._memo;
  148. if (remark == "")
  149. {
  150. MessageBox.Show("请录入备注信息!");
  151. return;
  152. }
  153. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  154. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  155. string username = this.UserInfo.GetUserName();
  156. CoreClientParam ccp = new CoreClientParam();
  157. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  158. ccp.MethodName = "CancelFy";
  159. ccp.ServerParams = new object[] { batch_no, material_no, lock_seq, username, remark };
  160. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  161. if (ccp.ReturnCode == -1)
  162. {
  163. return;
  164. }
  165. MessageBox.Show("取消复样成功!");
  166. DoQuery();
  167. }
  168. }
  169. private void Judge()
  170. {
  171. if (this.ultraGrid9.Selected.Rows.Count == 0)
  172. this.ultraGrid9.ActiveRow.Selected = true;
  173. List<UltraGridRow> lists = new List<UltraGridRow>();
  174. if (comboBox1.Text.Trim().ToString() == "")
  175. {
  176. MessageBox.Show("请选择异常材处置放向!");
  177. return;
  178. }
  179. if (comboBox1.Text.Trim().ToString() == "放行")
  180. {
  181. if (MessageBox.Show(this, "是否放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  182. {
  183. return;
  184. }
  185. }
  186. else if (comboBox1.Text.Trim().ToString() == "复样")
  187. {
  188. if (MessageBox.Show(this, "是否复样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  189. {
  190. return;
  191. }
  192. }
  193. else if (comboBox1.Text.Trim().ToString() == "修磨")
  194. {
  195. if (MessageBox.Show(this, "是否修磨处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  196. {
  197. return;
  198. }
  199. }
  200. else if (comboBox1.Text.Trim().ToString() == "改尺")
  201. {
  202. if (MessageBox.Show(this, "是否改尺处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  203. {
  204. return;
  205. }
  206. }
  207. else if (comboBox1.Text.Trim().ToString() == "判次")
  208. {
  209. if (MessageBox.Show(this, "是否判次处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  210. {
  211. return;
  212. }
  213. }
  214. else if (comboBox1.Text.Trim().ToString() == "判废")
  215. {
  216. if (MessageBox.Show(this, "是否判废处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  217. {
  218. return;
  219. }
  220. }
  221. else if (comboBox1.Text.Trim().ToString() == "脱单")
  222. {
  223. if (MessageBox.Show(this, "是否脱单处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  224. {
  225. return;
  226. }
  227. }
  228. else if (comboBox1.Text.Trim().ToString() == "按子板件件取样")
  229. {
  230. if (MessageBox.Show(this, "是否按子板件件取样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  231. {
  232. return;
  233. }
  234. }
  235. else if (comboBox1.Text.Trim().ToString() == "解除")
  236. {
  237. if (MessageBox.Show(this, "是否解除处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  238. {
  239. return;
  240. }
  241. }
  242. else if (comboBox1.Text.Trim().ToString() == "待判")
  243. {
  244. if (MessageBox.Show(this, "是否待判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  245. {
  246. return;
  247. }
  248. }
  249. else if (comboBox1.Text.Trim().ToString() == "按母板件件取样")
  250. {
  251. if (MessageBox.Show(this, "是否按母板件件取样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  252. {
  253. return;
  254. }
  255. }
  256. else if (comboBox1.Text.Trim().ToString() == "性能改善")
  257. {
  258. if (MessageBox.Show(this, "是否性能改善处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  259. {
  260. return;
  261. }
  262. }
  263. else if (comboBox1.Text.Trim().ToString() == "改判")
  264. {
  265. if (textBox3.Text.ToString() == "")
  266. {
  267. MessageBox.Show("请选择改判订单!");
  268. return;
  269. }
  270. if (MessageBox.Show(this, "是否改判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  271. {
  272. return;
  273. }
  274. }
  275. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  276. {
  277. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  278. {
  279. ArrayList al = new ArrayList();
  280. if (comboBox1.Text.Trim().ToString() != "改判")
  281. {
  282. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  283. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  284. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  285. string prodline = ugr.Cells["PLINE_CODE"].Value.ToString();
  286. string unlock_type_code = "";
  287. if (lock_type_code == "C" || lock_type_code == "P")
  288. {
  289. if (comboBox1.Text.Trim().ToString() == "放行")
  290. {
  291. unlock_type_code = "0";
  292. }
  293. else if (comboBox1.Text.Trim().ToString() == "复样")
  294. {
  295. unlock_type_code = "1";
  296. }
  297. else if (comboBox1.Text.Trim().ToString() == "判次")
  298. {
  299. unlock_type_code = "4";
  300. }
  301. else if (comboBox1.Text.Trim().ToString() == "判废")
  302. {
  303. unlock_type_code = "5";
  304. }
  305. else if (comboBox1.Text.Trim().ToString() == "脱单")
  306. {
  307. unlock_type_code = "6";
  308. }
  309. else if (comboBox1.Text.Trim().ToString() == "按子板件件取样")
  310. {
  311. unlock_type_code = "8";
  312. }
  313. else if (comboBox1.Text.Trim().ToString() == "解除")
  314. {
  315. unlock_type_code = "9";
  316. }
  317. else if (comboBox1.Text.Trim().ToString() == "待判")
  318. {
  319. unlock_type_code = "10";
  320. }
  321. else if (comboBox1.Text.Trim().ToString() == "按母板件件取样")
  322. {
  323. unlock_type_code = "16";
  324. }
  325. else if (comboBox1.Text.Trim().ToString() == "性能改善")
  326. {
  327. unlock_type_code = "17";
  328. }
  329. string unlock_memo = ultraComboEditor1.Text.Trim().ToString();
  330. string bh_combobox = this.comboBox4.Text.Trim().ToString();
  331. if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C"))
  332. {
  333. if (string.IsNullOrEmpty(unlock_memo) || string.IsNullOrEmpty(bh_combobox))
  334. {
  335. this.alert("请选择审理人员及不合格品审理类型!");
  336. return;
  337. }
  338. }
  339. string username = this.UserInfo.GetUserName() + 'Y';
  340. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  341. al.Add(material);
  342. al.Add(lock_seq);
  343. al.Add(lock_type_code);
  344. al.Add(unlock_type_code);
  345. al.Add(unlock_memo);
  346. al.Add(username);
  347. al.Add(lock_id);
  348. if (ultraCombo1.Text.ToString() == "")
  349. { al.Add(""); }
  350. else
  351. {
  352. al.Add(ultraCombo1.Value.ToString());
  353. }
  354. al.Add(prodline);
  355. al.Add(this.comboBox4.Text.ToString());
  356. if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C"))
  357. {
  358. lists.Add(ugr);
  359. String status = ugr.Cells["STATUS"].Text.Trim().ToString();
  360. if ("已申请".Equals(status))
  361. {
  362. continue;
  363. }
  364. CoreClientParam ccp = new CoreClientParam();
  365. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  366. ccp.MethodName = "LockingApply";
  367. ccp.ServerParams = new object[] { al };
  368. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  369. if (ccp.ReturnCode == -1)
  370. {
  371. return;
  372. }
  373. }
  374. else
  375. {
  376. CoreClientParam ccp = new CoreClientParam();
  377. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  378. ccp.MethodName = "doInformationSure";
  379. ccp.ServerParams = new object[] { al };
  380. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  381. if (ccp.ReturnCode == -1)
  382. {
  383. return;
  384. }
  385. lists.Add(ugr);
  386. }
  387. }
  388. else
  389. {
  390. if (comboBox1.Text.Trim().ToString() == "放行")
  391. {
  392. unlock_type_code = "0";
  393. }
  394. else if (comboBox1.Text.Trim().ToString() == "修磨")
  395. {
  396. unlock_type_code = "2";
  397. }
  398. else if (comboBox1.Text.Trim().ToString() == "改尺")
  399. {
  400. unlock_type_code = "3";
  401. }
  402. else if (comboBox1.Text.Trim().ToString() == "判次")
  403. {
  404. unlock_type_code = "4";
  405. }
  406. else if (comboBox1.Text.Trim().ToString() == "判废")
  407. {
  408. unlock_type_code = "5";
  409. }
  410. else if (comboBox1.Text.Trim().ToString() == "脱单")
  411. {
  412. unlock_type_code = "6";
  413. }
  414. else if (comboBox1.Text.Trim().ToString() == "解除")
  415. {
  416. unlock_type_code = "9";
  417. }
  418. else if (comboBox1.Text.Trim().ToString() == "待判")
  419. {
  420. unlock_type_code = "10";
  421. }
  422. string unlock_memo = this.ultraComboEditor1.Text.Trim().ToString();
  423. string username = this.UserInfo.GetUserName();
  424. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  425. string sf_type = ugr.Cells["SF_TYPE"].Value.ToString();
  426. al.Add(material);
  427. al.Add(lock_seq);
  428. al.Add(lock_type_code);
  429. al.Add(unlock_type_code);
  430. al.Add(unlock_memo);
  431. al.Add(username);
  432. al.Add(lock_id);
  433. if (ultraCombo1.Text.ToString() == "")
  434. { al.Add(""); }
  435. else
  436. {
  437. al.Add(ultraCombo1.Value.ToString());
  438. }
  439. al.Add(sf_type);
  440. al.Add(this.comboBox4.Text.ToString());
  441. CoreClientParam ccp = new CoreClientParam();
  442. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  443. ccp.MethodName = "doInformationSureH2";
  444. ccp.ServerParams = new object[] { al };
  445. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  446. if (ccp.ReturnCode == -1)
  447. {
  448. return;
  449. }
  450. lists.Add(ugr);
  451. }
  452. }
  453. else
  454. {
  455. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  456. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  457. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  458. string unlock_type_code = "7";
  459. string unlock_memo = this.ultraComboEditor1.Text.Trim().ToString();
  460. string username = this.UserInfo.GetUserName();
  461. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  462. al.Add(material);
  463. al.Add(lock_seq);
  464. al.Add(lock_type_code);
  465. al.Add(unlock_type_code);
  466. al.Add(unlock_memo);
  467. al.Add(username);
  468. al.Add(lock_id);
  469. al.Add(textBox3.Text.ToString());
  470. if (ultraCombo1.Text.ToString() == "")
  471. { al.Add(""); }
  472. else
  473. {
  474. al.Add(ultraCombo1.Value.ToString());
  475. }
  476. al.Add(this.txt_gp_tradeno.Text);
  477. al.Add(this.comboBox4.Text.ToString());
  478. CoreClientParam ccp = new CoreClientParam();
  479. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  480. ccp.MethodName = "doInformationGp";
  481. ccp.ServerParams = new object[] { al };
  482. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  483. if (ccp.ReturnCode == -1)
  484. {
  485. return;
  486. }
  487. lists.Add(ugr);
  488. }
  489. }
  490. }
  491. for (int i = 0; i < lists.Count; i++)
  492. {
  493. lists[i].Delete(false);
  494. }
  495. MessageBox.Show("异常处置成功!");
  496. }
  497. private void DoQuery()
  498. {
  499. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  500. {
  501. DoQueryMe();
  502. }
  503. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  504. {
  505. DoQueryRe();
  506. }
  507. }
  508. private void DoQueryMe()
  509. {
  510. try
  511. {
  512. this.dataSet1.Clear();
  513. this.dataSet8.Clear();
  514. string ebatchno = "";
  515. string sbatchno = BatchNo.Text.Trim();
  516. if (BatchNo1.Text.ToString() == "")
  517. {
  518. ebatchno = this.BatchNo.Text.Trim();
  519. }
  520. else
  521. {
  522. ebatchno = BatchNo1.Text.Trim();
  523. }
  524. string orderno = this.OrderNo.Text.Trim();
  525. string psc = this.PscDesc.Text.Trim();
  526. string prodline = this.comboBox3.Text.ToString();
  527. string lock_type_desc = this.comboBox5.Text.ToString();
  528. string heat_no = textBox1.Text.ToString();
  529. CoreClientParam ccp = new CoreClientParam();
  530. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  531. if (String.IsNullOrEmpty(judge_type))
  532. {
  533. ccp.MethodName = "getInformationH";
  534. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline,lock_type_desc,heat_no,"1" };
  535. }
  536. else
  537. {
  538. ccp.MethodName = "getInformation2H";
  539. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline, judge_type,lock_type_desc,heat_no,"1" };
  540. }
  541. ccp.SourceDataTable = this.dataSet1.Tables[0];
  542. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  543. ccp = new CoreClientParam();
  544. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  545. ccp.MethodName = "findFlawDataB";
  546. ccp.ServerParams = new object[] { prodline };
  547. ccp.SourceDataTable = this.dataSet8.Tables[0];
  548. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  549. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  550. }
  551. catch (Exception ex)
  552. {
  553. System.Diagnostics.Debug.WriteLine(ex.ToString());
  554. MessageBox.Show("系统出错,请联系管理人员", "警告");
  555. }
  556. }
  557. private void DoQueryRe()
  558. {
  559. try
  560. {
  561. this.dataSet2.Clear();
  562. string ebatchno = "";
  563. string sbatchno = BatchNo.Text.Trim();
  564. if (BatchNo1.Text.ToString() == "")
  565. {
  566. ebatchno = this.BatchNo.Text.Trim();
  567. }
  568. else
  569. {
  570. ebatchno = BatchNo1.Text.Trim();
  571. }
  572. string orderno = this.OrderNo.Text.Trim();
  573. string psc = this.PscDesc.Text.Trim();
  574. string prodline = this.comboBox3.Text.ToString();
  575. string lock_type_desc = this.comboBox5.Text.ToString();
  576. string heat_no = textBox1.Text.ToString();
  577. CoreClientParam ccp = new CoreClientParam();
  578. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  579. if (String.IsNullOrEmpty(judge_type))
  580. {
  581. ccp.MethodName = "getAbnormalRecordInfoH";
  582. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline,lock_type_desc,heat_no,"1" };
  583. }
  584. else
  585. {
  586. ccp.MethodName = "getAbnormalRecordInfo2H";
  587. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "1", prodline, judge_type,lock_type_desc,heat_no,"1" };
  588. }
  589. ccp.SourceDataTable = this.dataSet2.Tables[0];
  590. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  591. foreach (UltraGridRow ugrs in this.ultraGrid2.Rows)
  592. {
  593. if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样"))
  594. {
  595. ugrs.Appearance.BackColor = Color.Pink;
  596. }
  597. }
  598. }
  599. catch (Exception ex)
  600. {
  601. System.Diagnostics.Debug.WriteLine(ex.ToString());
  602. MessageBox.Show("系统出错,请联系管理人员", "警告");
  603. }
  604. }
  605. private void label1_Click(object sender, EventArgs e)
  606. {
  607. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  608. if (ugr == null)
  609. return;
  610. string material_no = ugr.Cells["MATERIAL_NO"].Text.ToString();
  611. string std_code = ugr.Cells["STD_CODE"].Text.ToString();
  612. string steel_code = ugr.Cells["STEEL_CODE"].Text.ToString();
  613. string delivery_state_code = ugr.Cells["DELIVERY_STATE_DESC"].Text.ToString();
  614. string thick = ugr.Cells["THICK"].Text.ToString();
  615. string PSC = ugr.Cells["PSC"].Text.ToString();
  616. string WIDTH = ugr.Cells["WIDTH"].Text.ToString();
  617. string LENGTH = ugr.Cells["LENGTH"].Text.ToString();
  618. string PRODLINE = ugr.Cells["PLINE_CODE"].Text.ToString();
  619. QCM030709 dlg = new QCM030709();
  620. dlg.MATERIAL_NO = material_no;
  621. dlg.STD_CODE = std_code;
  622. dlg.STEELCODE = steel_code;
  623. dlg.DELIVERY_STATE_CODE = delivery_state_code;
  624. dlg.HEIGHT = thick;
  625. dlg.PSC = PSC;
  626. dlg.WIDTH = WIDTH;
  627. dlg.LENGTH = LENGTH;
  628. dlg.PROD_LINE = PRODLINE;
  629. dlg.ob = this.ob;
  630. dlg.ShowDialog();
  631. this.textBox3.Text = dlg.orderno;
  632. this.txt_gp_tradeno.Text = dlg.gp_tradeno;
  633. }
  634. private void panel4_Paint(object sender, PaintEventArgs e)
  635. {
  636. }
  637. private void panel2_Paint(object sender, PaintEventArgs e)
  638. {
  639. }
  640. private void DoQueryC()
  641. {
  642. try
  643. {
  644. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  645. if (ugr == null)
  646. return;
  647. this.dataSet4.Clear();
  648. string design_key = ugr.Cells["design_key"].Value.ToString();
  649. string smp_no = ugr.Cells["smp_no"].Value.ToString();
  650. CoreClientParam ccp = new CoreClientParam();
  651. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  652. ccp.MethodName = "GetChemeInfo";
  653. ccp.ServerParams = new object[] { design_key, smp_no};
  654. ccp.SourceDataTable = this.dataSet4.Tables[0];
  655. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  656. }
  657. catch (Exception ex)
  658. {
  659. System.Diagnostics.Debug.WriteLine(ex.ToString());
  660. MessageBox.Show("系统出错,请联系管理人员", "警告");
  661. }
  662. }
  663. private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  664. {
  665. UltraGridRow ugr = e.Cell.Row;
  666. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  667. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  668. {
  669. QCM030705 dlg = new QCM030705();
  670. dlg.lock_id = lock_id;
  671. dlg.ob = this.ob;
  672. dlg.ShowDialog();
  673. }
  674. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  675. {
  676. QCM030704 dlg = new QCM030704();
  677. dlg.lock_id = lock_id;
  678. dlg.ob = this.ob;
  679. dlg.ShowDialog();
  680. }
  681. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  682. {
  683. QCM030701 dlg = new QCM030701();
  684. dlg.lock_id = lock_id;
  685. dlg.ob = this.ob;
  686. dlg.ShowDialog();
  687. }
  688. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  689. {
  690. QCM030702 dlg = new QCM030702();
  691. dlg.lock_id = lock_id;
  692. dlg.ob = this.ob;
  693. dlg.ShowDialog();
  694. }
  695. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  696. {
  697. QCM030703 dlg = new QCM030703();
  698. dlg.lock_id = lock_id;
  699. dlg.ob = this.ob;
  700. dlg.ShowDialog();
  701. }
  702. }
  703. public static bool SetUltraComboEditor(ref UltraComboEditor cbEdt, ref ValueList vlist, bool bNull)
  704. {
  705. if (cbEdt == null || vlist == null)
  706. return false;
  707. cbEdt.Items.Clear();
  708. if (bNull)
  709. cbEdt.Items.Add(null, "");
  710. for (int i = 0; i < vlist.ValueListItems.Count; i++)
  711. {
  712. try
  713. {
  714. cbEdt.Items.Add(vlist.ValueListItems[i].DataValue, vlist.ValueListItems[i].DisplayText);
  715. }
  716. catch { }
  717. }
  718. return true;
  719. }
  720. public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
  721. {
  722. if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
  723. return null;
  724. ArrayList alist = new ArrayList();
  725. ValueList vlist = new ValueList();
  726. for (int i = 0; i < table.Rows.Count; i++)
  727. {
  728. try
  729. {
  730. if (!alist.Contains(table.Rows[i][strKey]))
  731. {
  732. alist.Add(table.Rows[i][strKey]);
  733. vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
  734. }
  735. }
  736. catch { }
  737. }
  738. return vlist;
  739. }
  740. private void QCM030706_Load(object sender, EventArgs e)
  741. {
  742. this.comboBox3.SelectedIndex = 0;
  743. this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  744. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  745. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  746. judge_type = String.IsNullOrEmpty(this.CustomInfo) ? "" : this.CustomInfo;
  747. CoreClientParam ccp = new CoreClientParam();
  748. ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
  749. ccp.MethodName = "QueryMemo";
  750. ccp.ServerParams = new object[] { "ZHB" };
  751. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  752. DataTable table2 = ccp.SourceDataTable;
  753. ValueList valueList2 = GeneralValuelist(ref table2, "MEMO_CODE", "MEMO");
  754. ClsControlPack.SetUltraComboEditor(ref ultraComboEditor1, ref valueList2, false);
  755. }
  756. private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  757. {
  758. UltraGridRow ugr = e.Cell.Row;
  759. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  760. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  761. {
  762. QCM030705 dlg = new QCM030705();
  763. dlg.lock_id = lock_id;
  764. dlg.ob = this.ob;
  765. dlg.ShowDialog();
  766. }
  767. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  768. {
  769. QCM030704 dlg = new QCM030704();
  770. dlg.lock_id = lock_id;
  771. dlg.ob = this.ob;
  772. dlg.ShowDialog();
  773. }
  774. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  775. {
  776. QCM030701 dlg = new QCM030701();
  777. dlg.lock_id = lock_id;
  778. dlg.ob = this.ob;
  779. dlg.ShowDialog();
  780. }
  781. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  782. {
  783. QCM030702 dlg = new QCM030702();
  784. dlg.lock_id = lock_id;
  785. dlg.ob = this.ob;
  786. dlg.ShowDialog();
  787. }
  788. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  789. {
  790. QCM030703 dlg = new QCM030703();
  791. dlg.lock_id = lock_id;
  792. dlg.ob = this.ob;
  793. dlg.ShowDialog();
  794. }
  795. }
  796. private void ultraTabControl1_Click(object sender, EventArgs e)
  797. {
  798. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  799. {
  800. this.label9.Text = "处置时间";
  801. }
  802. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  803. {
  804. this.label9.Text = "封锁时间";
  805. }
  806. }
  807. private void DoExport()
  808. {
  809. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  810. {
  811. try
  812. {
  813. if (this.ultraGrid9.Rows.Count == 0)
  814. {
  815. MessageBox.Show("没有可以导出的数据", "提示");
  816. return;
  817. }
  818. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  819. {
  820. string fName = this.saveFileDialog1.FileName;
  821. this.ultraGridExcelExporter1.Export(this.ultraGrid9, fName);
  822. Process.Start(fName);
  823. }
  824. }
  825. catch (Exception ex)
  826. {
  827. System.Diagnostics.Debug.WriteLine(ex.ToString());
  828. }
  829. }
  830. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  831. {
  832. try
  833. {
  834. if (this.ultraGrid2.Rows.Count == 0)
  835. {
  836. MessageBox.Show("没有可以导出的数据", "提示");
  837. return;
  838. }
  839. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  840. {
  841. string fName = this.saveFileDialog1.FileName;
  842. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  843. Process.Start(fName);
  844. }
  845. }
  846. catch (Exception ex)
  847. {
  848. System.Diagnostics.Debug.WriteLine(ex.ToString());
  849. }
  850. }
  851. }
  852. private void label11_Click(object sender, EventArgs e)
  853. {
  854. //获取勾选的批次
  855. ultraGrid9.UpdateData();
  856. DataRow[] rows = dataTable1.Copy().Select("CHECK = 'True'");
  857. if (this.ultraGrid9.Rows.Count == 0 || rows.Length == 0)
  858. {
  859. return;
  860. }
  861. DataRow[] rows2 = rows.CopyToDataTable().Select("BATCH_NO = '" + rows[0]["BATCH_NO"].ToString() + "'");
  862. if (rows2.Length != rows.Length)
  863. {
  864. MessageBox.Show("选择了多个批次信息!");
  865. return;
  866. }
  867. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  868. {
  869. if (ugr.Cells["BATCH_NO"].Text.ToString() == rows[0]["BATCH_NO"].ToString())
  870. {
  871. ugr.Cells["CHECK"].Value = "True";
  872. }
  873. }
  874. }
  875. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  876. {
  877. foreach (UltraGridRow ugr in this.ultraGrid9.Rows.Where(p => p.IsFilteredOut == false).ToList())
  878. {
  879. if (checkBox2.Checked)
  880. {
  881. ugr.Cells["CHECK"].Value = "True";
  882. }
  883. else
  884. {
  885. ugr.Cells["CHECK"].Value = "False";
  886. }
  887. }
  888. }
  889. }
  890. }