QCM030504.cs 29 KB

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