523791c171128790fc3e73fc847c140d880a3935.svn-base 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  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 QCM030711 : FrmBase
  19. {
  20. private string judge_type = "";//用于区分1检测中心和2轧钢厂
  21. public QCM030711()
  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 CancelFy()
  53. {
  54. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  55. if (ugr == null)
  56. {
  57. MessageBox.Show("请选择数据!");
  58. return;
  59. }
  60. string batch_no = ugr.Cells["BATCH_NO"].Value.ToString();
  61. if (MessageBox.Show(this, "是否对" + batch_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 material_no = ugr.Cells["MATERIAL_NO"].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 = "CancelFy";
  81. ccp.ServerParams = new object[] { batch_no, material_no, 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 CancelFx()
  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 = "CancelFx";
  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 CancelPf()
  131. {
  132. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  133. if (ugr == null)
  134. {
  135. MessageBox.Show("请选择数据!");
  136. return;
  137. }
  138. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  139. if (MessageBox.Show(this, "是否对" + material_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 lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].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 = "CancelPf";
  159. ccp.ServerParams = new object[] { material_no, lock_type_code, 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 (textBox4.Text.ToString() == "")
  259. {
  260. MessageBox.Show("请选择改判订单!");
  261. return;
  262. }
  263. if (MessageBox.Show(this, "是否改判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  264. {
  265. return;
  266. }
  267. }
  268. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  269. {
  270. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  271. {
  272. ArrayList al = new ArrayList();
  273. if (comboBox1.Text.Trim().ToString() != "改判")
  274. {
  275. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  276. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  277. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  278. string prodline = ugr.Cells["PLINE_CODE"].Value.ToString();
  279. string unlock_type_code = "";
  280. if (lock_type_code == "C" || lock_type_code == "P")
  281. {
  282. if (comboBox1.Text.Trim().ToString() == "放行")
  283. {
  284. unlock_type_code = "0";
  285. }
  286. else if (comboBox1.Text.Trim().ToString() == "复样")
  287. {
  288. unlock_type_code = "1";
  289. }
  290. else if (comboBox1.Text.Trim().ToString() == "判次")
  291. {
  292. unlock_type_code = "4";
  293. }
  294. else if (comboBox1.Text.Trim().ToString() == "判废")
  295. {
  296. unlock_type_code = "5";
  297. }
  298. else if (comboBox1.Text.Trim().ToString() == "脱单")
  299. {
  300. unlock_type_code = "6";
  301. }
  302. else if (comboBox1.Text.Trim().ToString() == "件件取样")
  303. {
  304. unlock_type_code = "8";
  305. }
  306. else if (comboBox1.Text.Trim().ToString() == "解除")
  307. {
  308. unlock_type_code = "9";
  309. }
  310. else if (comboBox1.Text.Trim().ToString() == "待判")
  311. {
  312. unlock_type_code = "10";
  313. }
  314. else if (comboBox1.Text.Trim().ToString() == "单吊材质判定")
  315. {
  316. unlock_type_code = "18";
  317. }
  318. string unlock_memo = this.ultraComboEditor1.Text.Trim().ToString();
  319. string bh_combobox = this.comboBox4.Text.Trim().ToString();
  320. if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C"))
  321. {
  322. if (string.IsNullOrEmpty(unlock_memo) || string.IsNullOrEmpty(bh_combobox))
  323. {
  324. this.alert("请选择审理人员及不合格品审理类型!");
  325. return;
  326. }
  327. }
  328. string username = this.UserInfo.GetUserName() +'Y';
  329. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  330. al.Add(material);
  331. al.Add(lock_seq);
  332. al.Add(lock_type_code);
  333. al.Add(unlock_type_code);
  334. al.Add(unlock_memo);
  335. al.Add(username);
  336. al.Add(lock_id);
  337. if (ultraCombo1.Text.ToString() == "")
  338. { al.Add(""); }
  339. else
  340. {
  341. al.Add(ultraCombo1.Value.ToString());
  342. }
  343. al.Add(prodline);
  344. al.Add(this.comboBox4.Text.ToString());
  345. if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C"))
  346. {
  347. lists.Add(ugr);
  348. String status = ugr.Cells["STATUS"].Text.Trim().ToString();
  349. if ("已申请".Equals(status))
  350. {
  351. continue;
  352. }
  353. CoreClientParam ccp = new CoreClientParam();
  354. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  355. ccp.MethodName = "LockingApply";
  356. ccp.ServerParams = new object[] { al };
  357. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  358. if (ccp.ReturnCode == -1)
  359. {
  360. return;
  361. }
  362. }
  363. else
  364. {
  365. CoreClientParam ccp = new CoreClientParam();
  366. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  367. ccp.MethodName = "doInformationSure";
  368. ccp.ServerParams = new object[] { al };
  369. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  370. if (ccp.ReturnCode == -1)
  371. {
  372. return;
  373. }
  374. lists.Add(ugr);
  375. }
  376. }
  377. else
  378. {
  379. if (comboBox1.Text.Trim().ToString() == "放行")
  380. {
  381. unlock_type_code = "0";
  382. }
  383. else if (comboBox1.Text.Trim().ToString() == "修磨")
  384. {
  385. unlock_type_code = "2";
  386. }
  387. else if (comboBox1.Text.Trim().ToString() == "改尺")
  388. {
  389. unlock_type_code = "3";
  390. }
  391. else if (comboBox1.Text.Trim().ToString() == "判次")
  392. {
  393. unlock_type_code = "4";
  394. }
  395. else if (comboBox1.Text.Trim().ToString() == "判废")
  396. {
  397. unlock_type_code = "5";
  398. }
  399. else if (comboBox1.Text.Trim().ToString() == "脱单")
  400. {
  401. unlock_type_code = "6";
  402. }
  403. else if (comboBox1.Text.Trim().ToString() == "解除")
  404. {
  405. unlock_type_code = "9";
  406. }
  407. else if (comboBox1.Text.Trim().ToString() == "待判")
  408. {
  409. unlock_type_code = "10";
  410. }
  411. string unlock_memo = ultraComboEditor1.Text.Trim().ToString();
  412. string username = this.UserInfo.GetUserName();
  413. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  414. al.Add(material);
  415. al.Add(lock_seq);
  416. al.Add(lock_type_code);
  417. al.Add(unlock_type_code);
  418. al.Add(unlock_memo);
  419. al.Add(username);
  420. al.Add(lock_id);
  421. if (ultraCombo1.Text.ToString() == "")
  422. { al.Add(""); }
  423. else
  424. {
  425. al.Add(ultraCombo1.Value.ToString());
  426. }
  427. al.Add(this.comboBox4.Text.ToString());
  428. CoreClientParam ccp = new CoreClientParam();
  429. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  430. ccp.MethodName = "doInformationSureH";
  431. ccp.ServerParams = new object[] { al };
  432. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  433. if (ccp.ReturnCode == -1)
  434. {
  435. return;
  436. }
  437. lists.Add(ugr);
  438. }
  439. }
  440. else
  441. {
  442. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  443. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  444. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  445. string unlock_type_code = "7";
  446. string unlock_memo = ultraComboEditor1.Text.Trim().ToString();
  447. string username = this.UserInfo.GetUserName();
  448. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  449. string batch_no = ugr.Cells["BATCH_NO"].Value.ToString();
  450. string gb_xb = "改判";
  451. al.Add(material);//0 子板号
  452. al.Add(lock_seq);//1
  453. al.Add(lock_type_code);//2
  454. al.Add(unlock_type_code);//3
  455. al.Add(unlock_memo);//4
  456. al.Add(username);//5 操作人
  457. al.Add(lock_id);//6
  458. al.Add(textBox4.Text.ToString());//7 改判订单号
  459. if (ultraCombo1.Text.ToString() == "")
  460. { al.Add(""); }
  461. else
  462. {
  463. al.Add(ultraCombo1.Value.ToString());//8
  464. }
  465. al.Add(txt_gp_tradeno.Text.ToString());//9 改判牌号
  466. al.Add(this.comboBox4.Text.ToString());//10 不合格类型
  467. al.Add(batch_no);//11
  468. al.Add(gb_xb);//12
  469. CoreClientParam ccp = new CoreClientParam();
  470. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  471. ccp.MethodName = "doInformationGpXB";//doInformationGp
  472. ccp.ServerParams = new object[] { al };
  473. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  474. if (ccp.ReturnCode == -1)
  475. {
  476. return;
  477. }
  478. lists.Add(ugr);
  479. }
  480. }
  481. }
  482. for (int i = 0; i < lists.Count; i++)
  483. {
  484. lists[i].Delete(false);
  485. }
  486. MessageBox.Show("异常处置成功!");
  487. }
  488. private void DoQuery()
  489. {
  490. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  491. {
  492. DoQueryMe();
  493. }
  494. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  495. {
  496. DoQueryRe();
  497. }
  498. }
  499. private void DoQueryMe()
  500. {
  501. try
  502. {
  503. this.dataSet1.Clear();
  504. this.dataSet8.Clear();
  505. string ebatchno = "";
  506. string sbatchno = BatchNo.Text.Trim();
  507. if (BatchNo1.Text.ToString() == "")
  508. {
  509. ebatchno = this.BatchNo.Text.Trim();
  510. }
  511. else
  512. {
  513. ebatchno = BatchNo1.Text.Trim();
  514. }
  515. string orderno = this.OrderNo.Text.Trim();
  516. string psc = this.PscDesc.Text.Trim();
  517. string prodline = this.comboBox3.Text.ToString();
  518. string lock_type_desc = this.comboBox2.Text.ToString();
  519. CoreClientParam ccp = new CoreClientParam();
  520. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  521. if (String.IsNullOrEmpty(judge_type))
  522. {
  523. ccp.MethodName = "getInformation";
  524. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "2", prodline,lock_type_desc };
  525. }
  526. else
  527. {
  528. ccp.MethodName = "getInformation2";
  529. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "2", prodline, judge_type,lock_type_desc };
  530. }
  531. ccp.SourceDataTable = this.dataSet1.Tables[0];
  532. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  533. ccp = new CoreClientParam();
  534. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  535. ccp.MethodName = "findFlawDataX";
  536. ccp.ServerParams = new object[] { prodline };
  537. ccp.SourceDataTable = this.dataSet8.Tables[0];
  538. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  539. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  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 ebatchno = "";
  553. string sbatchno = BatchNo.Text.Trim();
  554. if (BatchNo1.Text.ToString() == "")
  555. {
  556. ebatchno = this.BatchNo.Text.Trim();
  557. }
  558. else
  559. {
  560. ebatchno = BatchNo1.Text.Trim();
  561. }
  562. string orderno = this.OrderNo.Text.Trim();
  563. string psc = this.PscDesc.Text.Trim();
  564. string prodline = this.comboBox3.Text.ToString();
  565. string lock_type_desc = this.comboBox2.Text.ToString();
  566. CoreClientParam ccp = new CoreClientParam();
  567. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  568. if (String.IsNullOrEmpty(judge_type))
  569. {
  570. ccp.MethodName = "getAbnormalRecordInfo";
  571. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "2", prodline,lock_type_desc };
  572. }
  573. else
  574. {
  575. ccp.MethodName = "getAbnormalRecordInfo2";
  576. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "2", prodline, judge_type,lock_type_desc };
  577. }
  578. ccp.SourceDataTable = this.dataSet2.Tables[0];
  579. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  580. foreach (UltraGridRow ugrs in this.ultraGrid2.Rows)
  581. {
  582. if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样"))
  583. {
  584. ugrs.Appearance.BackColor = Color.Pink;
  585. }
  586. }
  587. }
  588. catch (Exception ex)
  589. {
  590. System.Diagnostics.Debug.WriteLine(ex.ToString());
  591. MessageBox.Show("系统出错,请联系管理人员", "警告");
  592. }
  593. }
  594. private void label1_Click(object sender, EventArgs e)
  595. {
  596. }
  597. private void panel4_Paint(object sender, PaintEventArgs e)
  598. {
  599. }
  600. private void panel2_Paint(object sender, PaintEventArgs e)
  601. {
  602. }
  603. private void DoQueryC()
  604. {
  605. try
  606. {
  607. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  608. if (ugr == null)
  609. return;
  610. this.dataSet4.Clear();
  611. string design_key = ugr.Cells["design_key"].Value.ToString();
  612. string smp_no = ugr.Cells["smp_no"].Value.ToString();
  613. CoreClientParam ccp = new CoreClientParam();
  614. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  615. ccp.MethodName = "GetChemeInfo";
  616. ccp.ServerParams = new object[] { design_key, smp_no };
  617. ccp.SourceDataTable = this.dataSet4.Tables[0];
  618. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  619. }
  620. catch (Exception ex)
  621. {
  622. System.Diagnostics.Debug.WriteLine(ex.ToString());
  623. MessageBox.Show("系统出错,请联系管理人员", "警告");
  624. }
  625. }
  626. private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  627. {
  628. UltraGridRow ugr = e.Cell.Row;
  629. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  630. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  631. {
  632. QCM030705 dlg = new QCM030705();
  633. dlg.lock_id = lock_id;
  634. dlg.ob = this.ob;
  635. dlg.ShowDialog();
  636. }
  637. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  638. {
  639. QCM030704 dlg = new QCM030704();
  640. dlg.lock_id = lock_id;
  641. dlg.ob = this.ob;
  642. dlg.ShowDialog();
  643. }
  644. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  645. {
  646. QCM030701 dlg = new QCM030701();
  647. dlg.lock_id = lock_id;
  648. dlg.ob = this.ob;
  649. dlg.ShowDialog();
  650. }
  651. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  652. {
  653. QCM030702 dlg = new QCM030702();
  654. dlg.lock_id = lock_id;
  655. dlg.ob = this.ob;
  656. dlg.ShowDialog();
  657. }
  658. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  659. {
  660. QCM030703 dlg = new QCM030703();
  661. dlg.lock_id = lock_id;
  662. dlg.ob = this.ob;
  663. dlg.ShowDialog();
  664. }
  665. }
  666. public static bool SetUltraComboEditor(ref UltraComboEditor cbEdt, ref ValueList vlist, bool bNull)
  667. {
  668. if (cbEdt == null || vlist == null)
  669. return false;
  670. cbEdt.Items.Clear();
  671. if (bNull)
  672. cbEdt.Items.Add(null, "");
  673. for (int i = 0; i < vlist.ValueListItems.Count; i++)
  674. {
  675. try
  676. {
  677. cbEdt.Items.Add(vlist.ValueListItems[i].DataValue, vlist.ValueListItems[i].DisplayText);
  678. }
  679. catch { }
  680. }
  681. return true;
  682. }
  683. public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
  684. {
  685. if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
  686. return null;
  687. ArrayList alist = new ArrayList();
  688. ValueList vlist = new ValueList();
  689. for (int i = 0; i < table.Rows.Count; i++)
  690. {
  691. try
  692. {
  693. if (!alist.Contains(table.Rows[i][strKey]))
  694. {
  695. alist.Add(table.Rows[i][strKey]);
  696. vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
  697. }
  698. }
  699. catch { }
  700. }
  701. return vlist;
  702. }
  703. private void QCM030706_Load(object sender, EventArgs e)
  704. {
  705. this.comboBox3.SelectedIndex = 0;
  706. this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  707. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  708. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  709. judge_type = String.IsNullOrEmpty(this.CustomInfo) ? "" : this.CustomInfo;
  710. string prodline = this.comboBox3.Text.ToString();
  711. CoreClientParam ccp = new CoreClientParam();
  712. ccp = new CoreClientParam();
  713. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  714. ccp.MethodName = "findFlawDataX";
  715. ccp.ServerParams = new object[] { prodline };
  716. ccp.SourceDataTable = this.dataSet8.Tables[0];
  717. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  718. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  719. ccp = new CoreClientParam();
  720. ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
  721. ccp.MethodName = "QueryMemo";
  722. ccp.ServerParams = new object[] { "XB1" };
  723. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  724. DataTable table2 = ccp.SourceDataTable;
  725. ValueList valueList2 = GeneralValuelist(ref table2, "MEMO_CODE", "MEMO");
  726. ClsControlPack.SetUltraComboEditor(ref ultraComboEditor1, ref valueList2, false);
  727. }
  728. private void button2_Click(object sender, EventArgs e)
  729. {
  730. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  731. if (ugr == null)
  732. return;
  733. string material_no = ugr.Cells["MATERIAL_NO"].Text.ToString();
  734. string std_code = ugr.Cells["STD_CODE"].Text.ToString();
  735. string steel_code = ugr.Cells["STEEL_CODE"].Text.ToString();
  736. string delivery_state_code = ugr.Cells["DELIVERY_STATE_DESC"].Text.ToString();
  737. string thick = ugr.Cells["THICK"].Text.ToString();
  738. string PSC = ugr.Cells["PSC"].Text.ToString();
  739. string WIDTH = ugr.Cells["WIDTH"].Text.ToString();
  740. string LENGTH = ugr.Cells["LENGTH"].Text.ToString();
  741. string PRODLINE = ugr.Cells["PLINE_CODE"].Text.ToString();
  742. QCM030709 dlg = new QCM030709();
  743. dlg.MATERIAL_NO = material_no;
  744. dlg.STD_CODE = std_code;
  745. dlg.STEELCODE = steel_code;
  746. dlg.DELIVERY_STATE_CODE = delivery_state_code;
  747. dlg.HEIGHT = thick;
  748. dlg.PSC = PSC;
  749. dlg.WIDTH = WIDTH;
  750. dlg.LENGTH = LENGTH;
  751. dlg.PROD_LINE = PRODLINE;
  752. dlg.ob = this.ob;
  753. dlg.ShowDialog();
  754. this.textBox4.Text = dlg.orderno;
  755. this.txt_gp_tradeno.Text = dlg.gp_tradeno;
  756. }
  757. private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  758. {
  759. UltraGridRow ugr = e.Cell.Row;
  760. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  761. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  762. {
  763. QCM030705 dlg = new QCM030705();
  764. dlg.lock_id = lock_id;
  765. dlg.ob = this.ob;
  766. dlg.ShowDialog();
  767. }
  768. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  769. {
  770. QCM030704 dlg = new QCM030704();
  771. dlg.lock_id = lock_id;
  772. dlg.ob = this.ob;
  773. dlg.ShowDialog();
  774. }
  775. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  776. {
  777. QCM030701 dlg = new QCM030701();
  778. dlg.lock_id = lock_id;
  779. dlg.ob = this.ob;
  780. dlg.ShowDialog();
  781. }
  782. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  783. {
  784. QCM030702 dlg = new QCM030702();
  785. dlg.lock_id = lock_id;
  786. dlg.ob = this.ob;
  787. dlg.ShowDialog();
  788. }
  789. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  790. {
  791. QCM030703 dlg = new QCM030703();
  792. dlg.lock_id = lock_id;
  793. dlg.ob = this.ob;
  794. dlg.ShowDialog();
  795. }
  796. }
  797. private void ultraTabControl1_Click(object sender, EventArgs e)
  798. {
  799. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  800. {
  801. this.label8.Text = "处置时间";
  802. }
  803. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  804. {
  805. this.label8.Text = "封锁时间";
  806. }
  807. }
  808. private void DoExport()
  809. {
  810. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  811. {
  812. try
  813. {
  814. if (this.ultraGrid9.Rows.Count == 0)
  815. {
  816. MessageBox.Show("没有可以导出的数据", "提示");
  817. return;
  818. }
  819. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  820. {
  821. string fName = this.saveFileDialog1.FileName;
  822. this.ultraGridExcelExporter1.Export(this.ultraGrid9, fName);
  823. Process.Start(fName);
  824. }
  825. }
  826. catch (Exception ex)
  827. {
  828. System.Diagnostics.Debug.WriteLine(ex.ToString());
  829. }
  830. }
  831. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  832. {
  833. try
  834. {
  835. if (this.ultraGrid2.Rows.Count == 0)
  836. {
  837. MessageBox.Show("没有可以导出的数据", "提示");
  838. return;
  839. }
  840. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  841. {
  842. string fName = this.saveFileDialog1.FileName;
  843. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  844. Process.Start(fName);
  845. }
  846. }
  847. catch (Exception ex)
  848. {
  849. System.Diagnostics.Debug.WriteLine(ex.ToString());
  850. }
  851. }
  852. }
  853. private void label11_Click(object sender, EventArgs e)
  854. {
  855. //获取勾选的批次
  856. ultraGrid9.UpdateData();
  857. DataRow[] rows = dataTable1.Copy().Select("CHECK = 'True'");
  858. if (this.ultraGrid9.Rows.Count == 0 || rows.Length == 0)
  859. {
  860. return;
  861. }
  862. DataRow[] rows2 = rows.CopyToDataTable().Select("BATCH_NO = '" + rows[0]["BATCH_NO"].ToString() + "'");
  863. if (rows2.Length != rows.Length)
  864. {
  865. MessageBox.Show("选择了多个批次信息!");
  866. return;
  867. }
  868. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  869. {
  870. if (ugr.Cells["BATCH_NO"].Text.ToString() == rows[0]["BATCH_NO"].ToString())
  871. {
  872. ugr.Cells["CHECK"].Value = "True";
  873. }
  874. }
  875. }
  876. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  877. {
  878. foreach (UltraGridRow ugr in this.ultraGrid9.Rows.Where(p => p.IsFilteredOut == false).ToList())
  879. {
  880. if (checkBox2.Checked)
  881. {
  882. ugr.Cells["CHECK"].Value = "True";
  883. }
  884. else
  885. {
  886. ugr.Cells["CHECK"].Value = "False";
  887. }
  888. }
  889. }
  890. }
  891. }