8fa0ccbc69525372ef6d601e9b541cf161835d9e.svn-base 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  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 QCM030501 : FrmBase
  17. {
  18. public QCM030501()
  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 "Add":
  36. this.FJHAdd();
  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. //查询探伤待检信息(轧批号、计划号)
  57. try
  58. {
  59. this.dataSet3.Clear();
  60. dataSet6.Clear();
  61. string starttime = "";
  62. string endtime = "";
  63. if (checkBox2.Checked)
  64. {
  65. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  66. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  67. }
  68. string sbatchno = "";
  69. string ebatchno = "";
  70. if (checkBox3.Checked)
  71. {
  72. sbatchno = this.textBox2.Text.Trim();
  73. }
  74. //if (checkBox3.Checked)
  75. //{
  76. // sbatchno = this.textBox2.Text.Trim();
  77. // if (textBox1.Text.ToString() == "")
  78. // {
  79. // ebatchno = this.textBox2.Text.Trim();
  80. // }
  81. // else
  82. // {
  83. // ebatchno = this.textBox1.Text.Trim();
  84. // }
  85. //}
  86. if (!checkBox2.Checked && !checkBox3.Checked)
  87. {
  88. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  89. return;
  90. }
  91. string orderno = this.textBox4.Text.Trim();// 订单号
  92. string psc = textBox3.Text.Trim(); //产品描述
  93. string prodline = comboBox3.Text.ToString();
  94. string isjudge = this.comboBox4.Text.ToString();
  95. string surface_type = this.comboBox5.Text.ToString();
  96. if (surface_type.Equals("全部"))
  97. {
  98. surface_type = "";
  99. }
  100. if (checkBox4.Checked)
  101. {
  102. orderno = "19";
  103. }
  104. CoreClientParam ccp = new CoreClientParam();
  105. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  106. ccp.MethodName = "doQueryMaterialDetailsBS2";
  107. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "B", prodline, isjudge, surface_type };
  108. ccp.SourceDataTable = this.dataSet3.Tables[0];
  109. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  110. ccp = new CoreClientParam();
  111. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  112. ccp.MethodName = "findFlawDataB";
  113. ccp.ServerParams = new object[] { prodline };
  114. ccp.SourceDataTable = this.dataSet6.Tables[0];
  115. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  116. ultraCombo1.DataSource = ccp.SourceDataTable;
  117. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = uc;
  118. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = ultraCombo1;
  119. }
  120. catch (Exception ex)
  121. {
  122. System.Diagnostics.Debug.WriteLine(ex.ToString());
  123. MessageBox.Show("系统出错,请联系管理人员", "警告");
  124. }
  125. }
  126. private void DoQueryRe()
  127. {
  128. //查询判定记录
  129. try
  130. {
  131. this.dataSet2.Clear();
  132. string starttime = "";
  133. string endtime = "";
  134. if (checkBox2.Checked)
  135. {
  136. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  137. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  138. }
  139. string sbatchno = "";
  140. string ebatchno = "";
  141. if (checkBox3.Checked)
  142. {
  143. sbatchno = this.textBox2.Text.Trim();
  144. }
  145. //if (checkBox3.Checked)
  146. //{
  147. // sbatchno = this.textBox2.Text.Trim();
  148. // if (textBox1.Text.ToString() == "")
  149. // {
  150. // ebatchno = this.textBox2.Text.Trim();
  151. // }
  152. // else
  153. // {
  154. // ebatchno = this.textBox1.Text.Trim();
  155. // }
  156. //}
  157. if (!checkBox2.Checked && !checkBox3.Checked)
  158. {
  159. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  160. return;
  161. }
  162. string orderno = textBox4.Text.Trim();
  163. string psc = textBox3.Text.Trim();
  164. string prodline = comboBox3.Text.ToString();
  165. CoreClientParam ccp = new CoreClientParam();
  166. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  167. ccp.MethodName = "GetSurfaceInfoB";
  168. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc,prodline };
  169. ccp.SourceDataTable = this.dataSet2.Tables[0];
  170. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  171. }
  172. catch (Exception ex)
  173. {
  174. System.Diagnostics.Debug.WriteLine(ex.ToString());
  175. MessageBox.Show("系统出错,请联系管理人员", "警告");
  176. }
  177. }
  178. private void FJHAdd()
  179. {
  180. //新增非计划子板
  181. try
  182. {
  183. QCM030611 frm = new QCM030611();
  184. if (frm.ShowDialog() == DialogResult.OK)
  185. {
  186. string billetid = frm._memo;
  187. List<UltraGridRow> lists = new List<UltraGridRow>();
  188. CoreClientParam ccp = new CoreClientParam();
  189. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  190. ccp.MethodName = "AddFJHZHB";
  191. ccp.ServerParams = new object[] { billetid };
  192. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  193. if (ccp.ReturnCode == -1)
  194. {
  195. return;
  196. }
  197. MessageBox.Show("新增成功!");
  198. }
  199. }
  200. catch (Exception ex)
  201. {
  202. System.Diagnostics.Debug.WriteLine(ex.ToString());
  203. MessageBox.Show("系统出错,请联系管理人员", "警告");
  204. }
  205. }
  206. private void Operate()
  207. {
  208. string material_no = "";
  209. try
  210. {
  211. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  212. if (ugr == null)
  213. return;
  214. CoreClientParam ccp = new CoreClientParam();
  215. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  216. {
  217. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  218. {
  219. string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
  220. string username = this.UserInfo.GetUserName();
  221. string userorder = this.UserInfo.GetUserOrderText();
  222. string usergroup = this.UserInfo.GetUserGroupText();
  223. string flag = "";
  224. if(ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  225. {
  226. flag = "1";
  227. }
  228. else
  229. {
  230. flag = "0";
  231. }
  232. ccp = new CoreClientParam();
  233. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  234. ccp.MethodName = "repairFlaw";
  235. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  236. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  237. }
  238. }
  239. this.dataSet4.Clear();
  240. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  241. ccp = new CoreClientParam();
  242. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  243. ccp.MethodName = "findNameByMN";
  244. ccp.ServerParams = new object[] { surface_id };
  245. ccp.SourceDataTable = this.dataSet4.Tables[0];
  246. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  247. }
  248. catch (Exception ex)
  249. {
  250. System.Diagnostics.Debug.WriteLine(ex.ToString());
  251. MessageBox.Show("系统出错,请联系管理人员", "警告");
  252. }
  253. }
  254. private void label9_Click(object sender, EventArgs e)
  255. {
  256. try
  257. {
  258. int num1 = 0;
  259. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  260. {
  261. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  262. {
  263. num1++;
  264. }
  265. }
  266. //判断是否都有勾选
  267. if (num1 == 0)
  268. {
  269. MessageBox.Show("请勾选待检信息!");
  270. return;
  271. }
  272. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  273. {
  274. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  275. {
  276. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Trim() == "")
  277. {
  278. MessageBox.Show("请录入缺陷信息并选择!");
  279. return;
  280. }
  281. }
  282. }
  283. if (comboBox1.Text.ToString().Trim() == "合格")
  284. {
  285. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  286. {
  287. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  288. {
  289. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  290. if (surface_id != "")
  291. {
  292. String spNoSel = "";
  293. string fh1 = "";
  294. int fnum = 0;
  295. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  296. {
  297. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  298. {
  299. String flawDesc = ugrs.Cells["FLAW_DESC"].Text.ToString();
  300. if (flawDesc == "")
  301. {
  302. MessageBox.Show("已选择的请录入缺陷信息!");
  303. return;
  304. }
  305. fnum = fnum + 1;
  306. if (fnum <= 1)
  307. {
  308. spNoSel = flawDesc;
  309. fh1 = ",";
  310. }
  311. else
  312. {
  313. spNoSel = spNoSel + fh1 + flawDesc;
  314. }
  315. }
  316. }
  317. CoreClientParam ccpSel = new CoreClientParam();
  318. ccpSel.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  319. ccpSel.MethodName = "ZHflawDesc";
  320. ccpSel.ServerParams = new object[] { spNoSel, surface_id };
  321. ccpSel = this.ExecuteNonQuery(ccpSel, CoreInvokeType.Internal);
  322. if (ccpSel.ReturnCode == -1)
  323. {
  324. return;
  325. }
  326. }
  327. }
  328. }
  329. }
  330. List<UltraGridRow> lists = new List<UltraGridRow>();
  331. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  332. {
  333. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  334. {
  335. ArrayList list1 = new ArrayList();
  336. List<ArrayList> list2 = new List<ArrayList>();
  337. if (comboBox1.Text.Trim() == "")
  338. {
  339. MessageBox.Show("请输入检验结果!");
  340. return;
  341. }
  342. if (comboBox2.Text.Trim() == "")
  343. {
  344. MessageBox.Show("请输入质量等级!");
  345. return;
  346. }
  347. string is_pass = "";
  348. string is_zl = "";
  349. if (comboBox1.Text.ToString() == "合格")
  350. {
  351. is_pass = "1";
  352. }
  353. else if (comboBox1.Text.ToString() == "不合格")
  354. {
  355. is_pass = "2";
  356. }
  357. else
  358. {
  359. is_pass = "0";
  360. }
  361. if (comboBox2.Text.ToString() == "正品")
  362. {
  363. is_zl = "512601";
  364. }
  365. else if (comboBox2.Text.ToString() == "次品")
  366. {
  367. is_zl = "512602";
  368. }
  369. else if (comboBox2.Text.ToString() == "废品")
  370. {
  371. is_zl = "512603";
  372. }
  373. else if (comboBox2.Text.ToString() == "协议品")
  374. {
  375. is_zl = "512604";
  376. }
  377. else if (comboBox2.Text.ToString() == "订单外")
  378. {
  379. is_zl = "512605";
  380. }
  381. else if (comboBox2.Text.ToString() == "待处理")
  382. {
  383. is_zl = "512606";
  384. }
  385. if (ugr.Cells["DESIGN_KEY"].Text.ToString() == "")
  386. {
  387. if (MessageBox.Show(this, "非计划订单,是否继续?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  388. {
  389. return;
  390. }
  391. }
  392. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  393. list1.Add(is_pass);//检验结果代码
  394. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  395. list1.Add(is_zl);//质量等级代码
  396. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  397. list1.Add(textBox5.Text.ToString().Trim());
  398. list1.Add(this.UserInfo.GetUserName());//操作人
  399. list1.Add(this.UserInfo.GetUserOrderText());//班次
  400. list1.Add(this.UserInfo.GetUserGroupText());//班组
  401. list1.Add(ugr.Cells["SURFACE_TYPE"].Text.ToString().Trim());
  402. int count = 0;
  403. int j = 1;
  404. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  405. {
  406. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  407. {
  408. ArrayList list = new ArrayList();
  409. list.Add("1");
  410. list.Add(j);
  411. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  412. {
  413. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  414. }
  415. else
  416. {
  417. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  418. }
  419. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  420. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  421. {
  422. MessageBox.Show("已选择的请录入缺陷信息!");
  423. return;
  424. }
  425. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  426. {
  427. list.Add("U");
  428. }
  429. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  430. {
  431. list.Add("D");
  432. }
  433. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  434. {
  435. list.Add("E");
  436. }
  437. else
  438. {
  439. list.Add("");
  440. //MessageBox.Show("请输入检验位置!");
  441. //return;
  442. }
  443. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  444. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  445. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  446. {
  447. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  448. }
  449. else
  450. {
  451. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  452. }
  453. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  454. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  455. {
  456. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  457. }
  458. else
  459. {
  460. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  461. }
  462. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  463. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  464. {
  465. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  466. }
  467. else
  468. {
  469. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  470. }
  471. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  472. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  473. {
  474. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  475. }
  476. else
  477. {
  478. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  479. }
  480. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  481. //if (ugrs.Cells["FLAW_QUANTITY"].Text == "")
  482. //{
  483. // MessageBox.Show("请输入数量!");
  484. // return;
  485. //}
  486. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  487. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  488. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  489. {
  490. list.Add("0");
  491. }
  492. else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("待修复"))
  493. {
  494. list.Add("0");
  495. }
  496. else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("已修复"))
  497. {
  498. list.Add("1");
  499. }
  500. else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("未冷矫"))
  501. {
  502. list.Add("2");
  503. }
  504. else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("已冷矫"))
  505. {
  506. list.Add("3");
  507. }
  508. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "4#飘曲" && (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("待修复") || ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("已修复")))
  509. {
  510. MessageBox.Show("4#飘曲缺陷不能录入待修复或已修复!");
  511. return;
  512. }
  513. list.Add(ugrs.Cells["FIXED_NAME"].Text.ToString());
  514. count++;
  515. j++;
  516. list2.Add(list);
  517. }
  518. }
  519. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  520. {
  521. MessageBox.Show("请录入缺陷信息并选择!");
  522. return;
  523. }
  524. CoreClientParam ccp = new CoreClientParam();
  525. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  526. ccp.MethodName = "doAddFlaw2";
  527. ccp.ServerParams = new object[] { list2, list1 };
  528. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  529. if (ccp.ReturnCode == -1)
  530. {
  531. MessageBox.Show(ccp.ReturnInfo);
  532. return;
  533. }
  534. lists.Add(ugr);
  535. }
  536. }
  537. for (int i = 0; i < lists.Count; i++)
  538. {
  539. lists[i].Delete(false);
  540. }
  541. MessageBox.Show("登记成功!");
  542. //DoQuery();
  543. }catch(Exception ex)
  544. {
  545. System.Diagnostics.Debug.WriteLine(ex.ToString());
  546. MessageBox.Show("系统出错,请联系管理人员", "警告");
  547. }
  548. }
  549. private void QCM0305_Load(object sender, EventArgs e)
  550. {
  551. string prodline = comboBox3.Text.ToString();
  552. this.comboBox4.SelectedIndex = 0;
  553. this.comboBox3.SelectedIndex = 0;
  554. this.comboBox5.SelectedIndex = 0;
  555. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  556. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  557. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  558. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  559. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  560. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  561. ValueList vis_repair = new ValueList();
  562. vis_repair.ValueListItems.Add("0", "待修复");
  563. vis_repair.ValueListItems.Add("1", "已修复");
  564. vis_repair.ValueListItems.Add("2", "未冷矫");
  565. vis_repair.ValueListItems.Add("3", "已冷矫");
  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 vfixed_name = new ValueList();
  572. vfixed_name.ValueListItems.Add("丰达凯莱工贸", "丰达凯莱工贸");
  573. vfixed_name.ValueListItems.Add("成品修磨队", "成品修磨队");
  574. vfixed_name.ValueListItems.Add("中板轧钢", "中板轧钢");
  575. vfixed_name.ValueListItems.Add("中板精整", "中板精整");
  576. vfixed_name.ValueListItems.Add("厚板轧钢", "厚板轧钢");
  577. vfixed_name.ValueListItems.Add("厚板精整", "厚板精整");
  578. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FIXED_NAME"].ValueList = vfixed_name;
  579. ValueList vFLAW_DESC = new ValueList();
  580. CoreClientParam ccp = new CoreClientParam();
  581. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  582. ccp.MethodName = "findFlawArea";
  583. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  584. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  585. {
  586. vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  587. }
  588. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
  589. ValueList vflaw_pos_desc = new ValueList();
  590. ccp = new CoreClientParam();
  591. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  592. ccp.MethodName = "findFlawPosDesc";
  593. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  594. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  595. {
  596. vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  597. }
  598. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
  599. ValueList VFLAW_SIZE_DESC = new ValueList();
  600. ccp = new CoreClientParam();
  601. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  602. ccp.MethodName = "findFlawSizeDesc";
  603. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  604. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  605. {
  606. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  607. }
  608. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  609. ValueList vsflv = new ValueList();
  610. ccp = new CoreClientParam();
  611. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  612. ccp.MethodName = "findSfLv";
  613. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  614. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  615. {
  616. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  617. }
  618. this.comboBox2.DataSource = vsflv.ValueListItems;
  619. ValueList VFLAW_LV_DESC = new ValueList();
  620. ccp = new CoreClientParam();
  621. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  622. ccp.MethodName = "findFlawLvDesc";
  623. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  624. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  625. {
  626. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  627. }
  628. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  629. ValueList VFLAW_DIR_DESC = new ValueList();
  630. ccp = new CoreClientParam();
  631. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  632. ccp.MethodName = "findFlawDirDesc";
  633. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  634. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  635. {
  636. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  637. }
  638. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  639. ccp = new CoreClientParam();
  640. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  641. ccp.MethodName = "findFlawDataB";
  642. ccp.ServerParams = new object[] { prodline };
  643. ccp.SourceDataTable = this.dataSet6.Tables[0];
  644. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  645. //ValueList VDEFECT_DESC = new ValueList();
  646. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  647. //{
  648. // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  649. //}
  650. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  651. ultraCombo1.DataSource = ccp.SourceDataTable;
  652. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = ultraCombo1;
  653. //DoQuery();
  654. }
  655. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  656. {
  657. try
  658. {
  659. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  660. this.dataSet4.Clear();
  661. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  662. if (surface_id != "")
  663. {
  664. CoreClientParam ccp = new CoreClientParam();
  665. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  666. ccp.MethodName = "findNameByMN";
  667. ccp.ServerParams = new object[] { surface_id };
  668. ccp.SourceDataTable = this.dataSet4.Tables[0];
  669. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  670. }
  671. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  672. if (design_key != "")
  673. {
  674. CoreClientParam ccp = new CoreClientParam();
  675. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  676. ccp.MethodName = "GetMemo";
  677. ccp.ServerParams = new object[] { design_key };
  678. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  679. if (ccp.SourceDataTable.Rows.Count == 0)
  680. {
  681. this.textBox6.Text = "";
  682. }
  683. else
  684. {
  685. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  686. }
  687. }
  688. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  689. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  690. {
  691. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  692. {
  693. ugrs.Appearance.BackColor = Color.Pink;
  694. }
  695. }
  696. }
  697. catch (Exception ex)
  698. {
  699. System.Diagnostics.Debug.WriteLine(ex.ToString());
  700. MessageBox.Show("系统出错,请联系管理人员", "警告");
  701. }
  702. }
  703. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  704. {
  705. try
  706. {
  707. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  708. if (ugr == null)
  709. return;
  710. this.dataSet5.Clear();
  711. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  712. CoreClientParam ccp = new CoreClientParam();
  713. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  714. ccp.MethodName = "findNameByMN";
  715. ccp.ServerParams = new object[] { surface_id };
  716. ccp.SourceDataTable = this.dataSet5.Tables[0];
  717. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  718. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  719. {
  720. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  721. {
  722. ugrs.Appearance.BackColor = Color.Pink;
  723. }
  724. }
  725. }
  726. catch (Exception ex)
  727. {
  728. System.Diagnostics.Debug.WriteLine(ex.ToString());
  729. MessageBox.Show("系统出错,请联系管理人员", "警告");
  730. }
  731. }
  732. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  733. {
  734. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  735. {
  736. if (checkBox1.Checked)
  737. {
  738. ugr.Cells["CHECK"].Value = "True";
  739. }
  740. else
  741. {
  742. ugr.Cells["CHECK"].Value = "False";
  743. }
  744. }
  745. }
  746. private void ultraTabControl1_Click(object sender, EventArgs e)
  747. {
  748. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  749. {
  750. this.label11.Visible = false;
  751. this.comboBox4.Visible = false;
  752. this.label12.Text = "判定时间";
  753. }
  754. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  755. {
  756. this.label11.Visible = true;
  757. this.comboBox4.Visible = true;
  758. this.label12.Text = "生产时间";
  759. }
  760. }
  761. private void DoExport()
  762. {
  763. try
  764. {
  765. if (this.ultraGrid1.Rows.Count == 0)
  766. {
  767. MessageBox.Show("没有可以导出的数据", "提示");
  768. return;
  769. }
  770. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  771. {
  772. string fName = this.saveFileDialog1.FileName;
  773. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  774. Process.Start(fName);
  775. }
  776. }
  777. catch (Exception ex)
  778. {
  779. System.Diagnostics.Debug.WriteLine(ex.ToString());
  780. }
  781. }
  782. private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
  783. {
  784. if (this.comboBox1.SelectedIndex == 0)
  785. {
  786. ValueList vsflv = new ValueList();
  787. CoreClientParam ccp = new CoreClientParam();
  788. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  789. ccp.MethodName = "findSfLv1";
  790. ccp.ServerParams = new object[] {"2"};
  791. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  792. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  793. {
  794. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  795. }
  796. this.comboBox2.DataSource = vsflv.ValueListItems;
  797. }
  798. else if (this.comboBox1.SelectedIndex == 1)
  799. {
  800. ValueList vsflv = new ValueList();
  801. CoreClientParam ccp = new CoreClientParam();
  802. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  803. ccp.MethodName = "findSfLv1";
  804. ccp.ServerParams = new object[] { "0" };
  805. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  806. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  807. {
  808. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  809. }
  810. this.comboBox2.DataSource = vsflv.ValueListItems;
  811. }
  812. else if (this.comboBox1.SelectedIndex == 2)
  813. {
  814. ValueList vsflv = new ValueList();
  815. CoreClientParam ccp = new CoreClientParam();
  816. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  817. ccp.MethodName = "findSfLv1";
  818. ccp.ServerParams = new object[] { "1" };
  819. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  820. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  821. {
  822. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  823. }
  824. this.comboBox2.DataSource = vsflv.ValueListItems;
  825. }
  826. }
  827. private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  828. {
  829. if (e.Cell.Column.ToString() == "FLAW_DESC")
  830. {
  831. CoreClientParam ccp = new CoreClientParam();
  832. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  833. ccp.MethodName = "findFlawDataB1";
  834. ccp.ServerParams = new object[] { comboBox3.Text.ToString(),e.Cell.Text.ToString()};
  835. dataSet6.Clear();
  836. ccp.SourceDataTable = this.dataSet6.Tables[0];
  837. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  838. //ValueList VDEFECT_DESC = new ValueList();
  839. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  840. //{
  841. // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  842. //}
  843. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  844. ultraCombo1.DataSource = ccp.SourceDataTable;
  845. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = ultraCombo1;
  846. }
  847. }
  848. }
  849. }