QCM030304.cs 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  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 QCM030304 : FrmBase
  17. {
  18. public QCM030304()
  19. {
  20. InitializeComponent();
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Judge":
  30. Operate();
  31. break;
  32. case "FB":
  33. fb();
  34. break;
  35. case "Cancel_FB":
  36. cancel_fb();
  37. break;
  38. case "Exit":
  39. this.Close();
  40. break;
  41. case "Export":
  42. this.DoExport();
  43. break;
  44. }
  45. }
  46. private void DoQuery()
  47. {
  48. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  49. {
  50. DoQueryMe();
  51. }
  52. if (this.ultraTabControl1.Tabs[1].Selected) //表面判定记录
  53. {
  54. DoQueryRe();
  55. }
  56. if (this.ultraTabControl1.Tabs[2].Selected) //公差判定记录
  57. {
  58. DoQueryRe1();
  59. }
  60. }
  61. private void DoQueryMe()
  62. {
  63. //查询探伤待检信息(轧批号、计划号)
  64. try
  65. {
  66. this.dataSet3.Clear();
  67. dataSet6.Clear();
  68. string starttime = "";
  69. string endtime = "";
  70. if (checkBox2.Checked)
  71. {
  72. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  73. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  74. }
  75. string sbatchno = "";
  76. string ebatchno = "";
  77. if (checkBox3.Checked)
  78. {
  79. sbatchno = this.textBox2.Text.Trim();
  80. if (textBox1.Text.ToString() == "")
  81. {
  82. ebatchno = this.textBox2.Text.Trim();
  83. }
  84. else
  85. {
  86. ebatchno = this.textBox1.Text.Trim();
  87. }
  88. }
  89. if (!checkBox2.Checked && !checkBox3.Checked)
  90. {
  91. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  92. return;
  93. }
  94. string orderno = this.textBox4.Text.Trim();// 订单号
  95. string psc = textBox3.Text.Trim(); //产品描述
  96. string prodline = comboBox3.Text.ToString();
  97. string isjudge = this.comboBox4.Text.ToString();
  98. CoreClientParam ccp = new CoreClientParam();
  99. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  100. ccp.MethodName = "doQueryMaterialDetailsJ";
  101. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "B", prodline, isjudge };
  102. ccp.SourceDataTable = this.dataSet3.Tables[0];
  103. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  104. ccp = new CoreClientParam();
  105. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  106. ccp.MethodName = "findFlawDataJ";
  107. ccp.ServerParams = new object[] { prodline };
  108. ccp.SourceDataTable = this.dataSet6.Tables[0];
  109. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  110. ultraCombo1.DataSource = ccp.SourceDataTable;
  111. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  112. }
  113. catch (Exception ex)
  114. {
  115. System.Diagnostics.Debug.WriteLine(ex.ToString());
  116. MessageBox.Show("系统出错,请联系管理人员", "警告");
  117. }
  118. }
  119. private void DoQueryRe()
  120. {
  121. //查询判定记录
  122. try
  123. {
  124. this.dataSet2.Clear();
  125. string starttime = "";
  126. string endtime = "";
  127. if (checkBox2.Checked)
  128. {
  129. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  130. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  131. }
  132. string sbatchno = "";
  133. string ebatchno = "";
  134. if (checkBox3.Checked)
  135. {
  136. sbatchno = this.textBox2.Text.Trim();
  137. if (textBox1.Text.ToString() == "")
  138. {
  139. ebatchno = this.textBox2.Text.Trim();
  140. }
  141. else
  142. {
  143. ebatchno = this.textBox1.Text.Trim();
  144. }
  145. }
  146. if (!checkBox2.Checked && !checkBox3.Checked)
  147. {
  148. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  149. return;
  150. }
  151. string orderno = textBox4.Text.Trim();
  152. string psc = textBox3.Text.Trim();
  153. string prodline = comboBox3.Text.ToString();
  154. CoreClientParam ccp = new CoreClientParam();
  155. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  156. ccp.MethodName = "GetSurfaceInfoJ";
  157. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline };
  158. ccp.SourceDataTable = this.dataSet2.Tables[0];
  159. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  160. }
  161. catch (Exception ex)
  162. {
  163. System.Diagnostics.Debug.WriteLine(ex.ToString());
  164. MessageBox.Show("系统出错,请联系管理人员", "警告");
  165. }
  166. }
  167. private void DoQueryRe1()
  168. {
  169. try
  170. {
  171. this.dataSet9.Clear();
  172. string starttime = "";
  173. string endtime = "";
  174. if (checkBox2.Checked)
  175. {
  176. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  177. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  178. }
  179. string sbatchno = "";
  180. string ebatchno = "";
  181. if (checkBox3.Checked)
  182. {
  183. sbatchno = this.textBox1.Text.Trim();
  184. if (textBox2.Text.ToString() == "")
  185. {
  186. ebatchno = this.textBox1.Text.Trim();
  187. }
  188. else
  189. {
  190. ebatchno = this.textBox2.Text.Trim();
  191. }
  192. }
  193. if (!checkBox2.Checked && !checkBox3.Checked)
  194. {
  195. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  196. return;
  197. }
  198. string orderno = this.textBox3.Text.Trim();// 订单号
  199. string psc = textBox4.Text.Trim(); //产品描述
  200. string prodline = this.comboBox3.Text.ToString();
  201. CoreClientParam ccp = new CoreClientParam();
  202. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  203. ccp.MethodName = "GetMeasureInfoJ";
  204. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline };
  205. ccp.SourceDataTable = this.dataSet9.Tables[0];
  206. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  207. }
  208. catch (Exception ex)
  209. {
  210. System.Diagnostics.Debug.WriteLine(ex.ToString());
  211. MessageBox.Show("系统出错,请联系管理人员", "警告");
  212. }
  213. }
  214. private void Operate()
  215. {
  216. string material_no = "";
  217. try
  218. {
  219. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  220. if (ugr == null)
  221. return;
  222. CoreClientParam ccp = new CoreClientParam();
  223. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  224. {
  225. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  226. {
  227. string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
  228. string username = this.UserInfo.GetUserName();
  229. string userorder = this.UserInfo.GetUserOrderText();
  230. string usergroup = this.UserInfo.GetUserGroupText();
  231. string flag = "";
  232. if (ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
  233. {
  234. flag = "1";
  235. }
  236. else
  237. {
  238. flag = "0";
  239. }
  240. ccp = new CoreClientParam();
  241. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  242. ccp.MethodName = "repairFlaw";
  243. ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
  244. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  245. }
  246. }
  247. this.dataSet4.Clear();
  248. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  249. ccp = new CoreClientParam();
  250. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  251. ccp.MethodName = "findNameByMN";
  252. ccp.ServerParams = new object[] { surface_id };
  253. ccp.SourceDataTable = this.dataSet4.Tables[0];
  254. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  255. }
  256. catch (Exception ex)
  257. {
  258. System.Diagnostics.Debug.WriteLine(ex.ToString());
  259. MessageBox.Show("系统出错,请联系管理人员", "警告");
  260. }
  261. }
  262. private void fb()
  263. {
  264. try
  265. {
  266. List<UltraGridRow> lists = new List<UltraGridRow>();
  267. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  268. {
  269. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  270. {
  271. CoreClientParam ccp = new CoreClientParam();
  272. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  273. ccp.MethodName = "coiljudge_status_call_commit";
  274. ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
  275. , ugr.Cells["MATERIAL_NO"].Value.ToString()
  276. , ""
  277. , ""
  278. , ""
  279. , ""
  280. , ""
  281. , "Y"
  282. , txt_fb_reason.Text};
  283. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  284. if (ccp.ReturnCode == -1)
  285. {
  286. return;
  287. }
  288. lists.Add(ugr);
  289. }
  290. }
  291. for (int i = 0; i < lists.Count; i++)
  292. {
  293. lists[i].Delete(false);
  294. }
  295. //DoQuery();
  296. MessageBox.Show("封闭成功!");
  297. }
  298. catch (Exception ex)
  299. {
  300. System.Diagnostics.Debug.WriteLine(ex.ToString());
  301. MessageBox.Show("系统出错,请联系管理人员", "警告");
  302. }
  303. }
  304. private void cancel_fb()
  305. {
  306. try
  307. {
  308. List<UltraGridRow> lists = new List<UltraGridRow>();
  309. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  310. {
  311. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  312. {
  313. CoreClientParam ccp = new CoreClientParam();
  314. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  315. ccp.MethodName = "coiljudge_status_call_commit";
  316. ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
  317. , ugr.Cells["MATERIAL_NO"].Value.ToString()
  318. , ""
  319. , ""
  320. , ""
  321. , ""
  322. , ""
  323. , "N"
  324. , txt_fb_reason.Text};
  325. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  326. if (ccp.ReturnCode == -1)
  327. {
  328. return;
  329. }
  330. lists.Add(ugr);
  331. }
  332. }
  333. for (int i = 0; i < lists.Count; i++)
  334. {
  335. lists[i].Delete(false);
  336. }
  337. //DoQuery();
  338. MessageBox.Show("解除封闭成功!");
  339. }
  340. catch (Exception ex)
  341. {
  342. System.Diagnostics.Debug.WriteLine(ex.ToString());
  343. MessageBox.Show("系统出错,请联系管理人员", "警告");
  344. }
  345. }
  346. private void label9_Click(object sender, EventArgs e)
  347. {
  348. try
  349. {
  350. List<UltraGridRow> lists = new List<UltraGridRow>();
  351. foreach (UltraGridRow ugr in ultraGrid3.Rows)
  352. {
  353. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  354. {
  355. ArrayList list1 = new ArrayList();
  356. List<ArrayList> list2 = new List<ArrayList>();
  357. if (comboBox1.Text.Trim() == "")
  358. {
  359. MessageBox.Show("请输入检验结果!");
  360. return;
  361. }
  362. if (comboBox2.Text.Trim() == "")
  363. {
  364. MessageBox.Show("请输入质量等级!");
  365. return;
  366. }
  367. string is_pass = "";
  368. string is_zl = "";
  369. if (comboBox1.Text.ToString() == "合格")
  370. {
  371. is_pass = "1";
  372. }
  373. else if (comboBox1.Text.ToString() == "不合格")
  374. {
  375. is_pass = "2";
  376. }
  377. else
  378. {
  379. is_pass = "0";
  380. }
  381. if (comboBox2.Text.ToString() == "正品")
  382. {
  383. is_zl = "512601";
  384. }
  385. else if (comboBox2.Text.ToString() == "次品")
  386. {
  387. is_zl = "512602";
  388. }
  389. else if (comboBox2.Text.ToString() == "废品")
  390. {
  391. is_zl = "512603";
  392. }
  393. else if (comboBox2.Text.ToString() == "协议品")
  394. {
  395. is_zl = "512604";
  396. }
  397. else if (comboBox2.Text.ToString() == "订单外")
  398. {
  399. is_zl = "512605";
  400. }
  401. else if (comboBox2.Text.ToString() == "待处理")
  402. {
  403. is_zl = "512606";
  404. }
  405. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  406. list1.Add(is_pass);//检验结果代码
  407. list1.Add(comboBox1.Text.Trim().ToString());//检验结果
  408. list1.Add(is_zl);//质量等级代码
  409. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  410. list1.Add(textBox5.Text.ToString().Trim());
  411. list1.Add(this.UserInfo.GetUserName());//操作人
  412. list1.Add(this.UserInfo.GetUserOrderText());//班次
  413. list1.Add(this.UserInfo.GetUserGroupText());//班组
  414. int count = 0;
  415. int i = 0;
  416. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  417. {
  418. if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
  419. {
  420. int j = 2;
  421. ArrayList list = new ArrayList();
  422. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  423. i++;
  424. list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
  425. if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
  426. {
  427. list.Add("1");
  428. j = j - 1;
  429. }
  430. else
  431. {
  432. list.Add(j);
  433. }
  434. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  435. {
  436. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  437. }
  438. else
  439. {
  440. list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
  441. }
  442. list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
  443. if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
  444. {
  445. MessageBox.Show("已选择的请录入缺陷信息!");
  446. return;
  447. }
  448. if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
  449. {
  450. list.Add("U");
  451. }
  452. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
  453. {
  454. list.Add("D");
  455. }
  456. else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
  457. {
  458. list.Add("E");
  459. }
  460. else
  461. {
  462. list.Add("");
  463. }
  464. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
  465. //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
  466. if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
  467. {
  468. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  469. }
  470. else
  471. {
  472. list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
  473. }
  474. list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
  475. if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
  476. {
  477. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  478. }
  479. else
  480. {
  481. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
  482. }
  483. list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
  484. if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
  485. {
  486. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  487. }
  488. else
  489. {
  490. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
  491. }
  492. list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
  493. if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
  494. {
  495. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  496. }
  497. else
  498. {
  499. list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
  500. }
  501. list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
  502. if (!IsNumberal(ugrs.Cells["FLAW_QUANTITY"].Text))
  503. {
  504. MessageBox.Show("数量请输入数字!");
  505. return;
  506. }
  507. list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
  508. list.Add(ugrs.Cells["MEMO"].Text.ToString());
  509. if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
  510. {
  511. list.Add("0");
  512. }
  513. else
  514. {
  515. list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
  516. }
  517. count++;
  518. j++;
  519. list2.Add(list);
  520. }
  521. }
  522. if (count == 0 && comboBox1.Text.ToString() == "不合格")
  523. {
  524. MessageBox.Show("请录入缺陷信息并选择!");
  525. return;
  526. }
  527. if (i == 0 && comboBox1.Text.ToString() == "不合格")
  528. {
  529. MessageBox.Show("请录入主要缺陷!");
  530. return;
  531. }
  532. if (i > 1)
  533. {
  534. MessageBox.Show("请不要录入多条主要缺陷!");
  535. return;
  536. }
  537. if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
  538. {
  539. MessageBox.Show("检验结果与质量等级不一致!");
  540. return;
  541. }
  542. CoreClientParam ccp = new CoreClientParam();
  543. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  544. ccp.MethodName = "doAddFlawJ";
  545. ccp.ServerParams = new object[] { list2, list1 };
  546. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  547. if (ccp.ReturnCode == -1)
  548. {
  549. return;
  550. }
  551. lists.Add(ugr);
  552. }
  553. }
  554. for (int i = 0; i < lists.Count; i++)
  555. {
  556. lists[i].Delete(false);
  557. }
  558. //DoQuery();
  559. MessageBox.Show("登记成功!");
  560. }
  561. catch (Exception ex)
  562. {
  563. System.Diagnostics.Debug.WriteLine(ex.ToString());
  564. MessageBox.Show("系统出错,请联系管理人员", "警告");
  565. }
  566. }
  567. public static bool IsNumberal(string input)
  568. {
  569. bool flag = true;
  570. int count = 0;
  571. int count1 = 0;
  572. if (input.Length == 0)
  573. {
  574. flag = false;
  575. }
  576. else
  577. {
  578. char[] x = input.ToCharArray();
  579. for (int i = 0; i < input.Length; i++)
  580. {
  581. if (!char.IsNumber(x[i]) && x[i] != '.' && x[i] != '-')
  582. {
  583. flag = false; break;
  584. }
  585. if (x[i] == '.')
  586. {
  587. count++;
  588. if (i == 0 || i == input.Length - 1) flag = false;
  589. }
  590. if (x[i] == '-')
  591. {
  592. count1++;
  593. if (i > 1) flag = false;
  594. }
  595. }
  596. if (count > 1 || count1 > 1) flag = false;
  597. }
  598. return flag;
  599. }
  600. private void QCM030304_Load(object sender, EventArgs e)
  601. {
  602. this.comboBox3.SelectedIndex = 0;
  603. this.comboBox4.SelectedIndex = 0;
  604. string prodline = comboBox3.Text.ToString();
  605. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  606. this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  607. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  608. this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  609. this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  610. this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
  611. ValueList vis_repair = new ValueList();
  612. vis_repair.ValueListItems.Add("0", "待修复");
  613. vis_repair.ValueListItems.Add("1", "已修复");
  614. this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
  615. ValueList vprimary_flag = new ValueList();
  616. vprimary_flag.ValueListItems.Add("1", "是");
  617. vprimary_flag.ValueListItems.Add("0", "否");
  618. this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
  619. ValueList vFLAW_DESC = new ValueList();
  620. CoreClientParam ccp = new CoreClientParam();
  621. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  622. ccp.MethodName = "findFlawArea";
  623. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  624. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  625. {
  626. vFLAW_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_AREA"].ValueList = vFLAW_DESC;
  629. ValueList vflaw_pos_desc = new ValueList();
  630. ccp = new CoreClientParam();
  631. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  632. ccp.MethodName = "findFlawPosDesc";
  633. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  634. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  635. {
  636. vflaw_pos_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_POS_DESC"].ValueList = vflaw_pos_desc;
  639. ValueList vsflv = new ValueList();
  640. ccp = new CoreClientParam();
  641. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  642. ccp.MethodName = "findSfLv";
  643. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  644. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  645. {
  646. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  647. }
  648. this.comboBox2.DataSource = vsflv.ValueListItems;
  649. ValueList VFLAW_SIZE_DESC = new ValueList();
  650. ccp = new CoreClientParam();
  651. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  652. ccp.MethodName = "findFlawSizeDesc";
  653. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  654. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  655. {
  656. VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  657. }
  658. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
  659. ValueList VFLAW_LV_DESC = new ValueList();
  660. ccp = new CoreClientParam();
  661. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  662. ccp.MethodName = "findFlawLvDesc";
  663. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  664. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  665. {
  666. VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  667. }
  668. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
  669. ValueList VFLAW_DIR_DESC = new ValueList();
  670. ccp = new CoreClientParam();
  671. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  672. ccp.MethodName = "findJFlawDirDesc";
  673. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  674. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  675. {
  676. VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  677. }
  678. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
  679. //ccp = new CoreClientParam();
  680. //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  681. //ccp.MethodName = "findFlawDataJ";
  682. //ccp.ServerParams = new object[] {prodline };
  683. //ccp.SourceDataTable = this.dataSet6.Tables[0];
  684. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  685. ////ValueList VDEFECT_DESC = new ValueList();
  686. ////for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  687. ////{
  688. //// VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
  689. ////}
  690. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
  691. ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = VDEFECT_DESC;
  692. //UltraCombo uc;
  693. //uc = new UltraCombo();
  694. //uc.BindingContext = this.BindingContext;
  695. //uc.DataSource = ccp.SourceDataTable;
  696. //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = new BindableValueList(ccp.SourceDataTable, "", "DEFECT_NAME", "DEFECT_CODE", this.ultraGrid4);
  697. DoQuery();
  698. }
  699. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  700. {
  701. try
  702. {
  703. UltraGridRow ugr = this.ultraGrid3.ActiveRow;
  704. this.dataSet4.Clear();
  705. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  706. if (surface_id != "")
  707. {
  708. CoreClientParam ccp = new CoreClientParam();
  709. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  710. ccp.MethodName = "findNameByMN";
  711. ccp.ServerParams = new object[] { surface_id };
  712. ccp.SourceDataTable = this.dataSet4.Tables[0];
  713. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  714. }
  715. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  716. if (design_key != "")
  717. {
  718. CoreClientParam ccp = new CoreClientParam();
  719. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  720. ccp.MethodName = "GetMemo";
  721. ccp.ServerParams = new object[] { design_key };
  722. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  723. if (ccp.SourceDataTable.Rows.Count == 0)
  724. {
  725. this.textBox6.Text = "";
  726. }
  727. else
  728. {
  729. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  730. }
  731. }
  732. this.dataSet7.Clear();
  733. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  734. CoreClientParam ccp1 = new CoreClientParam();
  735. ccp1.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  736. ccp1.MethodName = "getToleranceJ";
  737. ccp1.ServerParams = new object[] { design_key, material_no };
  738. ccp1.SourceDataTable = this.dataSet7.Tables[0];
  739. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  740. this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
  741. foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
  742. {
  743. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  744. {
  745. ugrs.Appearance.BackColor = Color.Pink;
  746. }
  747. }
  748. }
  749. catch (Exception ex)
  750. {
  751. System.Diagnostics.Debug.WriteLine(ex.ToString());
  752. MessageBox.Show("系统出错,请联系管理人员", "警告");
  753. }
  754. }
  755. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  756. {
  757. try
  758. {
  759. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  760. if (ugr == null)
  761. return;
  762. this.dataSet5.Clear();
  763. string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
  764. CoreClientParam ccp = new CoreClientParam();
  765. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  766. ccp.MethodName = "findNameByMN";
  767. ccp.ServerParams = new object[] { surface_id };
  768. ccp.SourceDataTable = this.dataSet5.Tables[0];
  769. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  770. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  771. {
  772. if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
  773. {
  774. ugrs.Appearance.BackColor = Color.Pink;
  775. }
  776. }
  777. }
  778. catch (Exception ex)
  779. {
  780. System.Diagnostics.Debug.WriteLine(ex.ToString());
  781. MessageBox.Show("系统出错,请联系管理人员", "警告");
  782. }
  783. }
  784. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  785. {
  786. foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
  787. {
  788. if (checkBox1.Checked)
  789. {
  790. ugr.Cells["CHECK"].Value = "True";
  791. }
  792. else
  793. {
  794. ugr.Cells["CHECK"].Value = "False";
  795. }
  796. }
  797. }
  798. private void ultraTabControl1_Click(object sender, EventArgs e)
  799. {
  800. if (this.ultraTabControl1.Tabs[1].Selected || this.ultraTabControl1.Tabs[2].Selected) //判定记录
  801. {
  802. this.label11.Visible = false;
  803. this.comboBox4.Visible = false;
  804. this.label12.Text = "判定时间";
  805. }
  806. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  807. {
  808. this.label11.Visible = true;
  809. this.comboBox4.Visible = true;
  810. this.label12.Text = "生产时间";
  811. }
  812. }
  813. private void DoExport()
  814. {
  815. try
  816. {
  817. if (this.ultraGrid1.Rows.Count == 0)
  818. {
  819. MessageBox.Show("没有可以导出的数据", "提示");
  820. return;
  821. }
  822. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  823. {
  824. string fName = this.saveFileDialog1.FileName;
  825. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  826. Process.Start(fName);
  827. }
  828. }
  829. catch (Exception ex)
  830. {
  831. System.Diagnostics.Debug.WriteLine(ex.ToString());
  832. }
  833. }
  834. private void button1_Click(object sender, EventArgs e)
  835. {
  836. try
  837. {
  838. int count = 0;
  839. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  840. {
  841. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  842. {
  843. count++;
  844. }
  845. }
  846. List<UltraGridRow> lists = new List<UltraGridRow>();
  847. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  848. {
  849. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  850. {
  851. if (count == 1)
  852. {
  853. ArrayList list1 = new ArrayList();
  854. List<ArrayList> list2 = new List<ArrayList>();
  855. List<ArrayList> list3 = new List<ArrayList>();
  856. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  857. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  858. if (comboBox1.Text.ToString() == "")
  859. {
  860. MessageBox.Show("请输入登记结果!");
  861. return;
  862. }
  863. else
  864. {
  865. if (comboBox1.Text.ToString() == "合格")
  866. {
  867. list1.Add("1");
  868. list1.Add("合格");
  869. }
  870. else if (comboBox1.Text.ToString() == "不合格")
  871. {
  872. list1.Add("2");
  873. list1.Add("不合格");
  874. }
  875. else
  876. {
  877. list1.Add("0");
  878. list1.Add("待判");
  879. }
  880. }
  881. string is_zl = "";
  882. if (comboBox2.Text.ToString() == "正品")
  883. {
  884. is_zl = "512601";
  885. }
  886. else if (comboBox2.Text.ToString() == "次品")
  887. {
  888. is_zl = "512602";
  889. }
  890. else if (comboBox2.Text.ToString() == "废品")
  891. {
  892. is_zl = "512603";
  893. }
  894. else if (comboBox2.Text.ToString() == "协议品")
  895. {
  896. is_zl = "512604";
  897. }
  898. else if (comboBox2.Text.ToString() == "订单外")
  899. {
  900. is_zl = "512605";
  901. }
  902. list1.Add(textBox5.Text.Trim().ToString());
  903. list1.Add(this.UserInfo.GetUserName());
  904. list1.Add(this.UserInfo.GetUserOrderText());
  905. list1.Add(this.UserInfo.GetUserGroupText());
  906. list1.Add(is_zl);//质量等级代码
  907. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  908. foreach (System.Data.DataRow row in dataSet7.Tables[0].Rows)
  909. {
  910. ArrayList list = new ArrayList();
  911. String st = row["bias_code"].ToString();
  912. list.Add(row["bias_code"].ToString());
  913. //if (ugrs.Cells["val"].Text.ToString() == "")
  914. //{
  915. // MessageBox.Show("请输入判定值");
  916. // return;
  917. //}
  918. list.Add(row["val"].ToString());
  919. list.Add(row["bias_name"].ToString());
  920. list.Add(row["plan"].ToString());
  921. list2.Add(list);
  922. }
  923. //ArrayList list = new ArrayList();
  924. //list.Add(ugr.Cells["BIAS_CODE"].Text.ToString());
  925. //list.Add(ugr.Cells["VAL"].Text.ToString());
  926. //list.Add(ugr.Cells["BIAS_NAME"].Text.ToString());
  927. //list.Add(ugr.Cells["PLAN"].Text.ToString());
  928. //list2.Add(list);
  929. //list = new ArrayList();
  930. //list.Add(ugr.Cells["BIAS_CODE_2"].Text.ToString());
  931. //list.Add(ugr.Cells["VAL_2"].Text.ToString());
  932. //list.Add(ugr.Cells["BIAS_NAME_2"].Text.ToString());
  933. //list.Add(ugr.Cells["PLAN_2"].Text.ToString());
  934. //list2.Add(list);
  935. ArrayList listc1 = new ArrayList();
  936. listc1.Add("传动侧");
  937. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  938. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  939. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  940. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  941. list3.Add(listc1);
  942. listc1 = new ArrayList();
  943. listc1.Add("中间");
  944. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  945. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  946. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  947. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  948. list3.Add(listc1);
  949. listc1 = new ArrayList();
  950. listc1.Add("操作侧");
  951. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  952. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  953. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  954. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  955. list3.Add(listc1);
  956. if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
  957. {
  958. MessageBox.Show("检验结果与质量等级不一致!");
  959. return;
  960. }
  961. CoreClientParam ccp = new CoreClientParam();
  962. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  963. ccp.MethodName = "judgeByHuman2";
  964. ccp.ServerParams = new object[] { list1, list2, list3 };
  965. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  966. if (ccp.ReturnCode == -1)
  967. {
  968. return;
  969. }
  970. lists.Add(ugr);
  971. }
  972. else
  973. {
  974. ArrayList list1 = new ArrayList();
  975. List<ArrayList> list3 = new List<ArrayList>();
  976. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  977. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  978. if (comboBox1.Text.ToString() == "")
  979. {
  980. MessageBox.Show("请输入登记结果!");
  981. return;
  982. }
  983. else
  984. {
  985. if (comboBox1.Text.ToString() == "合格")
  986. {
  987. list1.Add("1");
  988. list1.Add("合格");
  989. }
  990. else if (comboBox1.Text.ToString() == "待判")
  991. {
  992. list1.Add("0");
  993. list1.Add("待判");
  994. }
  995. else
  996. {
  997. list1.Add("2");
  998. list1.Add("不合格");
  999. }
  1000. }
  1001. string is_zl = "";
  1002. if (comboBox2.Text.ToString() == "正品")
  1003. {
  1004. is_zl = "512601";
  1005. }
  1006. else if (comboBox2.Text.ToString() == "次品")
  1007. {
  1008. is_zl = "512602";
  1009. }
  1010. else if (comboBox2.Text.ToString() == "废品")
  1011. {
  1012. is_zl = "512603";
  1013. }
  1014. else if (comboBox2.Text.ToString() == "协议品")
  1015. {
  1016. is_zl = "512604";
  1017. }
  1018. else if (comboBox2.Text.ToString() == "订单外")
  1019. {
  1020. is_zl = "512605";
  1021. }
  1022. list1.Add(textBox5.Text.Trim().ToString());
  1023. list1.Add(this.UserInfo.GetUserName());
  1024. list1.Add(this.UserInfo.GetUserOrderText());
  1025. list1.Add(this.UserInfo.GetUserGroupText());
  1026. list1.Add(is_zl);//质量等级代码
  1027. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  1028. ArrayList listc1 = new ArrayList();
  1029. listc1.Add("传动侧");
  1030. listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
  1031. listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
  1032. listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
  1033. listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
  1034. list3.Add(listc1);
  1035. listc1 = new ArrayList();
  1036. listc1.Add("中间");
  1037. listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
  1038. listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
  1039. listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
  1040. listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
  1041. list3.Add(listc1);
  1042. listc1 = new ArrayList();
  1043. listc1.Add("操作侧");
  1044. listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
  1045. listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
  1046. listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
  1047. listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
  1048. list3.Add(listc1);
  1049. if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
  1050. {
  1051. MessageBox.Show("检验结果与质量等级不一致!");
  1052. return;
  1053. }
  1054. CoreClientParam ccp = new CoreClientParam();
  1055. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1056. ccp.MethodName = "judgeByHumanJ";
  1057. ccp.ServerParams = new object[] { list1, list3 };
  1058. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1059. if (ccp.ReturnCode == -1)
  1060. {
  1061. return;
  1062. }
  1063. lists.Add(ugr);
  1064. }
  1065. }
  1066. }
  1067. for (int i = 0; i < lists.Count; i++)
  1068. {
  1069. lists[i].Delete(false);
  1070. }
  1071. MessageBox.Show("检验登记成功!");
  1072. }
  1073. catch (Exception EX)
  1074. {
  1075. MessageBox.Show(EX.ToString());
  1076. }
  1077. //DoQuery();
  1078. }
  1079. private void ultraGrid4_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1080. {
  1081. }
  1082. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1083. {
  1084. try
  1085. {
  1086. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  1087. if (ugr == null)
  1088. return;
  1089. this.dataSet10.Clear();
  1090. string sic = ugr.Cells["SIC_ID"].Value.ToString();
  1091. CoreClientParam ccp = new CoreClientParam();
  1092. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1093. ccp.MethodName = "getToleranceInfoNew";
  1094. ccp.ServerParams = new object[] { sic };
  1095. ccp.SourceDataTable = this.dataSet10.Tables[0];
  1096. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1097. this.dataSet8.Clear();
  1098. ccp = new CoreClientParam();
  1099. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1100. ccp.MethodName = "getQcmJudgeMeasureJ";
  1101. ccp.ServerParams = new object[] { sic };
  1102. ccp.SourceDataTable = this.dataSet8.Tables[0];
  1103. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1104. }
  1105. catch (Exception ex)
  1106. {
  1107. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1108. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1109. }
  1110. }
  1111. private void ultraGrid2_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1112. {
  1113. }
  1114. }
  1115. }