QCM030723.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  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 QCM030723 : FrmBase
  19. {
  20. private string judge_type = "";//用于区分1检测中心和2轧钢厂
  21. public QCM030723()
  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 (textBox3.Text.ToString() == "")
  168. {
  169. MessageBox.Show("请选择改判订单!");
  170. return;
  171. }
  172. if (MessageBox.Show(this, "是否改判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  173. {
  174. return;
  175. }
  176. }
  177. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  178. {
  179. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  180. {
  181. ArrayList al = new ArrayList();
  182. if (comboBox1.Text.Trim().ToString() != "改判")
  183. {
  184. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  185. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  186. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  187. string prodline = ugr.Cells["PLINE_CODE"].Value.ToString();
  188. string lock_memo = ugr.Cells["LOCK_MEMO"].Value.ToString();//封锁原因
  189. string unlock_type_code = "";
  190. if (lock_type_code == "C" || lock_type_code == "P")
  191. {
  192. if (comboBox1.Text.Trim().ToString() == "放行")
  193. {
  194. unlock_type_code = "0";
  195. }
  196. else if (comboBox1.Text.Trim().ToString() == "复样")
  197. {
  198. unlock_type_code = "1";
  199. }
  200. else if (comboBox1.Text.Trim().ToString() == "判次")
  201. {
  202. unlock_type_code = "4";
  203. }
  204. else if (comboBox1.Text.Trim().ToString() == "判废")
  205. {
  206. unlock_type_code = "5";
  207. }
  208. else if (comboBox1.Text.Trim().ToString() == "脱单")
  209. {
  210. unlock_type_code = "6";
  211. }
  212. else if (comboBox1.Text.Trim().ToString() == "件件取样")
  213. {
  214. unlock_type_code = "8";
  215. }
  216. else if (comboBox1.Text.Trim().ToString() == "解除")
  217. {
  218. unlock_type_code = "9";
  219. }
  220. else if (comboBox1.Text.Trim().ToString() == "待判")
  221. {
  222. unlock_type_code = "10";
  223. }
  224. string unlock_memo = ultraComboEditor1.Text.Trim().ToString();
  225. string bh_combobox = this.comboBox4.Text.Trim().ToString();
  226. if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P" || lock_type_code == "C"))
  227. {
  228. if (string.IsNullOrEmpty(unlock_memo) || string.IsNullOrEmpty(bh_combobox))
  229. {
  230. this.alert("请选择审理人员及不合格品审理类型!");
  231. return;
  232. }
  233. }
  234. string username = this.UserInfo.GetUserName() + 'Y';
  235. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  236. al.Add(material);
  237. al.Add(lock_seq);
  238. al.Add(lock_type_code);
  239. al.Add(unlock_type_code);
  240. al.Add(unlock_memo);
  241. al.Add(username);
  242. al.Add(lock_id);
  243. if (ultraCombo1.Text.ToString() == "")
  244. { al.Add(""); }
  245. else
  246. {
  247. al.Add(ultraCombo1.Value.ToString());
  248. }
  249. al.Add(prodline);
  250. al.Add(this.comboBox4.Text.ToString());
  251. if (comboBox1.Text.Trim().ToString() == "放行" && lock_type_code == "P" &&
  252. prodline.Equals("YT1") && lock_memo.Contains("粗糙度"))
  253. {
  254. CoreClientParam ccp = new CoreClientParam();
  255. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  256. ccp.MethodName = "doInformationSure";
  257. ccp.ServerParams = new object[] { al };
  258. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  259. if (ccp.ReturnCode == -1)
  260. {
  261. return;
  262. }
  263. lists.Add(ugr);
  264. }else if (comboBox1.Text.Trim().ToString() == "放行" && (lock_type_code == "P"|| lock_type_code == "C"))
  265. {
  266. lists.Add(ugr);
  267. String status = ugr.Cells["STATUS"].Text.Trim().ToString();
  268. if ("已申请".Equals(status))
  269. {
  270. continue;
  271. }
  272. CoreClientParam ccp = new CoreClientParam();
  273. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  274. ccp.MethodName = "LockingApply";
  275. ccp.ServerParams = new object[] { al };
  276. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  277. if (ccp.ReturnCode == -1)
  278. {
  279. return;
  280. }
  281. }
  282. else
  283. {
  284. CoreClientParam ccp = new CoreClientParam();
  285. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  286. ccp.MethodName = "doInformationSure";
  287. ccp.ServerParams = new object[] { al };
  288. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  289. if (ccp.ReturnCode == -1)
  290. {
  291. return;
  292. }
  293. lists.Add(ugr);
  294. }
  295. }
  296. else
  297. {
  298. if (comboBox1.Text.Trim().ToString() == "放行")
  299. {
  300. unlock_type_code = "0";
  301. }
  302. else if (comboBox1.Text.Trim().ToString() == "修磨")
  303. {
  304. unlock_type_code = "2";
  305. }
  306. else if (comboBox1.Text.Trim().ToString() == "改尺")
  307. {
  308. unlock_type_code = "3";
  309. }
  310. else if (comboBox1.Text.Trim().ToString() == "判次")
  311. {
  312. unlock_type_code = "4";
  313. }
  314. else if (comboBox1.Text.Trim().ToString() == "判废")
  315. {
  316. unlock_type_code = "5";
  317. }
  318. else if (comboBox1.Text.Trim().ToString() == "脱单")
  319. {
  320. unlock_type_code = "6";
  321. }
  322. else if (comboBox1.Text.Trim().ToString() == "解除")
  323. {
  324. unlock_type_code = "9";
  325. }
  326. else if (comboBox1.Text.Trim().ToString() == "待判")
  327. {
  328. unlock_type_code = "10";
  329. }
  330. string unlock_memo = this.ultraComboEditor1.Text.Trim().ToString();
  331. string username = this.UserInfo.GetUserName();
  332. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  333. al.Add(material);
  334. al.Add(lock_seq);
  335. al.Add(lock_type_code);
  336. al.Add(unlock_type_code);
  337. al.Add(unlock_memo);
  338. al.Add(username);
  339. al.Add(lock_id);
  340. if (ultraCombo1.Text.ToString() == "")
  341. { al.Add(""); }
  342. else
  343. {
  344. al.Add(ultraCombo1.Value.ToString());
  345. }
  346. al.Add(this.comboBox4.Text.ToString());
  347. CoreClientParam ccp = new CoreClientParam();
  348. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  349. ccp.MethodName = "doInformationSureH";
  350. ccp.ServerParams = new object[] { al };
  351. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  352. if (ccp.ReturnCode == -1)
  353. {
  354. return;
  355. }
  356. lists.Add(ugr);
  357. }
  358. }
  359. else
  360. {
  361. string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
  362. string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
  363. string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
  364. string unlock_type_code = "7";
  365. string unlock_memo = ultraComboEditor1.Text.Trim().ToString();
  366. string username = this.UserInfo.GetUserName();
  367. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  368. al.Add(material);
  369. al.Add(lock_seq);
  370. al.Add(lock_type_code);
  371. al.Add(unlock_type_code);
  372. al.Add(unlock_memo);
  373. al.Add(username);
  374. al.Add(lock_id);
  375. al.Add(textBox3.Text.ToString());
  376. if (ultraCombo1.Text.ToString() == "")
  377. { al.Add(""); }
  378. else
  379. {
  380. al.Add(ultraCombo1.Value.ToString());
  381. }
  382. al.Add(txt_gp_tradeno.Text.ToString());
  383. al.Add(this.comboBox4.Text.ToString());
  384. CoreClientParam ccp = new CoreClientParam();
  385. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  386. ccp.MethodName = "doInformationGp";
  387. ccp.ServerParams = new object[] { al };
  388. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  389. if (ccp.ReturnCode == -1)
  390. {
  391. return;
  392. }
  393. lists.Add(ugr);
  394. }
  395. }
  396. }
  397. for (int i = 0; i < lists.Count; i++)
  398. {
  399. lists[i].Delete(false);
  400. }
  401. MessageBox.Show("异常处置成功!");
  402. }
  403. private void DoQuery()
  404. {
  405. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  406. {
  407. DoQueryMe();
  408. }
  409. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  410. {
  411. DoQueryRe();
  412. }
  413. }
  414. private void DoQueryMe()
  415. {
  416. try
  417. {
  418. this.dataSet1.Clear();
  419. this.dataSet8.Clear();
  420. string ebatchno = comboBox5.Text.Trim().ToString();
  421. string sbatchno = BatchNo.Text.Trim();
  422. string orderno = this.OrderNo.Text.Trim();
  423. string psc = this.PscDesc.Text.Trim();
  424. string prodline = this.comboBox3.Text.ToString();
  425. string lock_type_desc = this.comboBox2.Text.ToString();
  426. CoreClientParam ccp = new CoreClientParam();
  427. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  428. if (String.IsNullOrEmpty(judge_type))
  429. {
  430. ccp.MethodName = "getInformationJ";
  431. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "5", prodline, lock_type_desc };
  432. }
  433. else
  434. {
  435. ccp.MethodName = "getInformation2J";
  436. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "5", prodline, judge_type, lock_type_desc };
  437. }
  438. ccp.SourceDataTable = this.dataSet1.Tables[0];
  439. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  440. ccp = new CoreClientParam();
  441. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  442. ccp.MethodName = "findFlawDataJ";
  443. ccp.ServerParams = new object[] { prodline };
  444. ccp.SourceDataTable = this.dataSet8.Tables[0];
  445. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  446. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  447. }
  448. catch (Exception ex)
  449. {
  450. System.Diagnostics.Debug.WriteLine(ex.ToString());
  451. MessageBox.Show("系统出错,请联系管理人员", "警告");
  452. }
  453. }
  454. private void DoQueryRe()
  455. {
  456. try
  457. {
  458. this.dataSet2.Clear();
  459. string ebatchno = comboBox5.Text.Trim().ToString();
  460. string sbatchno = BatchNo.Text.Trim();
  461. string orderno = this.OrderNo.Text.Trim();
  462. string psc = this.PscDesc.Text.Trim();
  463. string prodline = this.comboBox3.Text.ToString();
  464. string lock_type_desc = this.comboBox2.Text.ToString();
  465. CoreClientParam ccp = new CoreClientParam();
  466. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  467. if (String.IsNullOrEmpty(judge_type))
  468. {
  469. ccp.MethodName = "getAbnormalRecordInfoJ";
  470. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "5", prodline,lock_type_desc };
  471. }
  472. else
  473. {
  474. ccp.MethodName = "getAbnormalRecordInfo2J";
  475. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), sbatchno, ebatchno, orderno, psc, "5", prodline, judge_type, lock_type_desc };
  476. }
  477. ccp.SourceDataTable = this.dataSet2.Tables[0];
  478. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  479. foreach (UltraGridRow ugrs in this.ultraGrid2.Rows)
  480. {
  481. if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样"))
  482. {
  483. ugrs.Appearance.BackColor = Color.Pink;
  484. }
  485. }
  486. }
  487. catch (Exception ex)
  488. {
  489. System.Diagnostics.Debug.WriteLine(ex.ToString());
  490. MessageBox.Show("系统出错,请联系管理人员", "警告");
  491. }
  492. }
  493. private void label1_Click(object sender, EventArgs e)
  494. {
  495. }
  496. private void panel4_Paint(object sender, PaintEventArgs e)
  497. {
  498. }
  499. private void panel2_Paint(object sender, PaintEventArgs e)
  500. {
  501. }
  502. private void DoQueryC()
  503. {
  504. try
  505. {
  506. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  507. if (ugr == null)
  508. return;
  509. this.dataSet4.Clear();
  510. string design_key = ugr.Cells["design_key"].Value.ToString();
  511. string smp_no = ugr.Cells["smp_no"].Value.ToString();
  512. CoreClientParam ccp = new CoreClientParam();
  513. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  514. ccp.MethodName = "GetChemeInfo";
  515. ccp.ServerParams = new object[] { design_key, smp_no};
  516. ccp.SourceDataTable = this.dataSet4.Tables[0];
  517. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  518. }
  519. catch (Exception ex)
  520. {
  521. System.Diagnostics.Debug.WriteLine(ex.ToString());
  522. MessageBox.Show("系统出错,请联系管理人员", "警告");
  523. }
  524. }
  525. private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  526. {
  527. UltraGridRow ugr = e.Cell.Row;
  528. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  529. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  530. {
  531. QCM030705 dlg = new QCM030705();
  532. dlg.lock_id = lock_id;
  533. dlg.ob = this.ob;
  534. dlg.ShowDialog();
  535. }
  536. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
  537. {
  538. QCM030704 dlg = new QCM030704();
  539. dlg.lock_id = lock_id;
  540. dlg.ob = this.ob;
  541. dlg.ShowDialog();
  542. }
  543. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  544. {
  545. QCM030701 dlg = new QCM030701();
  546. dlg.lock_id = lock_id;
  547. dlg.ob = this.ob;
  548. dlg.ShowDialog();
  549. }
  550. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  551. {
  552. QCM030702 dlg = new QCM030702();
  553. dlg.lock_id = lock_id;
  554. dlg.ob = this.ob;
  555. dlg.ShowDialog();
  556. }
  557. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  558. {
  559. QCM030716 dlg = new QCM030716();
  560. dlg.lock_id = lock_id;
  561. dlg.ob = this.ob;
  562. dlg.ShowDialog();
  563. }
  564. }
  565. private void button1_Click(object sender, EventArgs e)
  566. {
  567. UltraGridRow ugr = this.ultraGrid9.ActiveRow;
  568. if (ugr == null)
  569. return;
  570. string material_no = ugr.Cells["MATERIAL_NO"].Text.ToString();
  571. string std_code = ugr.Cells["STD_CODE"].Text.ToString();
  572. string steel_code = ugr.Cells["STEEL_CODE"].Text.ToString();
  573. string delivery_state_code = ugr.Cells["DELIVERY_STATE_DESC"].Text.ToString();
  574. string thick = ugr.Cells["THICK"].Text.ToString();
  575. string PSC = ugr.Cells["PSC"].Text.ToString();
  576. string WIDTH = ugr.Cells["WIDTH"].Text.ToString();
  577. string LENGTH = ugr.Cells["LENGTH"].Text.ToString();
  578. string PRODLINE = ugr.Cells["PLINE_CODE"].Text.ToString();
  579. QCM030709 dlg = new QCM030709();
  580. dlg.MATERIAL_NO = material_no;
  581. dlg.STD_CODE = std_code;
  582. dlg.STEELCODE = steel_code;
  583. dlg.DELIVERY_STATE_CODE = delivery_state_code;
  584. dlg.HEIGHT = thick;
  585. dlg.PSC = PSC;
  586. dlg.WIDTH = WIDTH;
  587. dlg.LENGTH = LENGTH;
  588. dlg.PROD_LINE = PRODLINE;
  589. dlg.ob = this.ob;
  590. dlg.ShowDialog();
  591. this.textBox3.Text = dlg.orderno;
  592. this.txt_gp_tradeno.Text = dlg.gp_tradeno;
  593. }
  594. public static bool SetUltraComboEditor(ref UltraComboEditor cbEdt, ref ValueList vlist, bool bNull)
  595. {
  596. if (cbEdt == null || vlist == null)
  597. return false;
  598. cbEdt.Items.Clear();
  599. if (bNull)
  600. cbEdt.Items.Add(null, "");
  601. for (int i = 0; i < vlist.ValueListItems.Count; i++)
  602. {
  603. try
  604. {
  605. cbEdt.Items.Add(vlist.ValueListItems[i].DataValue, vlist.ValueListItems[i].DisplayText);
  606. }
  607. catch { }
  608. }
  609. return true;
  610. }
  611. public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
  612. {
  613. if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
  614. return null;
  615. ArrayList alist = new ArrayList();
  616. ValueList vlist = new ValueList();
  617. for (int i = 0; i < table.Rows.Count; i++)
  618. {
  619. try
  620. {
  621. if (!alist.Contains(table.Rows[i][strKey]))
  622. {
  623. alist.Add(table.Rows[i][strKey]);
  624. vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
  625. }
  626. }
  627. catch { }
  628. }
  629. return vlist;
  630. }
  631. private void QCM0307_Load(object sender, EventArgs e)
  632. {
  633. this.comboBox3.SelectedIndex = 0;
  634. this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  635. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  636. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  637. judge_type = String.IsNullOrEmpty(this.CustomInfo) ? "" : this.CustomInfo;
  638. CoreClientParam ccp = new CoreClientParam();
  639. ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
  640. ccp.MethodName = "QueryMemo";
  641. ccp.ServerParams = new object[] { "JB1" };
  642. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  643. DataTable table2 = ccp.SourceDataTable;
  644. ValueList valueList2 = GeneralValuelist(ref table2, "MEMO_CODE", "MEMO");
  645. ClsControlPack.SetUltraComboEditor(ref ultraComboEditor1, ref valueList2, false);
  646. }
  647. private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
  648. {
  649. UltraGridRow ugr = e.Cell.Row;
  650. string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
  651. if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
  652. {
  653. QCM030705 dlg = new QCM030705();
  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() == "D")
  659. {
  660. QCM030704 dlg = new QCM030704();
  661. dlg.lock_id = lock_id;
  662. dlg.ob = this.ob;
  663. dlg.ShowDialog();
  664. }
  665. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
  666. {
  667. QCM030701 dlg = new QCM030701();
  668. dlg.lock_id = lock_id;
  669. dlg.ob = this.ob;
  670. dlg.ShowDialog();
  671. }
  672. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
  673. {
  674. QCM030702 dlg = new QCM030702();
  675. dlg.lock_id = lock_id;
  676. dlg.ob = this.ob;
  677. dlg.ShowDialog();
  678. }
  679. else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
  680. {
  681. QCM030703 dlg = new QCM030703();
  682. dlg.lock_id = lock_id;
  683. dlg.ob = this.ob;
  684. dlg.ShowDialog();
  685. }
  686. }
  687. private void ultraTabControl1_Click(object sender, EventArgs e)
  688. {
  689. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  690. {
  691. this.label9.Text = "处置时间";
  692. }
  693. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  694. {
  695. this.label9.Text = "封锁时间";
  696. }
  697. }
  698. private void DoExport()
  699. {
  700. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  701. {
  702. try
  703. {
  704. if (this.ultraGrid9.Rows.Count == 0)
  705. {
  706. MessageBox.Show("没有可以导出的数据", "提示");
  707. return;
  708. }
  709. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  710. {
  711. string fName = this.saveFileDialog1.FileName;
  712. this.ultraGridExcelExporter1.Export(this.ultraGrid9, fName);
  713. Process.Start(fName);
  714. }
  715. }
  716. catch (Exception ex)
  717. {
  718. System.Diagnostics.Debug.WriteLine(ex.ToString());
  719. }
  720. }
  721. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  722. {
  723. try
  724. {
  725. if (this.ultraGrid2.Rows.Count == 0)
  726. {
  727. MessageBox.Show("没有可以导出的数据", "提示");
  728. return;
  729. }
  730. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  731. {
  732. string fName = this.saveFileDialog1.FileName;
  733. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  734. Process.Start(fName);
  735. }
  736. }
  737. catch (Exception ex)
  738. {
  739. System.Diagnostics.Debug.WriteLine(ex.ToString());
  740. }
  741. }
  742. }
  743. private void label11_Click(object sender, EventArgs e)
  744. {
  745. //获取勾选的批次
  746. ultraGrid9.UpdateData();
  747. DataRow[] rows = dataTable1.Copy().Select("CHECK = 'True'");
  748. if (this.ultraGrid9.Rows.Count == 0 || rows.Length == 0)
  749. {
  750. return;
  751. }
  752. DataRow[] rows2 = rows.CopyToDataTable().Select("BATCH_NO = '" + rows[0]["BATCH_NO"].ToString() + "'");
  753. if (rows2.Length != rows.Length)
  754. {
  755. MessageBox.Show("选择了多个批次信息!");
  756. return;
  757. }
  758. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  759. {
  760. if (ugr.Cells["BATCH_NO"].Text.ToString() == rows[0]["BATCH_NO"].ToString())
  761. {
  762. ugr.Cells["CHECK"].Value = "True";
  763. }
  764. }
  765. }
  766. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  767. {
  768. foreach (UltraGridRow ugr in this.ultraGrid9.Rows.Where(p => p.IsFilteredOut == false).ToList())
  769. {
  770. if (checkBox2.Checked)
  771. {
  772. ugr.Cells["CHECK"].Value = "True";
  773. }
  774. else
  775. {
  776. ugr.Cells["CHECK"].Value = "False";
  777. }
  778. }
  779. }
  780. }
  781. }