QCM030614.cs 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282
  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 System.Collections;
  10. using CoreFS.CA06;
  11. using Infragistics.Win;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Diagnostics;
  14. using System.Text.RegularExpressions;
  15. namespace Core.LZMes.Client.QCM
  16. {
  17. public partial class QCM030614 :FrmBase
  18. {
  19. public QCM030614()
  20. {
  21. InitializeComponent();
  22. }
  23. public override void ToolBar_Click(object sender, string ToolbarKey)
  24. {
  25. switch (ToolbarKey)
  26. {
  27. case "Query":
  28. this.DoQuery();
  29. break;
  30. case "Judge":
  31. this.Judge();
  32. break;
  33. case "Q_Judge":
  34. this.Q_Judge();
  35. break;
  36. case "Cancel":
  37. this.canceljudge();
  38. break;
  39. case "Exit":
  40. this.Close();
  41. break;
  42. case "Export":
  43. this.DoExport();
  44. break;
  45. case "Pass":
  46. this.pass();
  47. break;
  48. case "C":
  49. this.C();
  50. break;
  51. case "P":
  52. this.P();
  53. break;
  54. case "Lock":
  55. this.locked();
  56. break;
  57. }
  58. }
  59. private void locked()
  60. {
  61. try
  62. {
  63. foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
  64. {
  65. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  66. string username = this.UserInfo.GetUserName();
  67. CoreClientParam ccp = new CoreClientParam();
  68. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  69. ccp.MethodName = "JudgeLocking";
  70. ccp.ServerParams = new object[] { material_no, username };
  71. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  72. }
  73. MessageBox.Show("异常材锁定成功!");
  74. }
  75. catch (Exception EX)
  76. {
  77. MessageBox.Show(EX.ToString());
  78. }
  79. }
  80. private void pass()
  81. {
  82. try
  83. {
  84. QCM030607 frm = new QCM030607();
  85. if (frm.ShowDialog() == DialogResult.OK)
  86. {
  87. string remark = frm._memo;
  88. List<UltraGridRow> lists = new List<UltraGridRow>();
  89. foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
  90. {
  91. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  92. string username = this.UserInfo.GetUserName();
  93. CoreClientParam ccp = new CoreClientParam();
  94. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  95. ccp.MethodName = "ultimateJudgeAutoByHuman";
  96. ccp.ServerParams = new object[] { material_no, username, remark, "1" };
  97. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  98. if (ccp.ReturnCode == -1)
  99. {
  100. return;
  101. }
  102. lists.Add(ugr);
  103. }
  104. for (int i = 0; i < lists.Count; i++)
  105. {
  106. lists[i].Delete(false);
  107. }
  108. MessageBox.Show("判定成功!");
  109. }
  110. }
  111. catch (Exception EX)
  112. {
  113. MessageBox.Show(EX.ToString());
  114. }
  115. }
  116. private void C()
  117. {
  118. try
  119. {
  120. QCM030607 frm = new QCM030607();
  121. if (frm.ShowDialog() == DialogResult.OK)
  122. {
  123. string remark = frm._memo;
  124. List<UltraGridRow> lists = new List<UltraGridRow>();
  125. foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
  126. {
  127. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  128. string username = this.UserInfo.GetUserName();
  129. CoreClientParam ccp = new CoreClientParam();
  130. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  131. ccp.MethodName = "ultimateJudgeAutoByHuman";
  132. ccp.ServerParams = new object[] { material_no, username, remark, "3" };
  133. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  134. if (ccp.ReturnCode == -1)
  135. {
  136. return;
  137. }
  138. lists.Add(ugr);
  139. }
  140. for (int i = 0; i < lists.Count; i++)
  141. {
  142. lists[i].Delete(false);
  143. }
  144. MessageBox.Show("判定成功!");
  145. }
  146. }
  147. catch (Exception EX)
  148. {
  149. MessageBox.Show(EX.ToString());
  150. }
  151. }
  152. private void P()
  153. {
  154. try
  155. {
  156. QCM030607 frm = new QCM030607();
  157. if (frm.ShowDialog() == DialogResult.OK)
  158. {
  159. string remark = frm._memo;
  160. List<UltraGridRow> lists = new List<UltraGridRow>();
  161. foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
  162. {
  163. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  164. string username = this.UserInfo.GetUserName();
  165. CoreClientParam ccp = new CoreClientParam();
  166. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  167. ccp.MethodName = "ultimateJudgeAutoByHuman";
  168. ccp.ServerParams = new object[] { material_no, username, remark, "4" };
  169. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  170. if (ccp.ReturnCode == -1)
  171. {
  172. return;
  173. }
  174. lists.Add(ugr);
  175. }
  176. for (int i = 0; i < lists.Count; i++)
  177. {
  178. lists[i].Delete(false);
  179. }
  180. MessageBox.Show("判定成功!");
  181. }
  182. }
  183. catch (Exception EX)
  184. {
  185. MessageBox.Show(EX.ToString());
  186. }
  187. }
  188. private void Judge()
  189. {
  190. try
  191. {
  192. if (this.ultraGrid1.Selected.Rows.Count == 0)
  193. this.ultraGrid1.ActiveRow.Selected = true;
  194. List<UltraGridRow> lists = new List<UltraGridRow>();
  195. foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
  196. {
  197. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  198. string username = this.UserInfo.GetUserName();
  199. CoreClientParam ccp = new CoreClientParam();
  200. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  201. ccp.MethodName = "ultimateJudgeAuto";
  202. ccp.ServerParams = new object[] { material_no, username,"" };
  203. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  204. if (ccp.ReturnCode == -1)
  205. {
  206. return;
  207. }
  208. lists.Add(ugr);
  209. }
  210. for (int i = 0; i < lists.Count; i++)
  211. {
  212. lists[i].Delete(false);
  213. }
  214. MessageBox.Show("判定成功!");
  215. }
  216. catch (Exception EX)
  217. {
  218. MessageBox.Show(EX.ToString());
  219. }
  220. }
  221. private void Q_Judge()
  222. {
  223. try
  224. {
  225. if (this.ultraGrid1.Selected.Rows.Count == 0)
  226. this.ultraGrid1.ActiveRow.Selected = true;
  227. List<UltraGridRow> lists = new List<UltraGridRow>();
  228. foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
  229. {
  230. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  231. string username = this.UserInfo.GetUserName();
  232. CoreClientParam ccp = new CoreClientParam();
  233. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  234. ccp.MethodName = "ultimateJudgeAutoQZ";
  235. ccp.ServerParams = new object[] { material_no, username };
  236. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  237. if (ccp.ReturnCode == -1)
  238. {
  239. return;
  240. }
  241. lists.Add(ugr);
  242. }
  243. for (int i = 0; i < lists.Count; i++)
  244. {
  245. lists[i].Delete(false);
  246. }
  247. MessageBox.Show("强制判定成功!");
  248. }
  249. catch (Exception EX)
  250. {
  251. MessageBox.Show(EX.ToString());
  252. }
  253. }
  254. private void canceljudge()
  255. {
  256. try
  257. {
  258. QCM030607 frm = new QCM030607();
  259. if (frm.ShowDialog() == DialogResult.OK)
  260. {
  261. string remark = frm._memo;
  262. if (remark == "")
  263. {
  264. MessageBox.Show("请录入备注信息!");
  265. return;
  266. }
  267. if (this.ultraGrid18.Selected.Rows.Count == 0)
  268. this.ultraGrid18.ActiveRow.Selected = true;
  269. foreach (UltraGridRow ugr in this.ultraGrid18.Rows)
  270. {
  271. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  272. {
  273. string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString();
  274. string username = this.UserInfo.GetUserName();
  275. string utm_id = ugr.Cells["UTM_ID"].Value.ToString();
  276. CoreClientParam ccp = new CoreClientParam();
  277. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  278. ccp.MethodName = "cancelUltimateJudge";
  279. ccp.ServerParams = new object[] { username, MATERIAL_NO, utm_id,remark };
  280. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  281. if (ccp.ReturnCode == -1)
  282. {
  283. return;
  284. }
  285. }
  286. }
  287. MessageBox.Show("取消判定成功!");
  288. }
  289. }
  290. catch (Exception EX)
  291. {
  292. MessageBox.Show(EX.ToString());
  293. }
  294. }
  295. private void DoQuery()
  296. {
  297. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  298. {
  299. DoQueryMe();
  300. }
  301. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  302. {
  303. DoQueryRe();
  304. }
  305. }
  306. //查询待判信息
  307. private void DoQueryMe()
  308. {
  309. try
  310. {
  311. this.dataSet1.Clear();
  312. string ebatchno = "";
  313. string bbatchno = textBox4.Text.Trim();
  314. if (textBox2.Text.ToString() == "")
  315. {
  316. ebatchno = this.textBox4.Text.Trim();
  317. }
  318. else
  319. {
  320. ebatchno = textBox2.Text.Trim();
  321. }
  322. string design_key = textBox1.Text.Trim();
  323. string psc = textBox3.Text.Trim();
  324. string cert_inst_name = this.comboBox1.Text.ToString();
  325. string prodline = comboBox3.Text.ToString();
  326. string heat_no = this.textBox5.Text.ToString();
  327. CoreClientParam ccp = new CoreClientParam();
  328. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  329. ccp.MethodName = "GetUnjudgeInfoJ2N";
  330. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), bbatchno, ebatchno, design_key, psc, prodline, cert_inst_name,heat_no };
  331. ccp.SourceDataTable = this.dataSet1.Tables[0];
  332. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  333. }
  334. catch (Exception ex)
  335. {
  336. System.Diagnostics.Debug.WriteLine(ex.ToString());
  337. MessageBox.Show("系统出错,请联系管理人员", "警告");
  338. }
  339. }
  340. //查询判定记录
  341. private void DoQueryRe()
  342. {
  343. try
  344. {
  345. this.dataSet2.Clear();
  346. string ebatchno = "";
  347. string bbatchno = textBox4.Text.Trim();
  348. if (textBox2.Text.ToString() == "")
  349. {
  350. ebatchno = this.textBox4.Text.Trim();
  351. }
  352. else
  353. {
  354. ebatchno = textBox2.Text.Trim();
  355. }
  356. string design_key = textBox1.Text.Trim();
  357. string psc = textBox3.Text.Trim();
  358. string cert_inst_name = this.comboBox1.Text.ToString();
  359. string prodline = comboBox3.Text.ToString();
  360. string heat_no = this.textBox5.Text.ToString();
  361. CoreClientParam ccp = new CoreClientParam();
  362. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  363. ccp.MethodName = "GetjudgeInfoJLZ";
  364. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), bbatchno, ebatchno, design_key, psc, prodline, cert_inst_name,heat_no };
  365. ccp.SourceDataTable = this.dataSet2.Tables[0];
  366. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  367. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  368. //{
  369. // foreach (UltraGridRow ugr2 in this.ultraGrid18.Rows)
  370. // {
  371. // if (ugr2.Cells["ISVALID"].Value.ToString() == "是 ")
  372. // {
  373. // ugr2.Cells["ISVALID"].Appearance.BackColor = Color.FromArgb(185, 235, 204);
  374. // ugr2.Cells["ISVALID"].Appearance.ForeColor = Color.Black;
  375. // }
  376. // else
  377. // {
  378. // ugr2.Cells["ISVALID"].Appearance.BackColor = Color.FromArgb(249, 198, 186);
  379. // ugr2.Cells["ISVALID"].Appearance.ForeColor = Color.Black;
  380. // }
  381. // }
  382. //}
  383. }
  384. catch (Exception ex)
  385. {
  386. System.Diagnostics.Debug.WriteLine(ex.ToString());
  387. MessageBox.Show("系统出错,请联系管理人员", "警告");
  388. }
  389. }
  390. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  391. {
  392. this.dataSet18.Clear();
  393. UltraGridRow ugr1 = this.ultraGrid1.ActiveRow;
  394. ArrayList list = new ArrayList();
  395. //成分
  396. ArrayList al = new ArrayList();
  397. string cic_id = ugr1.Cells["R_CHEMID"].Value.ToString();
  398. if (ugr1.Cells["R_CHEMRESULT_DESC"].Value.ToString() != "")
  399. {
  400. CoreClientParam ccp1 = new CoreClientParam();
  401. ccp1.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  402. ccp1.MethodName = "GetChemeOrd";
  403. ccp1.ServerParams = new object[] { cic_id };
  404. //ccp1.ReturnObject = "";
  405. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  406. //ArrayList deskey = ccp1.ReturnObject as ArrayList;
  407. string design_key = ccp1.ReturnObject.ToString();
  408. string ord_no = design_key.Substring(0,design_key.Length-3);
  409. string ord_seq = design_key.Substring(design_key.Length - 3);
  410. list.Add(al);
  411. al.Add("UIB030220_CHEM.SELECT");
  412. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  413. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  414. /*al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  415. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);*/
  416. al.Add(ord_no);
  417. al.Add(ord_seq);
  418. }
  419. else
  420. {
  421. list.Add(al);
  422. al.Add("UIB030220_CHEM.SELECT");
  423. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  424. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  425. al.Add("");
  426. al.Add("");
  427. }
  428. //材质
  429. al = new ArrayList();
  430. list.Add(al);
  431. if (ugr1.Cells["PHYSRESULT_DESC"].Value.ToString() != "")
  432. {
  433. al.Add("UIB030110_036N.SELECT");
  434. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  435. }
  436. else
  437. {
  438. al.Add("UIB030110_036N.SELECT");
  439. al.Add("");
  440. }
  441. //其它
  442. /*al = new ArrayList();
  443. list.Add(al);
  444. al.Add("UIB030110_OTHERS.SELECT");
  445. al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Text);//厚度
  446. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  447. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  448. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  449. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  450. al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Text);//宽度
  451. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  452. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  453. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  454. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  455. al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_INDIA"].Text);//内径
  456. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  457. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  458. al.Add(this.ultraGrid1.ActiveRow.Cells["ACT_WGT"].Text);//重量
  459. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  460. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  461. al.Add(this.ultraGrid1.ActiveRow.Cells["EXTSHAPE_QUALITY"].Text);//外观
  462. al.Add(this.ultraGrid1.ActiveRow.Cells["CR_DK1"].Text);//缺陷
  463. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  464. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  465. al.Add(this.ultraGrid1.ActiveRow.Cells["PACKAGE_LEVEL"].Text);//包装
  466. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  467. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);
  468. al.Add(this.ultraGrid1.ActiveRow.Cells["PROC_DEC_RST"].Text);//切边
  469. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  470. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);*/
  471. //this.dataSet1.Tables[1].Clear();
  472. CoreClientParam ccp = new CoreClientParam();
  473. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  474. ccp.MethodName = "doContinuousQluery";
  475. ccp.ServerParams = new object[] { list };
  476. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  477. if (ccpList.ReturnInfo.Length == 0)
  478. {
  479. ArrayList aList = ccpList.ReturnObject as ArrayList;
  480. if (aList[0] != null)
  481. {
  482. this.dataSet18.Tables["ingr"].Clear();
  483. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet18.Tables["ingr"]);
  484. tab0.TableName = "ingr";
  485. this.dataSet18.Tables["ingr"].Merge(tab0);
  486. }
  487. if (aList[1] != null)
  488. {
  489. this.dataSet18.Tables["qlty"].Clear();
  490. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet18.Tables["qlty"]);
  491. tab0.TableName = "qlty";
  492. this.dataSet18.Tables["qlty"].Merge(tab0);
  493. }
  494. /*if (aList[2] != null)
  495. {
  496. this.dataSet18.Tables["other"].Clear();
  497. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[2] as System.Collections.ArrayList, this.dataSet18.Tables["other"]);
  498. tab0.TableName = "other";
  499. this.dataSet18.Tables["other"].Merge(tab0);
  500. }*/
  501. }//end else if
  502. this.dataSet18.Tables["other"].Clear();
  503. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  504. ccp.MethodName = "getToleranceInfoLZOther";
  505. ccp.ServerParams = new object[] { ugr1.Cells["SIZEID"].Text, ugr1.Cells["COIL_THK"].Text,
  506. ugr1.Cells["COIL_WTH"].Text, ugr1.Cells["COIL_INDIA"].Text,ugr1.Cells["SURFACEID"].Text,ugr1.Cells["ORD_NO"].Text,
  507. ugr1.Cells["ORD_SEQ"].Text,ugr1.Cells["PACKAGE_LEVEL"].Text,ugr1.Cells["ACT_WGT"].Text,ugr1.Cells["PROC_DEC_RST"].Text,
  508. ugr1.Cells["CR_DK1"].Text,ugr1.Cells["EXTSHAPE_QUALITY"].Text };
  509. ccp.SourceDataTable = this.dataSet18.Tables["other"];
  510. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  511. //成分判断
  512. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  513. {
  514. double min = Convert.ToDouble(ugr.Cells["CHEM_MIN"].Text == "" ? "0" : ugr.Cells["CHEM_MIN"].Text);
  515. double max = Convert.ToDouble(ugr.Cells["CHEM_MAX"].Text == "" ? "9999" : ugr.Cells["CHEM_MAX"].Text);
  516. double value = Convert.ToDouble(ugr.Cells["CHEM_VAL"].Text == "" ? "-1" : ugr.Cells["CHEM_VAL"].Text);
  517. if (value < min || value > max)
  518. {
  519. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  520. }
  521. if (value == -1)//缺少实际值
  522. {
  523. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  524. }
  525. }
  526. //材质判断
  527. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  528. {
  529. if ((IsNumberal(ugr.Cells["QLTY_MIN"].Text) == true) || (IsNumberal(ugr.Cells["QLTY_MAX"].Text) == true))
  530. {
  531. double min = Convert.ToDouble(ugr.Cells["QLTY_MIN"].Text == "" ? "0" : ugr.Cells["QLTY_MIN"].Text);
  532. double max = Convert.ToDouble(ugr.Cells["QLTY_MAX"].Text == "" ? "9999" : ugr.Cells["QLTY_MAX"].Text);
  533. double value = Convert.ToDouble(ugr.Cells["QLTY_VAL_WK"].Text == "" ? "-1" : ugr.Cells["QLTY_VAL_WK"].Text);
  534. if (value < min || value > max)
  535. {
  536. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  537. }
  538. if (value == -1)//缺少实际值
  539. {
  540. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  541. }
  542. }
  543. else
  544. {
  545. string min = ugr.Cells["QLTY_MIN"].Text.ToString();
  546. string value = ugr.Cells["QLTY_VAL_WK"].Text.ToString();
  547. if (!value.Equals(min))
  548. {
  549. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  550. }
  551. if (value == "")
  552. {
  553. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  554. }
  555. }
  556. }
  557. //其它判断
  558. foreach (UltraGridRow ugr in this.ultraGrid5.Rows)
  559. {
  560. string name = ugr.Cells["T_NAME"].Text.Trim();
  561. if ("外观" == name)
  562. {
  563. //不相等显示红色
  564. string waiguan = ugr.Cells["T_MIN"].Text;
  565. if (waiguan != null && waiguan != "" && !waiguan.Equals("0") && String.Compare(waiguan, ugr.Cells["T_VALUE"].Text) > 0)
  566. {
  567. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  568. }
  569. continue;
  570. }
  571. else if ("内径" == name)
  572. {
  573. //不相等显示红色
  574. string india = ugr.Cells["T_MIN"].Text;
  575. if (india != null && india != "" && !india.Equals("0") && !india.Equals(ugr.Cells["T_VALUE"].Text))
  576. {
  577. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  578. }
  579. continue;
  580. }
  581. else if ("包装" == name)
  582. {
  583. if ("不包装".Equals(ugr.Cells["T_MIN"].Text) && "XX".Equals(ugr.Cells["T_VALUE"].Text))
  584. { }
  585. else
  586. {
  587. //不相等显示红色
  588. if (!ugr.Cells["T_MIN"].Text.Equals(ugr.Cells["T_VALUE"].Text))
  589. {
  590. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  591. }
  592. }
  593. continue;
  594. }
  595. else if ("切边" == name)
  596. {
  597. if ("Y".Equals(ugr.Cells["T_MIN"].Text) && "2".Equals(ugr.Cells["T_VALUE"].Text))
  598. {
  599. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  600. }
  601. continue;
  602. }
  603. if ((IsNumberal(ugr.Cells["T_MIN"].Text) == true) || (IsNumberal(ugr.Cells["T_MAX"].Text) == true))
  604. {
  605. double min = Convert.ToDouble(ugr.Cells["T_MIN"].Text == "" ? "0" : ugr.Cells["T_MIN"].Text);
  606. double max = Convert.ToDouble(ugr.Cells["T_MAX"].Text == "" ? "9999" : ugr.Cells["T_MAX"].Text);
  607. double value = Convert.ToDouble(ugr.Cells["T_VALUE"].Text == "" ? "-1" : ugr.Cells["T_VALUE"].Text);
  608. if (value < min || value > max)
  609. {
  610. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  611. }
  612. if (value == -1)//缺少实际值
  613. {
  614. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  615. }
  616. }
  617. /*else
  618. {
  619. string min = ugr.Cells["T_MIN"].Text.ToString();
  620. string value = ugr.Cells["T_VALUE"].Text.ToString();
  621. if (!value.Equals(min))
  622. {
  623. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  624. }
  625. if (value == "")
  626. {
  627. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  628. }
  629. }*/
  630. }
  631. }
  632. private void DoQueryD()
  633. {
  634. }
  635. public static bool IsNumberal(string input)
  636. {
  637. bool flag = true;
  638. int count = 0;
  639. int count1 = 0;
  640. if (input.Length == 0)
  641. {
  642. flag = false;
  643. }
  644. else
  645. {
  646. char[] x = input.ToCharArray();
  647. for (int i = 0; i < input.Length; i++)
  648. {
  649. if (!char.IsNumber(x[i]) && x[i] != '.'&&x[i] != '-')
  650. {
  651. flag = false; break;
  652. }
  653. if (x[i] == '.')
  654. {
  655. count++;
  656. if (i == 0 || i == input.Length - 1) flag = false;
  657. }
  658. if (x[i] == '-')
  659. {
  660. count1++;
  661. if (i >1) flag = false;
  662. }
  663. }
  664. if (count > 1 || count1 > 1) flag = false;
  665. }
  666. return flag;
  667. }
  668. private static bool ishz(string text)
  669. {
  670. if (Regex.IsMatch(text, @"[\u4e00-\u9fa5]"))
  671. {
  672. return true;
  673. }
  674. else
  675. {
  676. return false;
  677. }
  678. }
  679. private void DoQueryP()
  680. {
  681. try
  682. {
  683. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  684. if (ugr == null)
  685. return;
  686. this.dataSet11.Clear();
  687. if (ugr.Cells["PHYSID"].Text.ToString() == "")
  688. {
  689. return;
  690. }
  691. string pic_id = ugr.Cells["PHYSID"].Value.ToString();
  692. CoreClientParam ccp = new CoreClientParam();
  693. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  694. ccp.MethodName = "querryJudgeResult";
  695. ccp.ServerParams = new object[] { pic_id };
  696. ccp.SourceDataTable = this.dataSet11.Tables[1];
  697. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  698. ccp = new CoreClientParam();
  699. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  700. ccp.MethodName = "querryJudgetItem";
  701. ccp.ServerParams = new object[] { pic_id };
  702. ccp.SourceDataTable = this.dataSet11.Tables[0];
  703. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  704. foreach (UltraGridRow ugr1 in this.ultraGrid4.Rows)
  705. {
  706. foreach (UltraGridRow ugrs in ugr1.ChildBands[0].Rows)
  707. {
  708. if (ugrs.Cells["defect_flag"].Value.ToString() == "是")
  709. {
  710. ugrs.Cells["defect_flag"].Appearance.ForeColor = Color.Red;
  711. }
  712. if (ugrs.Cells["isjudge"].Value.ToString() == "是")
  713. {
  714. if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定")
  715. {
  716. if (ugrs.Cells["val1"].Text.ToString() == "")
  717. {
  718. ugrs.Cells["val1"].Appearance.BackColor = Color.Yellow;
  719. }
  720. }
  721. else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值")
  722. {
  723. if (ugrs.Cells["avg_val"].Text.ToString() == "")
  724. {
  725. ugrs.Cells["avg_val"].Appearance.BackColor = Color.Yellow;
  726. }
  727. }
  728. }
  729. if (ugrs.Cells["isjudge"].Value.ToString() == "是")
  730. {
  731. if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定")
  732. {
  733. DataTable dt = new DataTable();
  734. if (IsNumberal(ugrs.Cells["val1"].Value.ToString()))
  735. {
  736. if (ishz(ugrs.Cells["jf_stdmin"].Value.ToString()) || ishz(ugrs.Cells["jf_stdmax"].Value.ToString()))
  737. {
  738. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  739. }
  740. else
  741. {
  742. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val1"].Value.ToString() + ugrs.Cells["jf_stdmin"].Value.ToString(), ""))
  743. {
  744. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  745. }
  746. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val1"].Value.ToString() + ugrs.Cells["jf_stdmax"].Value.ToString(), ""))
  747. {
  748. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  749. }
  750. }
  751. }
  752. else
  753. {
  754. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "="+ ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmin"].Value.ToString())
  755. {
  756. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  757. }
  758. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "="+ ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmax"].Value.ToString())
  759. {
  760. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  761. }
  762. }
  763. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val2"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val2"].Value.ToString() + ugrs.Cells["jf_stdmin"].Value.ToString(), ""))
  764. {
  765. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  766. }
  767. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val2"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val2"].Value.ToString() + ugrs.Cells["jf_stdmax"].Value.ToString(), ""))
  768. {
  769. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  770. }
  771. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val3"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val3"].Value.ToString() + ugrs.Cells["jf_stdmin"].Value.ToString(), ""))
  772. {
  773. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  774. }
  775. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val3"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val3"].Value.ToString() + ugrs.Cells["jf_stdmax"].Value.ToString(), ""))
  776. {
  777. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  778. }
  779. if (ugrs.Cells["nk_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val1"].Value.ToString() + ugrs.Cells["nk_stdmin"].Value.ToString(), ""))
  780. {
  781. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  782. }
  783. if (ugrs.Cells["nk_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val1"].Value.ToString() + ugrs.Cells["nk_stdmax"].Value.ToString(), ""))
  784. {
  785. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  786. }
  787. if (ugrs.Cells["nk_stdmin"].Value.ToString() != "" && ugrs.Cells["val2"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val2"].Value.ToString() + ugrs.Cells["nk_stdmin"].Value.ToString(), ""))
  788. {
  789. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  790. }
  791. if (ugrs.Cells["nk_stdmax"].Value.ToString() != "" && ugrs.Cells["val2"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val2"].Value.ToString() + ugrs.Cells["nk_stdmax"].Value.ToString(), ""))
  792. {
  793. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  794. }
  795. if (ugrs.Cells["nk_stdmin"].Value.ToString() != "" && ugrs.Cells["val3"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val3"].Value.ToString() + ugrs.Cells["nk_stdmin"].Value.ToString(), ""))
  796. {
  797. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  798. }
  799. if (ugrs.Cells["nk_stdmax"].Value.ToString() != "" && ugrs.Cells["val3"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val3"].Value.ToString() + ugrs.Cells["nk_stdmax"].Value.ToString(), ""))
  800. {
  801. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  802. }
  803. if (ugrs.Cells["kh_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val1"].Value.ToString() + ugrs.Cells["kh_stdmin"].Value.ToString(), ""))
  804. {
  805. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  806. }
  807. if (ugrs.Cells["kh_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val1"].Value.ToString() + ugrs.Cells["kh_stdmax"].Value.ToString(), ""))
  808. {
  809. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  810. }
  811. if (ugrs.Cells["kh_stdmin"].Value.ToString() != "" && ugrs.Cells["val2"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val2"].Value.ToString() + ugrs.Cells["kh_stdmin"].Value.ToString(), ""))
  812. {
  813. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  814. }
  815. if (ugrs.Cells["kh_stdmax"].Value.ToString() != "" && ugrs.Cells["val2"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val2"].Value.ToString() + ugrs.Cells["kh_stdmax"].Value.ToString(), ""))
  816. {
  817. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  818. }
  819. if (ugrs.Cells["kh_stdmin"].Value.ToString() != "" && ugrs.Cells["val3"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val3"].Value.ToString() + ugrs.Cells["kh_stdmin"].Value.ToString(), ""))
  820. {
  821. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  822. }
  823. if (ugrs.Cells["kh_stdmax"].Value.ToString() != "" && ugrs.Cells["val3"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["val3"].Value.ToString() + ugrs.Cells["kh_stdmax"].Value.ToString(), ""))
  824. {
  825. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  826. }
  827. }
  828. else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值")
  829. {
  830. DataTable dt = new DataTable();
  831. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["avg_val"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["avg_val"].Value.ToString() + ugrs.Cells["jf_stdmin"].Value.ToString(), ""))
  832. {
  833. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  834. }
  835. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["avg_val"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["avg_val"].Value.ToString() + ugrs.Cells["jf_stdmax"].Value.ToString(), ""))
  836. {
  837. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  838. }
  839. if (ugrs.Cells["kh_stdmin"].Value.ToString() != "" && ugrs.Cells["avg_val"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["avg_val"].Value.ToString() + ugrs.Cells["kh_stdmin"].Value.ToString(), ""))
  840. {
  841. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  842. }
  843. if (ugrs.Cells["kh_stdmax"].Value.ToString() != "" && ugrs.Cells["avg_val"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["avg_val"].Value.ToString() + ugrs.Cells["kh_stdmax"].Value.ToString(), ""))
  844. {
  845. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  846. }
  847. if (ugrs.Cells["nk_stdmin"].Value.ToString() != "" && ugrs.Cells["avg_val"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["avg_val"].Value.ToString() + ugrs.Cells["nk_stdmin"].Value.ToString(), ""))
  848. {
  849. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  850. }
  851. if (ugrs.Cells["nk_stdmax"].Value.ToString() != "" && ugrs.Cells["avg_val"].Value.ToString() != "" && !(bool)dt.Compute(ugrs.Cells["avg_val"].Value.ToString() + ugrs.Cells["nk_stdmax"].Value.ToString(), ""))
  852. {
  853. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  854. }
  855. }
  856. }
  857. }
  858. }
  859. }
  860. catch (Exception ex)
  861. {
  862. System.Diagnostics.Debug.WriteLine(ex.ToString());
  863. MessageBox.Show("系统出错,请联系管理人员", "警告");
  864. }
  865. }
  866. private void QCM030614_Load(object sender, EventArgs e)
  867. {
  868. ValueList vsflv = new ValueList();
  869. CoreClientParam ccp = new CoreClientParam();
  870. ccp = new CoreClientParam();
  871. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  872. ccp.MethodName = "findCretInstName";
  873. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  874. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  875. {
  876. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["CERT_INST_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["CERT_INST_NAME"].ToString());
  877. }
  878. this.comboBox1.DataSource = vsflv.ValueListItems;
  879. this.comboBox3.SelectedIndex = 0;
  880. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  881. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  882. this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  883. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  884. //this.DoQuery();
  885. }
  886. private void ultraGrid12_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  887. {
  888. }
  889. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  890. {
  891. SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked);
  892. SetFilterUIType(this.ultraGrid18, this.checkBox1.Checked);
  893. SetFilterUIType(this.ultraGrid4, this.checkBox1.Checked);
  894. SetFilterUIType(this.ultraGrid5, this.checkBox1.Checked);
  895. SetFilterUIType(this.ultraGrid16, this.checkBox1.Checked);
  896. SetFilterUIType(this.ultraGrid7, this.checkBox1.Checked);
  897. SetFilterUIType(this.ultraGrid11, this.checkBox1.Checked);
  898. SetFilterUIType(this.ultraGrid12, this.checkBox1.Checked);
  899. SetFilterUIType(this.ultraGrid13, this.checkBox1.Checked);
  900. SetFilterUIType(this.ultraGrid14, this.checkBox1.Checked);
  901. SetFilterUIType(this.ultraGrid15, this.checkBox1.Checked);
  902. }
  903. private void SetFilterUIType(UltraGrid grid, bool checkType)
  904. {
  905. if (checkType)
  906. {
  907. grid.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  908. }
  909. else
  910. {
  911. grid.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters();
  912. grid.DisplayLayout.Override.FilterUIType = FilterUIType.Default;
  913. }
  914. }
  915. private void ultraTabControl1_Click(object sender, EventArgs e)
  916. {
  917. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  918. {
  919. this.label6.Text = "判定时间";
  920. }
  921. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  922. {
  923. this.label6.Text = "生产时间";
  924. }
  925. }
  926. private void DoExport()
  927. {
  928. try
  929. {
  930. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  931. {
  932. if (this.ultraGrid1.Rows.Count == 0)
  933. {
  934. MessageBox.Show("没有可以导出的数据", "提示");
  935. return;
  936. }
  937. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  938. {
  939. string fName = this.saveFileDialog1.FileName;
  940. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  941. Process.Start(fName);
  942. }
  943. }
  944. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  945. {
  946. if (this.ultraGrid18.Rows.Count == 0)
  947. {
  948. MessageBox.Show("没有可以导出的数据", "提示");
  949. return;
  950. }
  951. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  952. {
  953. string fName = this.saveFileDialog1.FileName;
  954. this.ultraGridExcelExporter1.Export(this.ultraGrid18, fName);
  955. Process.Start(fName);
  956. }
  957. }
  958. }
  959. catch (Exception ex)
  960. {
  961. System.Diagnostics.Debug.WriteLine(ex.ToString());
  962. }
  963. }
  964. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  965. {
  966. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  967. {
  968. foreach (UltraGridRow ugr in this.ultraGrid1.Rows.Where(p => p.IsFilteredOut == false).ToList())
  969. {
  970. if (checkBox2.Checked)
  971. {
  972. ugr.Selected = true;
  973. }
  974. else
  975. {
  976. ugr.Selected = false;
  977. }
  978. }
  979. }
  980. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  981. {
  982. foreach (UltraGridRow ugr in this.ultraGrid18.Rows.Where(p => p.IsFilteredOut == false).ToList())
  983. {
  984. if (checkBox2.Checked)
  985. {
  986. ugr.Cells["CHECK"].Value = "True";
  987. }
  988. else
  989. {
  990. ugr.Cells["CHECK"].Value = "False";
  991. }
  992. }
  993. }
  994. }
  995. private void ultraGrid18_AfterRowActivate(object sender, EventArgs e)
  996. {
  997. this.dataSet18.Clear();
  998. UltraGridRow ugr1 = this.ultraGrid18.ActiveRow;
  999. ArrayList list = new ArrayList();
  1000. //成分
  1001. ArrayList al = new ArrayList();
  1002. list.Add(al);
  1003. al.Add("UIB030220_CHEM.SELECT");
  1004. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1005. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1006. al.Add(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(0,this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3));
  1007. al.Add(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3));
  1008. //材质
  1009. al = new ArrayList();
  1010. list.Add(al);
  1011. /*if (ugr1.Cells["PHYSRESULT_DESC"].Value.ToString() != "")
  1012. {*/
  1013. al.Add("UIB030110_036N.SELECT");
  1014. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  1015. /*}
  1016. else
  1017. {
  1018. al.Add("UIB030110_036N.SELECT");
  1019. al.Add("");
  1020. al.Add("");
  1021. }*/
  1022. //其它
  1023. /*al = new ArrayList();
  1024. list.Add(al);
  1025. al.Add("UIB030110_OTHERS.SELECT");
  1026. al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_THK"].Text);//厚度
  1027. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1028. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1029. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1030. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1031. al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_WTH"].Text);//宽度
  1032. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1033. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1034. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1035. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1036. al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_INDIA"].Text);//内径
  1037. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1038. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1039. al.Add(this.ultraGrid18.ActiveRow.Cells["ACT_WGT"].Text);//重量
  1040. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1041. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1042. al.Add(this.ultraGrid18.ActiveRow.Cells["EXTSHAPE_QUALITY"].Text);//外观
  1043. al.Add(this.ultraGrid18.ActiveRow.Cells["CR_DK1"].Text);//缺陷
  1044. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1045. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1046. al.Add(this.ultraGrid18.ActiveRow.Cells["PACKAGE_LEVEL"].Text);//包装
  1047. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1048. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1049. al.Add(this.ultraGrid18.ActiveRow.Cells["PROC_DEC_RST"].Text);//切边
  1050. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1051. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);*/
  1052. //this.dataSet1.Tables[1].Clear();
  1053. CoreClientParam ccp = new CoreClientParam();
  1054. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  1055. ccp.MethodName = "doContinuousQluery";
  1056. ccp.ServerParams = new object[] { list };
  1057. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  1058. if (ccpList.ReturnInfo.Length == 0)
  1059. {
  1060. ArrayList aList = ccpList.ReturnObject as ArrayList;
  1061. if (aList[0] != null)
  1062. {
  1063. this.dataSet18.Tables["ingr"].Clear();
  1064. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet18.Tables["ingr"]);
  1065. tab0.TableName = "ingr";
  1066. this.dataSet18.Tables["ingr"].Merge(tab0);
  1067. }
  1068. if (aList[1] != null)
  1069. {
  1070. this.dataSet18.Tables["qlty"].Clear();
  1071. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet18.Tables["qlty"]);
  1072. tab0.TableName = "qlty";
  1073. this.dataSet18.Tables["qlty"].Merge(tab0);
  1074. }
  1075. /*if (aList[2] != null)
  1076. {
  1077. this.dataSet18.Tables["other"].Clear();
  1078. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[2] as System.Collections.ArrayList, this.dataSet18.Tables["other"]);
  1079. tab0.TableName = "other";
  1080. this.dataSet18.Tables["other"].Merge(tab0);
  1081. }*/
  1082. }//end else if
  1083. this.dataSet18.Tables["other"].Clear();
  1084. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1085. ccp.MethodName = "getToleranceInfoLZOther";
  1086. ccp.ServerParams = new object[] { ugr1.Cells["SIC_ID"].Text, ugr1.Cells["COIL_THK"].Text,
  1087. ugr1.Cells["COIL_WTH"].Text, ugr1.Cells["COIL_INDIA"].Text,ugr1.Cells["SFU_ID"].Text,
  1088. this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(0,this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3),
  1089. this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3),
  1090. ugr1.Cells["PACKAGE_LEVEL"].Text,ugr1.Cells["ACT_WGT"].Text,ugr1.Cells["PROC_DEC_RST"].Text,
  1091. ugr1.Cells["CR_DK1"].Text ,ugr1.Cells["EXTSHAPE_QUALITY"].Text};
  1092. ccp.SourceDataTable = this.dataSet18.Tables["other"];
  1093. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1094. //成分判断
  1095. foreach (UltraGridRow ugr in this.ultraGrid6.Rows)
  1096. {
  1097. double min = Convert.ToDouble(ugr.Cells["CHEM_MIN"].Text == "" ? "0" : ugr.Cells["CHEM_MIN"].Text);
  1098. double max = Convert.ToDouble(ugr.Cells["CHEM_MAX"].Text == "" ? "9999" : ugr.Cells["CHEM_MAX"].Text);
  1099. double value = Convert.ToDouble(ugr.Cells["CHEM_VAL"].Text == "" ? "-1" : ugr.Cells["CHEM_VAL"].Text);
  1100. if (value < min || value > max)
  1101. {
  1102. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1103. }
  1104. if (value == -1)//缺少实际值
  1105. {
  1106. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1107. }
  1108. }
  1109. //材质判断
  1110. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  1111. {
  1112. if ((IsNumberal(ugr.Cells["QLTY_MIN"].Text) == true) || (IsNumberal(ugr.Cells["QLTY_MAX"].Text) == true))
  1113. {
  1114. double min = Convert.ToDouble(ugr.Cells["QLTY_MIN"].Text == "" ? "0" : ugr.Cells["QLTY_MIN"].Text);
  1115. double max = Convert.ToDouble(ugr.Cells["QLTY_MAX"].Text == "" ? "9999" : ugr.Cells["QLTY_MAX"].Text);
  1116. double value = Convert.ToDouble(ugr.Cells["QLTY_VAL_WK"].Text == "" ? "-1" : ugr.Cells["QLTY_VAL_WK"].Text);
  1117. if (value < min || value > max)
  1118. {
  1119. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1120. }
  1121. if (value == -1)//缺少实际值
  1122. {
  1123. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1124. }
  1125. }
  1126. else
  1127. {
  1128. string min = ugr.Cells["QLTY_MIN"].Text.ToString();
  1129. string value = ugr.Cells["QLTY_VAL_WK"].Text.ToString();
  1130. if (!value.Equals(min))
  1131. {
  1132. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1133. }
  1134. if (value == "")
  1135. {
  1136. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1137. }
  1138. }
  1139. }
  1140. //其它判断
  1141. foreach (UltraGridRow ugr in this.ultraGrid8.Rows)
  1142. {
  1143. string name = ugr.Cells["T_NAME"].Text.Trim();
  1144. if ("外观" == name)
  1145. {
  1146. //不相等显示红色
  1147. string waiguan = ugr.Cells["T_MIN"].Text;
  1148. if (waiguan != null && waiguan != "" && !waiguan.Equals("0") && String.Compare(waiguan, ugr.Cells["T_VALUE"].Text) > 0)
  1149. {
  1150. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1151. }
  1152. continue;
  1153. }
  1154. else if ("内径" == name)
  1155. {
  1156. //不相等显示红色
  1157. string india = ugr.Cells["T_MIN"].Text;
  1158. if (india != null && india != "" && !india.Equals("0") && !india.Equals(ugr.Cells["T_VALUE"].Text))
  1159. {
  1160. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1161. }
  1162. continue;
  1163. }
  1164. else if ("包装" == name)
  1165. {
  1166. if ("不包装".Equals(ugr.Cells["T_MIN"].Text) && "XX".Equals(ugr.Cells["T_VALUE"].Text))
  1167. { }
  1168. else
  1169. {
  1170. //不相等显示红色
  1171. if (!ugr.Cells["T_MIN"].Text.Equals(ugr.Cells["T_VALUE"].Text))
  1172. {
  1173. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1174. }
  1175. }
  1176. continue;
  1177. }
  1178. else if ("切边" == name)
  1179. {
  1180. if ("Y".Equals(ugr.Cells["T_MIN"].Text) && "2".Equals(ugr.Cells["T_VALUE"].Text))
  1181. {
  1182. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1183. }
  1184. continue;
  1185. }
  1186. if ((IsNumberal(ugr.Cells["T_MIN"].Text) == true) || (IsNumberal(ugr.Cells["T_MAX"].Text) == true))
  1187. {
  1188. double min = Convert.ToDouble(ugr.Cells["T_MIN"].Text == "" ? "0" : ugr.Cells["T_MIN"].Text);
  1189. double max = Convert.ToDouble(ugr.Cells["T_MAX"].Text == "" ? "9999" : ugr.Cells["T_MAX"].Text);
  1190. double value = Convert.ToDouble(ugr.Cells["T_VALUE"].Text == "" ? "-1" : ugr.Cells["T_VALUE"].Text);
  1191. if (value < min || value > max)
  1192. {
  1193. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1194. }
  1195. if (value == -1)//缺少实际值
  1196. {
  1197. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1198. }
  1199. }
  1200. }
  1201. }
  1202. }
  1203. }