QCM030505.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  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 QCM030505 : FrmBase
  17. {
  18. public QCM030505()
  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 = 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 = "doQueryMaterialDetailsJ";
  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 = "findFlawDataJ";
  97. ccp.ServerParams = new object[] { prodline };
  98. ccp.SourceDataTable = this.dataSet6.Tables[0];
  99. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  100. 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.textBox1.Text.Trim();
  127. if (textBox2.Text.ToString() == "")
  128. {
  129. ebatchno = this.textBox1.Text.Trim();
  130. }
  131. else
  132. {
  133. ebatchno = this.textBox2.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 = comboBox3.Text.ToString();
  144. CoreClientParam ccp = new CoreClientParam();
  145. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  146. ccp.MethodName = "GetSurfaceInfoJ";
  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. flag = "1";
  177. }else{
  178. flag = "0";
  179. }
  180. ccp = new CoreClientParam();
  181. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  182. ccp.MethodName = "repairFlaw";
  183. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  184. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  185. }
  186. }
  187. this.dataSet4.Clear();
  188. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  189. ccp = new CoreClientParam();
  190. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  191. ccp.MethodName = "findNameByMN";
  192. ccp.ServerParams = new object[] { surface_id };
  193. ccp.SourceDataTable = this.dataSet4.Tables[0];
  194. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  195. }
  196. catch (Exception ex)
  197. {
  198. System.Diagnostics.Debug.WriteLine(ex.ToString());
  199. MessageBox.Show("系统出错,请联系管理人员", "警告");
  200. }
  201. }
  202. private void label9_Click(object sender, EventArgs e)
  203. {
  204. try
  205. {
  206. List<UltraGridRow> lists = new List<UltraGridRow>();
  207. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  208. {
  209. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  210. {
  211. ArrayList list1 = new ArrayList();
  212. List<ArrayList> list2 = new List<ArrayList>();
  213. if (comboBox1.Text.Trim() == "")
  214. {
  215. MessageBox.Show("请输入检验结果!");
  216. return;
  217. }
  218. if (comboBox2.Text.Trim() == "")
  219. {
  220. MessageBox.Show("请输入质量等级!");
  221. return;
  222. }
  223. string is_pass = "";
  224. string is_zl = "";
  225. if (comboBox1.Text.ToString() == "合格")
  226. {
  227. is_pass = "1";
  228. }
  229. else if (comboBox1.Text.ToString() == "不合格")
  230. {
  231. is_pass = "2";
  232. }
  233. else
  234. {
  235. is_pass = "0";
  236. }
  237. is_zl = comboBox2.Text.ToString();
  238. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  239. list1.Add(is_pass);//检验结果代码
  240. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  241. list1.Add(is_zl);//质量等级代码
  242. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  243. list1.Add(textBox5.Text.ToString().Trim());
  244. list1.Add(this.UserInfo.GetUserName());//操作人
  245. list1.Add(this.UserInfo.GetUserOrderText());//班次
  246. list1.Add(this.UserInfo.GetUserGroupText());//班组
  247. int count = 0;
  248. int i = 0;
  249. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  250. {
  251. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  252. {
  253. int j = 2;
  254. ArrayList list = new ArrayList();
  255. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  256. i++;
  257. list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
  258. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  259. {
  260. list.Add("1");
  261. j = j - 1;
  262. }
  263. else
  264. {
  265. list.Add(j);
  266. }
  267. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  268. {
  269. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  270. }
  271. else
  272. {
  273. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  274. }
  275. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  276. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  277. {
  278. MessageBox.Show("已选择的请录入缺陷信息!");
  279. return;
  280. }
  281. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  282. {
  283. list.Add("U");
  284. }
  285. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  286. {
  287. list.Add("D");
  288. }
  289. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  290. {
  291. list.Add("E");
  292. }
  293. else
  294. {
  295. list.Add("");
  296. }
  297. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  298. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  299. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  300. {
  301. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  302. }
  303. else
  304. {
  305. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  306. }
  307. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  308. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  309. {
  310. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  311. }
  312. else
  313. {
  314. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  315. }
  316. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  317. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  318. {
  319. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  320. }
  321. else
  322. {
  323. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  324. }
  325. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  326. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  327. {
  328. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  329. }
  330. else
  331. {
  332. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  333. }
  334. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  335. //if (ugrs.Cells["FLAW_QUANTITY"].Text == "")
  336. //{
  337. // MessageBox.Show("请输入数量!");
  338. // return;
  339. //}
  340. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  341. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  342. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  343. {
  344. list.Add("0");
  345. }
  346. else
  347. {
  348. list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
  349. }
  350. count++;
  351. j++;
  352. list2.Add(list);
  353. }
  354. }
  355. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  356. {
  357. MessageBox.Show("请录入缺陷信息并选择!");
  358. return;
  359. }
  360. if (i == 0 && comboBox1.Text.ToString() == "不合格")
  361. {
  362. MessageBox.Show("请录入主要缺陷!");
  363. return;
  364. }
  365. if (i > 1)
  366. {
  367. MessageBox.Show("请不要录入多条主要缺陷!");
  368. return;
  369. }
  370. //if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
  371. //{
  372. // MessageBox.Show("检验结果与质量等级不一致!");
  373. // return;
  374. //}
  375. CoreClientParam ccp = new CoreClientParam();
  376. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  377. ccp.MethodName = "doAddFlawJ";
  378. ccp.ServerParams = new object[] { list2, list1 };
  379. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  380. if (ccp.ReturnCode == -1)
  381. {
  382. return;
  383. }
  384. lists.Add(ugr);
  385. }
  386. }
  387. for (int i = 0; i < lists.Count; i++)
  388. {
  389. lists[i].Delete(false);
  390. }
  391. //DoQuery();
  392. MessageBox.Show("登记成功!");
  393. }catch(Exception ex)
  394. {
  395. System.Diagnostics.Debug.WriteLine(ex.ToString());
  396. MessageBox.Show("系统出错,请联系管理人员", "警告");
  397. }
  398. }
  399. private void QCM0305_Load(object sender, EventArgs e)
  400. {
  401. this.comboBox3.SelectedIndex = 0;
  402. this.comboBox4.SelectedIndex = 0;
  403. string prodline = comboBox3.Text.ToString();
  404. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  405. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  406. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  407. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  408. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  409. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  410. ValueList vis_repair = new ValueList();
  411. vis_repair.ValueListItems.Add("0", "待修复");
  412. vis_repair.ValueListItems.Add("1", "已修复");
  413. this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
  414. ValueList vprimary_flag = new ValueList();
  415. vprimary_flag.ValueListItems.Add("1", "是");
  416. vprimary_flag.ValueListItems.Add("0", "否");
  417. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
  418. ValueList vFLAW_DESC = new ValueList();
  419. CoreClientParam ccp = new CoreClientParam();
  420. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  421. ccp.MethodName = "findFlawArea";
  422. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  423. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  424. {
  425. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  426. }
  427. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
  428. ValueList vflaw_pos_desc = new ValueList();
  429. ccp = new CoreClientParam();
  430. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  431. ccp.MethodName = "findFlawPosDesc";
  432. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  433. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  434. {
  435. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  436. }
  437. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
  438. ValueList vsflv = new ValueList();
  439. ccp = new CoreClientParam();
  440. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  441. ccp.MethodName = "findZlLevel";
  442. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  443. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  444. {
  445. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CD"].ToString());
  446. }
  447. this.comboBox2.DataSource = vsflv.ValueListItems;
  448. ValueList VFLAW_SIZE_DESC = new ValueList();
  449. ccp = new CoreClientParam();
  450. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  451. ccp.MethodName = "findFlawSizeDesc";
  452. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  453. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  454. {
  455. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  456. }
  457. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  458. ValueList VFLAW_LV_DESC = new ValueList();
  459. ccp = new CoreClientParam();
  460. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  461. ccp.MethodName = "findFlawLvDesc";
  462. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  463. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  464. {
  465. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  466. }
  467. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  468. ValueList VFLAW_DIR_DESC = new ValueList();
  469. ccp = new CoreClientParam();
  470. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  471. ccp.MethodName = "findJFlawDirDesc";
  472. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  473. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  474. {
  475. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  476. }
  477. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  478. //ccp = new CoreClientParam();
  479. //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  480. //ccp.MethodName = "findFlawDataJ";
  481. //ccp.ServerParams = new object[] {prodline };
  482. //ccp.SourceDataTable = this.dataSet6.Tables[0];
  483. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  484. ////ValueList VDEFECT_DESC = new ValueList();
  485. ////for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  486. ////{
  487. //// VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  488. ////}
  489. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  490. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = VDEFECT_DESC;
  491. //UltraCombo uc;
  492. //uc = new UltraCombo();
  493. //uc.BindingContext = this.BindingContext;
  494. //uc.DataSource = ccp.SourceDataTable;
  495. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = new BindableValueList(ccp.SourceDataTable, "", "DEFECT_NAME", "DEFECT_CODE", this.ultraGrid4);
  496. DoQuery();
  497. }
  498. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  499. {
  500. try
  501. {
  502. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  503. this.dataSet4.Clear();
  504. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  505. if (surface_id != "")
  506. {
  507. CoreClientParam ccp = new CoreClientParam();
  508. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  509. ccp.MethodName = "findNameByMN";
  510. ccp.ServerParams = new object[] { surface_id };
  511. ccp.SourceDataTable = this.dataSet4.Tables[0];
  512. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  513. }
  514. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  515. if (design_key != "")
  516. {
  517. CoreClientParam ccp = new CoreClientParam();
  518. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  519. ccp.MethodName = "GetMemo";
  520. ccp.ServerParams = new object[] { design_key };
  521. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  522. if (ccp.SourceDataTable.Rows.Count == 0)
  523. {
  524. this.textBox6.Text = "";
  525. }
  526. else
  527. {
  528. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  529. }
  530. }
  531. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  532. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  533. {
  534. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  535. {
  536. ugrs.Appearance.BackColor = Color.Pink;
  537. }
  538. }
  539. }
  540. catch (Exception ex)
  541. {
  542. System.Diagnostics.Debug.WriteLine(ex.ToString());
  543. MessageBox.Show("系统出错,请联系管理人员", "警告");
  544. }
  545. }
  546. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  547. {
  548. try
  549. {
  550. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  551. if (ugr == null)
  552. return;
  553. this.dataSet5.Clear();
  554. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  555. CoreClientParam ccp = new CoreClientParam();
  556. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  557. ccp.MethodName = "findNameByMN";
  558. ccp.ServerParams = new object[] { surface_id };
  559. ccp.SourceDataTable = this.dataSet5.Tables[0];
  560. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  561. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  562. {
  563. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  564. {
  565. ugrs.Appearance.BackColor = Color.Pink;
  566. }
  567. }
  568. }
  569. catch (Exception ex)
  570. {
  571. System.Diagnostics.Debug.WriteLine(ex.ToString());
  572. MessageBox.Show("系统出错,请联系管理人员", "警告");
  573. }
  574. }
  575. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  576. {
  577. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  578. {
  579. if (checkBox1.Checked)
  580. {
  581. ugr.Cells["CHECK"].Value = "True";
  582. }
  583. else
  584. {
  585. ugr.Cells["CHECK"].Value = "False";
  586. }
  587. }
  588. }
  589. private void ultraTabControl1_Click(object sender, EventArgs e)
  590. {
  591. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  592. {
  593. this.label11.Visible = false;
  594. this.comboBox4.Visible = false;
  595. this.label12.Text = "判定时间";
  596. }
  597. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  598. {
  599. this.label11.Visible = true;
  600. this.comboBox4.Visible = true;
  601. this.label12.Text = "生产时间";
  602. }
  603. }
  604. private void DoExport()
  605. {
  606. try
  607. {
  608. if (this.ultraGrid1.Rows.Count == 0)
  609. {
  610. MessageBox.Show("没有可以导出的数据", "提示");
  611. return;
  612. }
  613. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  614. {
  615. string fName = this.saveFileDialog1.FileName;
  616. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  617. Process.Start(fName);
  618. }
  619. }
  620. catch (Exception ex)
  621. {
  622. System.Diagnostics.Debug.WriteLine(ex.ToString());
  623. }
  624. }
  625. }
  626. }