QCM030502.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  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 QCM030502 : FrmBase
  17. {
  18. public QCM030502()
  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 "Exit":
  33. this.Close();
  34. break;
  35. case "Export":
  36. this.DoExport();
  37. break;
  38. }
  39. }
  40. private void DoQuery()
  41. {
  42. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  43. {
  44. DoQueryMe();
  45. }
  46. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  47. {
  48. DoQueryRe();
  49. }
  50. }
  51. private void DoQueryMe()
  52. {
  53. //查询探伤待检信息(轧批号、计划号)
  54. try
  55. {
  56. this.dataSet3.Clear();
  57. dataSet6.Clear();
  58. string starttime = "";
  59. string endtime = "";
  60. if (checkBox2.Checked)
  61. {
  62. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  63. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  64. }
  65. string sbatchno = "";
  66. string ebatchno = "";
  67. if (checkBox3.Checked)
  68. {
  69. sbatchno = this.textBox2.Text.Trim();
  70. if (textBox1.Text.ToString() == "")
  71. {
  72. ebatchno = this.textBox2.Text.Trim();
  73. }
  74. else
  75. {
  76. ebatchno = this.textBox1.Text.Trim();
  77. }
  78. }
  79. if (!checkBox2.Checked && !checkBox3.Checked)
  80. {
  81. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  82. return;
  83. }
  84. string orderno = this.textBox4.Text.Trim();// 订单号
  85. string psc = textBox3.Text.Trim(); //产品描述
  86. string prodline = this.comboBox3.Text.ToString();
  87. string isjudge = this.comboBox4.Text.ToString();
  88. CoreClientParam ccp = new CoreClientParam();
  89. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  90. ccp.MethodName = "doQueryMaterialDetailsX";
  91. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "B",prodline,isjudge };
  92. ccp.SourceDataTable = this.dataSet3.Tables[0];
  93. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  94. ccp = new CoreClientParam();
  95. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  96. ccp.MethodName = "findFlawDataX";
  97. ccp.ServerParams = new object[] { prodline };
  98. ccp.SourceDataTable = this.dataSet6.Tables[0];
  99. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  100. this.ultraCombo1.DataSource = ccp.SourceDataTable;
  101. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  102. }
  103. catch (Exception ex)
  104. {
  105. System.Diagnostics.Debug.WriteLine(ex.ToString());
  106. MessageBox.Show("系统出错,请联系管理人员", "警告");
  107. }
  108. }
  109. private void DoQueryRe()
  110. {
  111. //查询判定记录
  112. try
  113. {
  114. this.dataSet2.Clear();
  115. string starttime = "";
  116. string endtime = "";
  117. if (checkBox2.Checked)
  118. {
  119. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  120. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  121. }
  122. string sbatchno = "";
  123. string ebatchno = "";
  124. if (checkBox3.Checked)
  125. {
  126. sbatchno = this.textBox2.Text.Trim();
  127. if (textBox1.Text.ToString() == "")
  128. {
  129. ebatchno = this.textBox2.Text.Trim();
  130. }
  131. else
  132. {
  133. ebatchno = this.textBox1.Text.Trim();
  134. }
  135. }
  136. if (!checkBox2.Checked && !checkBox3.Checked)
  137. {
  138. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  139. return;
  140. }
  141. string orderno = textBox4.Text.Trim();
  142. string psc = textBox3.Text.Trim();
  143. string prodline = this.comboBox3.Text.ToString();
  144. CoreClientParam ccp = new CoreClientParam();
  145. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  146. ccp.MethodName = "GetSurfaceInfoX";
  147. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc,prodline };
  148. ccp.SourceDataTable = this.dataSet2.Tables[0];
  149. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  150. }
  151. catch (Exception ex)
  152. {
  153. System.Diagnostics.Debug.WriteLine(ex.ToString());
  154. MessageBox.Show("系统出错,请联系管理人员", "警告");
  155. }
  156. }
  157. private void Operate()
  158. {
  159. string material_no = "";
  160. try
  161. {
  162. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  163. if (ugr == null)
  164. return;
  165. CoreClientParam ccp = new CoreClientParam();
  166. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  167. {
  168. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  169. {
  170. string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
  171. string username = this.UserInfo.GetUserName();
  172. string userorder = this.UserInfo.GetUserOrderText();
  173. string usergroup = this.UserInfo.GetUserGroupText();
  174. string flag = "";
  175. if(ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  176. {
  177. flag = "1";
  178. }
  179. else
  180. {
  181. flag = "0";
  182. }
  183. ccp = new CoreClientParam();
  184. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  185. ccp.MethodName = "repairFlaw";
  186. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  187. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  188. }
  189. }
  190. this.dataSet4.Clear();
  191. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  192. ccp = new CoreClientParam();
  193. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  194. ccp.MethodName = "findNameByMN";
  195. ccp.ServerParams = new object[] { surface_id };
  196. ccp.SourceDataTable = this.dataSet4.Tables[0];
  197. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  198. }
  199. catch (Exception ex)
  200. {
  201. System.Diagnostics.Debug.WriteLine(ex.ToString());
  202. MessageBox.Show("系统出错,请联系管理人员", "警告");
  203. }
  204. }
  205. private void label9_Click(object sender, EventArgs e)
  206. {
  207. try
  208. {
  209. List<UltraGridRow> lists = new List<UltraGridRow>();
  210. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  211. {
  212. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  213. {
  214. ArrayList list1 = new ArrayList();
  215. List<ArrayList> list2 = new List<ArrayList>();
  216. if (comboBox1.Text.Trim() == "")
  217. {
  218. MessageBox.Show("请输入检验结果!");
  219. return;
  220. }
  221. if (comboBox2.Text.Trim() == "")
  222. {
  223. MessageBox.Show("请输入质量等级!");
  224. return;
  225. }
  226. string is_pass = "";
  227. string is_zl = "";
  228. if (comboBox1.Text.ToString() == "合格")
  229. {
  230. is_pass = "1";
  231. }
  232. else if (comboBox1.Text.ToString() == "不合格")
  233. {
  234. is_pass = "2";
  235. }
  236. else
  237. {
  238. is_pass = "0";
  239. }
  240. if (comboBox2.Text.ToString() == "正品")
  241. {
  242. is_zl = "512601";
  243. }
  244. else if (comboBox2.Text.ToString() == "次品")
  245. {
  246. is_zl = "512602";
  247. }
  248. else if (comboBox2.Text.ToString() == "废品")
  249. {
  250. is_zl = "512603";
  251. }
  252. else if (comboBox2.Text.ToString() == "协议品")
  253. {
  254. is_zl = "512604";
  255. }
  256. else if (comboBox2.Text.ToString() == "订单外")
  257. {
  258. is_zl = "512605";
  259. }
  260. else if (comboBox2.Text.ToString() == "待处理")
  261. {
  262. is_zl = "512606";
  263. }
  264. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  265. list1.Add(is_pass);//检验结果代码
  266. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  267. list1.Add(is_zl);//质量等级代码
  268. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  269. list1.Add(textBox5.Text.ToString().Trim());
  270. list1.Add(this.UserInfo.GetUserName());//操作人
  271. list1.Add(this.UserInfo.GetUserOrderText());//班次
  272. list1.Add(this.UserInfo.GetUserGroupText());//班组
  273. int count = 0;
  274. int i = 0;
  275. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  276. {
  277. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  278. {
  279. int j = 1;
  280. ArrayList list = new ArrayList();
  281. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1" || ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == ""
  282. || ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  283. {
  284. list.Add("1");
  285. }
  286. list.Add(j);
  287. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  288. {
  289. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  290. }
  291. else
  292. {
  293. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  294. }
  295. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  296. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  297. {
  298. MessageBox.Show("已选择的请录入缺陷信息!");
  299. return;
  300. }
  301. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  302. {
  303. list.Add("U");
  304. }
  305. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  306. {
  307. list.Add("D");
  308. }
  309. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  310. {
  311. list.Add("E");
  312. }
  313. else
  314. {
  315. list.Add("");
  316. }
  317. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  318. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  319. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  320. {
  321. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  322. }
  323. else
  324. {
  325. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  326. }
  327. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  328. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  329. {
  330. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  331. }
  332. else
  333. {
  334. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  335. }
  336. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  337. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  338. {
  339. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  340. }
  341. else
  342. {
  343. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  344. }
  345. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  346. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  347. {
  348. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  349. }
  350. else
  351. {
  352. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  353. }
  354. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  355. //if (ugrs.Cells["FLAW_QUANTITY"].Text == "")
  356. //{
  357. // MessageBox.Show("请输入数量!");
  358. // return;
  359. //}
  360. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  361. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  362. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  363. {
  364. list.Add("0");
  365. }
  366. else
  367. {
  368. list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
  369. }
  370. count++;
  371. j++;
  372. list2.Add(list);
  373. }
  374. }
  375. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  376. {
  377. MessageBox.Show("请录入缺陷信息并选择!");
  378. return;
  379. }
  380. CoreClientParam ccp = new CoreClientParam();
  381. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  382. ccp.MethodName = "doAddFlawX";
  383. ccp.ServerParams = new object[] { list2, list1 };
  384. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  385. if (ccp.ReturnCode == -1)
  386. {
  387. return;
  388. }
  389. lists.Add(ugr);
  390. }
  391. }
  392. for (int i = 0; i < lists.Count; i++)
  393. {
  394. lists[i].Delete(false);
  395. }
  396. // DoQuery();
  397. MessageBox.Show("登记成功!");
  398. }catch(Exception ex)
  399. {
  400. System.Diagnostics.Debug.WriteLine(ex.ToString());
  401. MessageBox.Show("系统出错,请联系管理人员", "警告");
  402. }
  403. }
  404. private void QCM0305_Load(object sender, EventArgs e)
  405. {
  406. this.comboBox3.SelectedIndex = 0;
  407. this.comboBox4.SelectedIndex = 0;
  408. string prodline = comboBox3.Text.ToString();
  409. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  410. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  411. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  412. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  413. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  414. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  415. ValueList vis_repair = new ValueList();
  416. vis_repair.ValueListItems.Add("0", "待修复");
  417. vis_repair.ValueListItems.Add("1", "已修复");
  418. this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
  419. ValueList vprimary_flag = new ValueList();
  420. vprimary_flag.ValueListItems.Add("1", "是");
  421. vprimary_flag.ValueListItems.Add("0", "否");
  422. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
  423. ValueList vFLAW_DESC = new ValueList();
  424. CoreClientParam ccp = new CoreClientParam();
  425. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  426. ccp.MethodName = "findFlawArea";
  427. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  428. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  429. {
  430. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  431. }
  432. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
  433. ValueList vsflv = new ValueList();
  434. ccp = new CoreClientParam();
  435. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  436. ccp.MethodName = "findSfLv";
  437. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  438. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  439. {
  440. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  441. }
  442. this.comboBox2.DataSource = vsflv.ValueListItems;
  443. ValueList vflaw_pos_desc = new ValueList();
  444. ccp = new CoreClientParam();
  445. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  446. ccp.MethodName = "findFlawPosDesc";
  447. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  448. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  449. {
  450. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  451. }
  452. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
  453. ValueList VFLAW_SIZE_DESC = new ValueList();
  454. ccp = new CoreClientParam();
  455. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  456. ccp.MethodName = "findFlawSizeDesc";
  457. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  458. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  459. {
  460. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  461. }
  462. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  463. ValueList VFLAW_LV_DESC = new ValueList();
  464. ccp = new CoreClientParam();
  465. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  466. ccp.MethodName = "findFlawLvDesc";
  467. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  468. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  469. {
  470. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  471. }
  472. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  473. ValueList VFLAW_DIR_DESC = new ValueList();
  474. ccp = new CoreClientParam();
  475. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  476. ccp.MethodName = "findFlawDirDesc";
  477. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  478. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  479. {
  480. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  481. }
  482. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  483. ccp = new CoreClientParam();
  484. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  485. ccp.MethodName = "findFlawDataX";
  486. ccp.ServerParams = new object[] { prodline };
  487. ccp.SourceDataTable = this.dataSet6.Tables[0];
  488. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  489. //ValueList VDEFECT_DESC = new ValueList();
  490. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  491. //{
  492. // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  493. //}
  494. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  495. ultraCombo1.DataSource = ccp.SourceDataTable;
  496. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  497. //DoQuery();
  498. }
  499. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  500. {
  501. try
  502. {
  503. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  504. this.dataSet4.Clear();
  505. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  506. if (surface_id != "")
  507. {
  508. CoreClientParam ccp = new CoreClientParam();
  509. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  510. ccp.MethodName = "findNameByMN";
  511. ccp.ServerParams = new object[] { surface_id };
  512. ccp.SourceDataTable = this.dataSet4.Tables[0];
  513. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  514. }
  515. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  516. if (design_key != "")
  517. {
  518. CoreClientParam ccp = new CoreClientParam();
  519. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  520. ccp.MethodName = "GetMemo";
  521. ccp.ServerParams = new object[] { design_key };
  522. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  523. if (ccp.SourceDataTable.Rows.Count == 0)
  524. {
  525. this.textBox6.Text = "";
  526. }
  527. else
  528. {
  529. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  530. }
  531. }
  532. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  533. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  534. {
  535. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  536. {
  537. ugrs.Appearance.BackColor = Color.Pink;
  538. }
  539. }
  540. }
  541. catch (Exception ex)
  542. {
  543. System.Diagnostics.Debug.WriteLine(ex.ToString());
  544. MessageBox.Show("系统出错,请联系管理人员", "警告");
  545. }
  546. }
  547. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  548. {
  549. try
  550. {
  551. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  552. if (ugr == null)
  553. return;
  554. this.dataSet5.Clear();
  555. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  556. CoreClientParam ccp = new CoreClientParam();
  557. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  558. ccp.MethodName = "findNameByMN";
  559. ccp.ServerParams = new object[] { surface_id };
  560. ccp.SourceDataTable = this.dataSet5.Tables[0];
  561. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  562. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  563. {
  564. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  565. {
  566. ugrs.Appearance.BackColor = Color.Pink;
  567. }
  568. }
  569. }
  570. catch (Exception ex)
  571. {
  572. System.Diagnostics.Debug.WriteLine(ex.ToString());
  573. MessageBox.Show("系统出错,请联系管理人员", "警告");
  574. }
  575. }
  576. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  577. {
  578. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  579. {
  580. if (checkBox1.Checked)
  581. {
  582. ugr.Cells["CHECK"].Value = "True";
  583. }
  584. else
  585. {
  586. ugr.Cells["CHECK"].Value = "False";
  587. }
  588. }
  589. }
  590. private void ultraTabControl1_Click(object sender, EventArgs e)
  591. {
  592. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  593. {
  594. this.label11.Visible = false;
  595. this.comboBox4.Visible = false;
  596. this.label12.Text = "判定时间";
  597. }
  598. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  599. {
  600. this.label11.Visible = true;
  601. this.comboBox4.Visible = true;
  602. this.label12.Text = "生产时间";
  603. }
  604. }
  605. private void DoExport()
  606. {
  607. try
  608. {
  609. if (this.ultraGrid1.Rows.Count == 0)
  610. {
  611. MessageBox.Show("没有可以导出的数据", "提示");
  612. return;
  613. }
  614. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  615. {
  616. string fName = this.saveFileDialog1.FileName;
  617. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  618. Process.Start(fName);
  619. }
  620. }
  621. catch (Exception ex)
  622. {
  623. System.Diagnostics.Debug.WriteLine(ex.ToString());
  624. }
  625. }
  626. }
  627. }