QCM0307.cs 41 KB

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