QCM030506.cs 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  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 Infragistics.Win.UltraWinGrid;
  10. using Infragistics.Win;
  11. using System.Collections;
  12. using CoreFS.CA06;
  13. using System.Diagnostics;
  14. namespace Core.LZMes.Client.QCM
  15. {
  16. public partial class QCM030506 : FrmBase
  17. {
  18. public QCM030506()
  19. {
  20. InitializeComponent();
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Judge":
  30. Operate();
  31. break;
  32. case "FB":
  33. fb();
  34. break;
  35. case "Cancel_FB":
  36. cancel_fb();
  37. break;
  38. case "Exit":
  39. this.Close();
  40. break;
  41. case "Export":
  42. this.DoExport();
  43. break;
  44. }
  45. }
  46. private void DoQuery()
  47. {
  48. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  49. {
  50. DoQueryMe();
  51. }
  52. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  53. {
  54. DoQueryRe();
  55. }
  56. }
  57. private void DoQueryMe()
  58. {
  59. //查询探伤待检信息(轧批号、计划号)
  60. try
  61. {
  62. this.dataSet3.Clear();
  63. dataSet6.Clear();
  64. string starttime = "";
  65. string endtime = "";
  66. if (checkBox2.Checked)
  67. {
  68. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  69. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  70. }
  71. string sbatchno = "";
  72. string ebatchno = "";
  73. if (checkBox3.Checked)
  74. {
  75. sbatchno = this.textBox2.Text.Trim();
  76. if (textBox1.Text.ToString() == "")
  77. {
  78. ebatchno = this.textBox2.Text.Trim();
  79. }
  80. else
  81. {
  82. ebatchno = this.textBox1.Text.Trim();
  83. }
  84. }
  85. if (!checkBox2.Checked && !checkBox3.Checked)
  86. {
  87. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  88. return;
  89. }
  90. string orderno = this.textBox4.Text.Trim();// 订单号
  91. string psc = textBox3.Text.Trim(); //产品描述
  92. string prodline = comboBox3.Text.ToString();
  93. string isjudge = this.comboBox4.Text.ToString();
  94. CoreClientParam ccp = new CoreClientParam();
  95. string steelname = this.textBox7.Text.ToString();
  96. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  97. ccp.MethodName = "doQueryMaterialDetailsJ";
  98. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "B",prodline,isjudge };
  99. ccp.SourceDataTable = this.dataSet3.Tables[0];
  100. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  101. ccp = new CoreClientParam();
  102. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  103. ccp.MethodName = "findFlawDataJ";
  104. ccp.ServerParams = new object[] { prodline };
  105. ccp.SourceDataTable = this.dataSet6.Tables[0];
  106. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  107. ultraCombo1.DataSource = ccp.SourceDataTable;
  108. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  109. }
  110. catch (Exception ex)
  111. {
  112. System.Diagnostics.Debug.WriteLine(ex.ToString());
  113. MessageBox.Show("系统出错,请联系管理人员", "警告");
  114. }
  115. }
  116. private void DoQueryRe()
  117. {
  118. //查询判定记录
  119. try
  120. {
  121. this.dataSet2.Clear();
  122. string starttime = "";
  123. string endtime = "";
  124. if (checkBox2.Checked)
  125. {
  126. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  127. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  128. }
  129. string sbatchno = "";
  130. string ebatchno = "";
  131. if (checkBox3.Checked)
  132. {
  133. sbatchno = this.textBox2.Text.Trim();
  134. if (textBox1.Text.ToString() == "")
  135. {
  136. ebatchno = this.textBox2.Text.Trim();
  137. }
  138. else
  139. {
  140. ebatchno = this.textBox1.Text.Trim();
  141. }
  142. }
  143. if (!checkBox2.Checked && !checkBox3.Checked)
  144. {
  145. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  146. return;
  147. }
  148. string orderno = textBox4.Text.Trim();
  149. string psc = textBox3.Text.Trim();
  150. string prodline = comboBox3.Text.ToString();
  151. string steelname = this.textBox7.Text.ToString();
  152. CoreClientParam ccp = new CoreClientParam();
  153. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  154. ccp.MethodName = "GetSurfaceInfoJ";
  155. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc,prodline,steelname };
  156. ccp.SourceDataTable = this.dataSet2.Tables[0];
  157. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  158. }
  159. catch (Exception ex)
  160. {
  161. System.Diagnostics.Debug.WriteLine(ex.ToString());
  162. MessageBox.Show("系统出错,请联系管理人员", "警告");
  163. }
  164. }
  165. private void Operate()
  166. {
  167. string material_no = "";
  168. try
  169. {
  170. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  171. if (ugr == null)
  172. return;
  173. CoreClientParam ccp = new CoreClientParam();
  174. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  175. {
  176. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  177. {
  178. string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
  179. string username = this.UserInfo.GetUserName();
  180. string userorder = this.UserInfo.GetUserOrderText();
  181. string usergroup = this.UserInfo.GetUserGroupText();
  182. string flag = "";
  183. if(ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是")){
  184. flag = "1";
  185. }else{
  186. flag = "0";
  187. }
  188. ccp = new CoreClientParam();
  189. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  190. ccp.MethodName = "repairFlaw";
  191. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  192. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  193. }
  194. }
  195. this.dataSet4.Clear();
  196. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  197. ccp = new CoreClientParam();
  198. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  199. ccp.MethodName = "findNameByMN";
  200. ccp.ServerParams = new object[] { surface_id };
  201. ccp.SourceDataTable = this.dataSet4.Tables[0];
  202. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  203. }
  204. catch (Exception ex)
  205. {
  206. System.Diagnostics.Debug.WriteLine(ex.ToString());
  207. MessageBox.Show("系统出错,请联系管理人员", "警告");
  208. }
  209. }
  210. private void fb()
  211. {
  212. try
  213. {
  214. List<UltraGridRow> lists = new List<UltraGridRow>();
  215. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  216. {
  217. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  218. {
  219. CoreClientParam ccp = new CoreClientParam();
  220. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  221. ccp.MethodName = "coiljudge_status_call_commit";
  222. ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
  223. , ugr.Cells["MATERIAL_NO"].Value.ToString()
  224. , ""
  225. , ""
  226. , ""
  227. , ""
  228. , ""
  229. , "Y"
  230. , txt_fb_reason.Text};
  231. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  232. if (ccp.ReturnCode == -1)
  233. {
  234. return;
  235. }
  236. lists.Add(ugr);
  237. }
  238. }
  239. for (int i = 0; i < lists.Count; i++)
  240. {
  241. lists[i].Delete(false);
  242. }
  243. //DoQuery();
  244. MessageBox.Show("封闭成功!");
  245. }
  246. catch (Exception ex)
  247. {
  248. System.Diagnostics.Debug.WriteLine(ex.ToString());
  249. MessageBox.Show("系统出错,请联系管理人员", "警告");
  250. }
  251. }
  252. private void cancel_fb()
  253. {
  254. try
  255. {
  256. List<UltraGridRow> lists = new List<UltraGridRow>();
  257. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  258. {
  259. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  260. {
  261. CoreClientParam ccp = new CoreClientParam();
  262. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  263. ccp.MethodName = "coiljudge_status_call_commit";
  264. ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
  265. , ugr.Cells["MATERIAL_NO"].Value.ToString()
  266. , ""
  267. , ""
  268. , ""
  269. , ""
  270. , ""
  271. , "N"
  272. , txt_fb_reason.Text};
  273. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  274. if (ccp.ReturnCode == -1)
  275. {
  276. return;
  277. }
  278. lists.Add(ugr);
  279. }
  280. }
  281. for (int i = 0; i < lists.Count; i++)
  282. {
  283. lists[i].Delete(false);
  284. }
  285. //DoQuery();
  286. MessageBox.Show("解除封闭成功!");
  287. }
  288. catch (Exception ex)
  289. {
  290. System.Diagnostics.Debug.WriteLine(ex.ToString());
  291. MessageBox.Show("系统出错,请联系管理人员", "警告");
  292. }
  293. }
  294. private void label9_Click(object sender, EventArgs e)
  295. {
  296. try
  297. {
  298. List<UltraGridRow> lists = new List<UltraGridRow>();
  299. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  300. {
  301. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  302. {
  303. ArrayList list1 = new ArrayList();
  304. List<ArrayList> list2 = new List<ArrayList>();
  305. //if (comboBox1.Text.Trim() == "")
  306. //{
  307. // MessageBox.Show("请输入检验结果!");
  308. // return;
  309. //}
  310. if (comboBox2.Text.Trim() == "")
  311. {
  312. MessageBox.Show("请输入质量等级!");
  313. return;
  314. }
  315. string is_pass = "";
  316. string is_zl = "";
  317. if (comboBox1.Text.ToString() == "合格")
  318. {
  319. is_pass = "1";
  320. }
  321. else if (comboBox1.Text.ToString() == "不合格")
  322. {
  323. is_pass = "2";
  324. }
  325. else if (comboBox1.Text.ToString() == "待判")
  326. {
  327. is_pass = "0";
  328. }
  329. else
  330. {
  331. is_pass = "";
  332. }
  333. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  334. list1.Add(is_pass);//检验结果代码
  335. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  336. list1.Add(comboBox2.Text.Trim().ToString());//质量等级代码
  337. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  338. list1.Add(textBox5.Text.ToString().Trim());
  339. list1.Add(this.UserInfo.GetUserName());//操作人
  340. list1.Add(this.UserInfo.GetUserOrderText());//班次
  341. list1.Add(this.UserInfo.GetUserGroupText());//班组
  342. int count = 0;
  343. int i = 0;
  344. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  345. {
  346. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  347. {
  348. int j = 2;
  349. ArrayList list = new ArrayList();
  350. if (ugrs.Cells["QUEXIAN_TP"].Value.ToString() == "")
  351. {
  352. MessageBox.Show("请选择缺陷来源次!", "提示");
  353. return;
  354. }
  355. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  356. i++;
  357. list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
  358. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  359. {
  360. list.Add("1");
  361. j = j - 1;
  362. }
  363. else
  364. {
  365. list.Add(j);
  366. }
  367. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  368. {
  369. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  370. }
  371. else
  372. {
  373. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  374. }
  375. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  376. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  377. {
  378. MessageBox.Show("已选择的请录入缺陷信息!");
  379. return;
  380. }
  381. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  382. {
  383. list.Add("U");
  384. }
  385. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  386. {
  387. list.Add("D");
  388. }
  389. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  390. {
  391. list.Add("E");
  392. }
  393. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "钢卷侧面")
  394. {
  395. list.Add("A");
  396. }
  397. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上下表面都有,且不对称")
  398. {
  399. list.Add("N");
  400. }
  401. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上下表面都有,且对称")
  402. {
  403. list.Add("S");
  404. }
  405. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上凸下凹")
  406. {
  407. list.Add("T");
  408. }
  409. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上凹下凸")
  410. {
  411. list.Add("B");
  412. }
  413. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "已跟踪去重卷切除")
  414. {
  415. list.Add("C");
  416. }
  417. else
  418. {
  419. list.Add("");
  420. }
  421. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  422. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  423. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  424. {
  425. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  426. }
  427. else
  428. {
  429. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  430. }
  431. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  432. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  433. {
  434. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  435. }
  436. else
  437. {
  438. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  439. }
  440. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  441. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  442. {
  443. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  444. }
  445. else
  446. {
  447. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  448. }
  449. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  450. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  451. {
  452. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  453. }
  454. else
  455. {
  456. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  457. }
  458. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  459. //if (!IsNumberal(ugrs.Cells["FLAW_QUANTITY"].Text))
  460. //{
  461. // MessageBox.Show("数量请输入数字!");
  462. // return;
  463. //}
  464. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  465. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  466. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  467. {
  468. list.Add("0");
  469. }
  470. else
  471. {
  472. list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
  473. }
  474. list.Add(ugrs.Cells["QUEXIAN_TP"].Value.ToString());
  475. count++;
  476. j++;
  477. list2.Add(list);
  478. }
  479. }
  480. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  481. {
  482. MessageBox.Show("请录入缺陷信息并选择!");
  483. return;
  484. }
  485. if (i == 0 && comboBox1.Text.ToString() == "不合格")
  486. {
  487. MessageBox.Show("请录入主要缺陷!");
  488. return;
  489. }
  490. if (i > 1)
  491. {
  492. MessageBox.Show("请不要录入多条主要缺陷!");
  493. return;
  494. }
  495. CoreClientParam ccp = new CoreClientParam();
  496. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  497. ccp.MethodName = "doAddFlawL";
  498. ccp.ServerParams = new object[] { list2, list1 };
  499. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  500. if (ccp.ReturnCode == -1)
  501. {
  502. return;
  503. }
  504. lists.Add(ugr);
  505. }
  506. }
  507. for (int i = 0; i < lists.Count; i++)
  508. {
  509. lists[i].Delete(false);
  510. }
  511. //DoQuery();
  512. MessageBox.Show("登记成功!");
  513. }catch(Exception ex)
  514. {
  515. System.Diagnostics.Debug.WriteLine(ex.ToString());
  516. MessageBox.Show("系统出错,请联系管理人员", "警告");
  517. }
  518. }
  519. public static bool IsNumberal(string input)
  520. {
  521. bool flag = true;
  522. int count = 0;
  523. int count1 = 0;
  524. if (input.Length == 0)
  525. {
  526. flag = false;
  527. }
  528. else
  529. {
  530. char[] x = input.ToCharArray();
  531. for (int i = 0; i < input.Length; i++)
  532. {
  533. if (!char.IsNumber(x[i]) && x[i] != '.' && x[i] != '-')
  534. {
  535. flag = false; break;
  536. }
  537. if (x[i] == '.')
  538. {
  539. count++;
  540. if (i == 0 || i == input.Length - 1) flag = false;
  541. }
  542. if (x[i] == '-')
  543. {
  544. count1++;
  545. if (i > 1) flag = false;
  546. }
  547. }
  548. if (count > 1 || count1 > 1) flag = false;
  549. }
  550. return flag;
  551. }
  552. private void QCM0305_Load(object sender, EventArgs e)
  553. {
  554. this.comboBox3.SelectedIndex = 0;
  555. this.comboBox4.SelectedIndex = 0;
  556. string prodline = comboBox3.Text.ToString();
  557. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  558. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  559. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  560. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  561. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  562. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  563. ValueList vis_repair = new ValueList();
  564. vis_repair.ValueListItems.Add("0", "待修复");
  565. vis_repair.ValueListItems.Add("1", "已修复");
  566. this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
  567. ValueList vprimary_flag = new ValueList();
  568. vprimary_flag.ValueListItems.Add("1", "是");
  569. vprimary_flag.ValueListItems.Add("0", "否");
  570. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
  571. ValueList vFLAW_DESC = new ValueList();
  572. CoreClientParam ccp = new CoreClientParam();
  573. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  574. ccp.MethodName = "findJFlawArea";
  575. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  576. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  577. {
  578. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  579. }
  580. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
  581. ValueList vflaw_pos_desc = new ValueList();
  582. ccp = new CoreClientParam();
  583. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  584. ccp.MethodName = "findJFlawPosDesc";
  585. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  586. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  587. {
  588. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  589. }
  590. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
  591. ValueList vsflv = new ValueList();
  592. ccp = new CoreClientParam();
  593. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  594. ccp.MethodName = "findZlLevel";
  595. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  596. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  597. {
  598. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CD"].ToString());
  599. }
  600. this.comboBox2.DataSource = vsflv.ValueListItems;
  601. ValueList VFLAW_SIZE_DESC = new ValueList();
  602. ccp = new CoreClientParam();
  603. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  604. ccp.MethodName = "findJFlawSizeDesc";
  605. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  606. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  607. {
  608. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  609. }
  610. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  611. ValueList VFLAW_LV_DESC = new ValueList();
  612. ccp = new CoreClientParam();
  613. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  614. ccp.MethodName = "findJFlawLvDesc";
  615. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  616. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  617. {
  618. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  619. }
  620. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  621. ValueList VFLAW_DIR_DESC = new ValueList();
  622. ccp = new CoreClientParam();
  623. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  624. ccp.MethodName = "findJFlawDirDesc";
  625. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  626. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  627. {
  628. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  629. }
  630. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  631. //ccp = new CoreClientParam();
  632. //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  633. //ccp.MethodName = "findFlawDataJ";
  634. //ccp.ServerParams = new object[] {prodline };
  635. //ccp.SourceDataTable = this.dataSet6.Tables[0];
  636. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  637. ////ValueList VDEFECT_DESC = new ValueList();
  638. ////for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  639. ////{
  640. //// VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  641. ////}
  642. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  643. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = VDEFECT_DESC;
  644. //UltraCombo uc;
  645. //uc = new UltraCombo();
  646. //uc.BindingContext = this.BindingContext;
  647. //uc.DataSource = ccp.SourceDataTable;
  648. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = new BindableValueList(ccp.SourceDataTable, "", "DEFECT_NAME", "DEFECT_CODE", this.ultraGrid4);
  649. DoQuery();
  650. }
  651. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  652. {
  653. try
  654. {
  655. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  656. this.dataSet4.Clear();
  657. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  658. if (surface_id != "")
  659. {
  660. CoreClientParam ccp = new CoreClientParam();
  661. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  662. ccp.MethodName = "findNameByMN";
  663. ccp.ServerParams = new object[] { surface_id };
  664. ccp.SourceDataTable = this.dataSet4.Tables[0];
  665. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  666. }
  667. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  668. if (design_key != "")
  669. {
  670. CoreClientParam ccp = new CoreClientParam();
  671. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  672. ccp.MethodName = "GetMemo";
  673. ccp.ServerParams = new object[] { design_key };
  674. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  675. if (ccp.SourceDataTable.Rows.Count == 0)
  676. {
  677. this.textBox6.Text = "";
  678. }
  679. else
  680. {
  681. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  682. }
  683. }
  684. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  685. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  686. {
  687. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  688. {
  689. ugrs.Appearance.BackColor = Color.Pink;
  690. }
  691. }
  692. }
  693. catch (Exception ex)
  694. {
  695. System.Diagnostics.Debug.WriteLine(ex.ToString());
  696. MessageBox.Show("系统出错,请联系管理人员", "警告");
  697. }
  698. }
  699. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  700. {
  701. try
  702. {
  703. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  704. if (ugr == null)
  705. return;
  706. this.dataSet5.Clear();
  707. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  708. CoreClientParam ccp = new CoreClientParam();
  709. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  710. ccp.MethodName = "findNameByMN";
  711. ccp.ServerParams = new object[] { surface_id };
  712. ccp.SourceDataTable = this.dataSet5.Tables[0];
  713. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  714. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  715. {
  716. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  717. {
  718. ugrs.Appearance.BackColor = Color.Pink;
  719. }
  720. }
  721. }
  722. catch (Exception ex)
  723. {
  724. System.Diagnostics.Debug.WriteLine(ex.ToString());
  725. MessageBox.Show("系统出错,请联系管理人员", "警告");
  726. }
  727. }
  728. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  729. {
  730. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  731. {
  732. if (checkBox1.Checked)
  733. {
  734. ugr.Cells["CHECK"].Value = "True";
  735. }
  736. else
  737. {
  738. ugr.Cells["CHECK"].Value = "False";
  739. }
  740. }
  741. }
  742. private void ultraTabControl1_Click(object sender, EventArgs e)
  743. {
  744. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  745. {
  746. this.label11.Visible = false;
  747. this.comboBox4.Visible = false;
  748. this.label12.Text = "判定时间";
  749. }
  750. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  751. {
  752. this.label11.Visible = true;
  753. this.comboBox4.Visible = true;
  754. this.label12.Text = "生产时间";
  755. }
  756. }
  757. private void DoExport()
  758. {
  759. try
  760. {
  761. if (this.ultraGrid1.Rows.Count == 0)
  762. {
  763. MessageBox.Show("没有可以导出的数据", "提示");
  764. return;
  765. }
  766. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  767. {
  768. string fName = this.saveFileDialog1.FileName;
  769. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  770. Process.Start(fName);
  771. }
  772. }
  773. catch (Exception ex)
  774. {
  775. System.Diagnostics.Debug.WriteLine(ex.ToString());
  776. }
  777. }
  778. }
  779. }