QCM030604.cs 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  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 CoreFS.CA06;
  10. using Infragistics.Win.UltraWinGrid;
  11. using System.Diagnostics;
  12. using System.Collections;
  13. using Newtonsoft.Json;
  14. namespace Core.LZMes.Client.QCM
  15. {
  16. public partial class QCM030604 : FrmBase
  17. {
  18. public QCM030604()
  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. this.Judge();
  31. break;
  32. case "Cancel":
  33. this.canceljudge();
  34. break;
  35. case "Ex_warehouse":
  36. this.Ex_warehouse();
  37. break;
  38. case "Cancel_Ex_warehouse":
  39. this.Cancel_Ex_warehouse();
  40. break;
  41. case "Send_memo":
  42. this.sendMemo();
  43. break;
  44. case "Exit":
  45. this.Close();
  46. break;
  47. case "Export":
  48. this.DoExport();
  49. break;
  50. case "JudgedLG"://判定记录中的待判
  51. this.JudgedLG();
  52. break;
  53. case "CancelJudged"://判定记录中的取消待判
  54. this.CancelJudged();
  55. break;
  56. }
  57. }
  58. private void CancelJudged()
  59. {
  60. try
  61. {
  62. if (this.ultraTabControl1.SelectedTab.Index == 1)
  63. {
  64. UltraGridRow ugr = this.ultraGrid5.ActiveRow;
  65. string heatNo = ugr.Cells["HEAT_NO"].Value.ToString();//炉号
  66. string userName = this.UserInfo.GetUserName();//操作人
  67. int num = 0;
  68. string MATERIAL_NO = "[";
  69. foreach (UltraGridRow ugr1 in this.ultraGrid2.Rows)
  70. {
  71. if (ugr1.Cells["checked"].Text.ToString() == "True")
  72. {
  73. if (num == 0)
  74. {
  75. MATERIAL_NO += '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  76. }
  77. if (num != 0)
  78. {
  79. MATERIAL_NO += "," + '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  80. }
  81. num++;
  82. }
  83. }
  84. MATERIAL_NO += "]";
  85. if (num == 0)
  86. {
  87. this.alert("未勾选待判数据");
  88. return;
  89. }
  90. Dictionary<string, string> openWith = new Dictionary<string, string>();
  91. openWith.Add("FLAG", "1");//取消待判
  92. openWith.Add("HEAT_NO", heatNo);
  93. openWith.Add("USER_NAME", userName);
  94. openWith.Add("MATERIAL_NO", MATERIAL_NO);
  95. string sbb = JsonConvert.SerializeObject(openWith).ToString();
  96. CoreClientParam ccp = new CoreClientParam();
  97. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  98. ccp.MethodName = "JudgedLG";
  99. ccp.ServerParams = new object[] { sbb };
  100. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  101. if (ccp.ReturnCode == -1)
  102. {
  103. return;
  104. }
  105. MessageBox.Show("取消待判成功!");
  106. DoQuery();
  107. }
  108. else
  109. {
  110. var dataSource = new List<string>();
  111. string heatNo = "";
  112. string userName = this.UserInfo.GetUserName();//操作人
  113. int num = 0;
  114. string MATERIAL_NO = "[";
  115. foreach (UltraGridRow ugr1 in this.ultraGrid1.Rows)
  116. {
  117. if (ugr1.Cells["checked"].Text.ToString() == "True")
  118. {
  119. heatNo = ugr1.Cells["HEAT_NO"].Value.ToString();//炉号
  120. dataSource.Add(heatNo);
  121. if (num == 0)
  122. {
  123. MATERIAL_NO += '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  124. }
  125. if (num != 0)
  126. {
  127. MATERIAL_NO += "," + '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  128. }
  129. num++;
  130. }
  131. }
  132. MATERIAL_NO += "]";
  133. if (num == 0)
  134. {
  135. this.alert("未勾选待判数据");
  136. return;
  137. }
  138. var uniqueData = dataSource.Distinct();
  139. int unum = 0;
  140. foreach (var item in uniqueData)
  141. {
  142. unum = unum + 1;
  143. }
  144. if (unum >= 2)
  145. {
  146. this.alert("只能勾选同炉号请核实数据!");
  147. return;
  148. }
  149. Dictionary<string, string> openWith = new Dictionary<string, string>();
  150. openWith.Add("FLAG", "1");//取消待判
  151. openWith.Add("HEAT_NO", heatNo);
  152. openWith.Add("USER_NAME", userName);
  153. openWith.Add("MATERIAL_NO", MATERIAL_NO);
  154. string sbb = JsonConvert.SerializeObject(openWith).ToString();
  155. CoreClientParam ccp = new CoreClientParam();
  156. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  157. ccp.MethodName = "JudgedLG";
  158. ccp.ServerParams = new object[] { sbb };
  159. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  160. if (ccp.ReturnCode == -1)
  161. {
  162. return;
  163. }
  164. MessageBox.Show("取消待判成功!");
  165. DoQuery();
  166. }
  167. }
  168. catch (Exception ex)
  169. {
  170. System.Diagnostics.Debug.WriteLine(ex.ToString());
  171. MessageBox.Show("系统出错,请联系管理人员", "警告");
  172. }
  173. }
  174. private void JudgedLG()
  175. {
  176. try
  177. {
  178. if (this.ultraTabControl1.SelectedTab.Index == 1)
  179. {
  180. UltraGridRow ugr = this.ultraGrid5.ActiveRow;
  181. string heatNo = ugr.Cells["HEAT_NO"].Value.ToString();//炉号
  182. string userName = this.UserInfo.GetUserName();//操作人
  183. //ArrayList material_no = new ArrayList();
  184. int num = 0;
  185. string MATERIAL_NO = "[";
  186. foreach (UltraGridRow ugr1 in this.ultraGrid2.Rows)
  187. {
  188. if (ugr1.Cells["checked"].Text.ToString() == "True")
  189. {
  190. if (num==0)
  191. {
  192. MATERIAL_NO += '"'+ugr1.Cells["MATERIAL_NO"].Value.ToString()+'"';
  193. }
  194. if (num != 0)
  195. {
  196. MATERIAL_NO +=","+ '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  197. }
  198. num++;
  199. }
  200. }
  201. MATERIAL_NO += "]";
  202. if (num==0)
  203. {
  204. this.alert("未勾选待判数据");
  205. return;
  206. }
  207. Dictionary<string, string> openWith = new Dictionary<string, string>();
  208. openWith.Add("FLAG", "0");//待判
  209. openWith.Add("HEAT_NO", heatNo);
  210. openWith.Add("USER_NAME", userName);
  211. openWith.Add("MATERIAL_NO", MATERIAL_NO);
  212. string sbb = JsonConvert.SerializeObject(openWith).ToString();
  213. CoreClientParam ccp = new CoreClientParam();
  214. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  215. ccp.MethodName = "JudgedLG";
  216. ccp.ServerParams = new object[] { sbb };
  217. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  218. if (ccp.ReturnCode == -1)
  219. {
  220. return;
  221. }
  222. MessageBox.Show("待判成功!");
  223. DoQuery();
  224. }
  225. else
  226. {
  227. var dataSource = new List<string>();
  228. string heatNo = "";
  229. string userName = this.UserInfo.GetUserName();//操作人
  230. int num = 0;
  231. string MATERIAL_NO = "[";
  232. foreach (UltraGridRow ugr1 in this.ultraGrid1.Rows)
  233. {
  234. if (ugr1.Cells["checked"].Text.ToString() == "True")
  235. {
  236. heatNo = ugr1.Cells["HEAT_NO"].Value.ToString();//炉号
  237. dataSource.Add(heatNo);
  238. if (num == 0)
  239. {
  240. MATERIAL_NO += '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  241. }
  242. if (num != 0)
  243. {
  244. MATERIAL_NO += "," + '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
  245. }
  246. num++;
  247. }
  248. }
  249. MATERIAL_NO += "]";
  250. if (num == 0)
  251. {
  252. this.alert("未勾选待判数据");
  253. return;
  254. }
  255. var uniqueData = dataSource.Distinct();
  256. int unum = 0;
  257. foreach (var item in uniqueData)
  258. {
  259. unum = unum + 1;
  260. }
  261. if (unum >= 2)
  262. {
  263. this.alert("只能勾选同炉号请核实数据!");
  264. return;
  265. }
  266. Dictionary<string, string> openWith = new Dictionary<string, string>();
  267. openWith.Add("FLAG", "0");//待判
  268. openWith.Add("HEAT_NO", heatNo);
  269. openWith.Add("USER_NAME", userName);
  270. openWith.Add("MATERIAL_NO", MATERIAL_NO);
  271. string sbb = JsonConvert.SerializeObject(openWith).ToString();
  272. CoreClientParam ccp = new CoreClientParam();
  273. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  274. ccp.MethodName = "JudgedLG";
  275. ccp.ServerParams = new object[] { sbb };
  276. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  277. if (ccp.ReturnCode == -1)
  278. {
  279. return;
  280. }
  281. MessageBox.Show("待判成功!");
  282. DoQuery();
  283. }
  284. }
  285. catch (Exception ex)
  286. {
  287. System.Diagnostics.Debug.WriteLine(ex.ToString());
  288. MessageBox.Show("系统出错,请联系管理人员", "警告");
  289. }
  290. }
  291. private void Ex_warehouse()
  292. {
  293. ArrayList material_no = new ArrayList();
  294. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  295. {
  296. if (ugr.Cells["checked"].Text.ToString() == "True")
  297. {
  298. //if (ugr.Cells["ISFX"].Text.ToString() == "是")
  299. //{
  300. // MessageBox.Show("物料号" + ugr.Cells["MATERIAL_NO"].Value.ToString() + "已经出库放行!");
  301. // return;
  302. //}
  303. material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  304. }
  305. }
  306. string username = this.UserInfo.GetUserName();
  307. CoreClientParam ccp = new CoreClientParam();
  308. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  309. ccp.MethodName = "ex_warehouse";
  310. ccp.ServerParams = new object[] { username, material_no, "4001LGX", "J" };
  311. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  312. if (ccp.ReturnCode == -1)
  313. {
  314. MessageBox.Show("出库放行失败!");
  315. return;
  316. }
  317. MessageBox.Show("出库放行成功!");
  318. DoQuery();
  319. }
  320. private void Cancel_Ex_warehouse()
  321. {
  322. ArrayList material_no = new ArrayList();
  323. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  324. {
  325. if (ugr.Cells["checked"].Text.ToString() == "True")
  326. {
  327. if (ugr.Cells["ISFX"].Text.ToString() != "是")
  328. {
  329. MessageBox.Show("物料号" + ugr.Cells["MATERIAL_NO"].Value.ToString() + "未出库!");
  330. return;
  331. }
  332. material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  333. }
  334. }
  335. string username = this.UserInfo.GetUserName();
  336. CoreClientParam ccp = new CoreClientParam();
  337. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  338. ccp.MethodName = "cancel_ex_warehouse";
  339. ccp.ServerParams = new object[] { username, material_no, "4001LGX", "J" };
  340. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  341. if (ccp.ReturnCode == -1)
  342. {
  343. MessageBox.Show("撤销出库放行失败!");
  344. return;
  345. }
  346. MessageBox.Show("撤销出库放行成功!");
  347. DoQuery();
  348. }
  349. private void Judge()
  350. {
  351. try
  352. {
  353. ArrayList material_no = new ArrayList();
  354. string username = this.UserInfo.GetUserName();
  355. ArrayList prod_name = new ArrayList();
  356. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  357. {
  358. if (ugr.Cells["checked"].Text.ToString() == "True")
  359. {
  360. material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  361. prod_name.Add(ugr.Cells["PROD_NAME"].Value.ToString());
  362. }
  363. }
  364. CoreClientParam ccp = new CoreClientParam();
  365. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  366. ccp.MethodName = "LgultimateJudgeAuto";
  367. ccp.ServerParams = new object[] { material_no, username, "4001LGX", prod_name };
  368. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  369. if (ccp.ReturnCode == -1)
  370. {
  371. return;
  372. }
  373. MessageBox.Show("综合判定成功!");
  374. DoQuery();
  375. }
  376. catch (Exception EX)
  377. {
  378. MessageBox.Show(EX.ToString());
  379. }
  380. }
  381. private void canceljudge()
  382. {
  383. try
  384. {
  385. ArrayList material_no = new ArrayList();
  386. string username = this.UserInfo.GetUserName();
  387. string again_judge_type = "";
  388. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  389. {
  390. if (ugr.Cells["checked"].Text.ToString() == "True")
  391. {
  392. material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  393. }
  394. }
  395. if (material_no.Count == 0)
  396. {
  397. MessageBox.Show("请在判定记录中选择需要撤销判定的产品!");
  398. return;
  399. }
  400. QCM030605 frm = new QCM030605();
  401. if (frm.ShowDialog() == DialogResult.OK)
  402. {
  403. again_judge_type = frm.Results;
  404. CoreClientParam ccp = new CoreClientParam();
  405. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  406. ccp.MethodName = "cancelLgUltimateJudge";
  407. ccp.ServerParams = new object[] { username, material_no, again_judge_type };
  408. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  409. DoQuery();
  410. }
  411. }
  412. catch (Exception EX)
  413. {
  414. MessageBox.Show(EX.ToString());
  415. }
  416. }
  417. private void sendMemo()
  418. {
  419. try
  420. {
  421. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  422. {
  423. ArrayList material_no = new ArrayList();
  424. string username = this.UserInfo.GetUserName();
  425. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  426. {
  427. if (ugr.Cells["checked"].Text.ToString() == "True")
  428. {
  429. material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  430. }
  431. }
  432. CoreClientParam ccp = new CoreClientParam();
  433. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  434. ccp.MethodName = "findLg2_1";
  435. ccp.ServerParams = new object[] { };
  436. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  437. DataTable table1 = ccp.SourceDataTable;
  438. ccp = new CoreClientParam();
  439. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  440. ccp.MethodName = "findLg2_2";
  441. ccp.ServerParams = new object[] { };
  442. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  443. DataTable table2 = ccp.SourceDataTable;
  444. QCM030606 frm = new QCM030606(table1, table2);
  445. if (frm.ShowDialog() == DialogResult.OK)
  446. {
  447. ccp = new CoreClientParam();
  448. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  449. ccp.MethodName = "ex_remark";
  450. ccp.ServerParams = new object[] { username, material_no, "4001LGX", "板坯", frm._noRedSendReason, frm._noRedirectSendReason, frm._ischk, frm._memo };
  451. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  452. DoQuery();
  453. }
  454. }
  455. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  456. {
  457. ArrayList material_no = new ArrayList();
  458. ArrayList utm_id = new ArrayList();
  459. string username = this.UserInfo.GetUserName();
  460. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  461. {
  462. if (ugr.Cells["checked"].Text.ToString() == "True")
  463. {
  464. material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  465. utm_id.Add(ugr.Cells["UTM_ID"].Value.ToString());
  466. }
  467. }
  468. CoreClientParam ccp = new CoreClientParam();
  469. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  470. ccp.MethodName = "findLg2_1";
  471. ccp.ServerParams = new object[] { };
  472. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  473. DataTable table1 = ccp.SourceDataTable;
  474. ccp = new CoreClientParam();
  475. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  476. ccp.MethodName = "findLg2_2";
  477. ccp.ServerParams = new object[] { };
  478. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  479. DataTable table2 = ccp.SourceDataTable;
  480. QCM030606 frm = new QCM030606(table1, table2);
  481. if (frm.ShowDialog() == DialogResult.OK)
  482. {
  483. ccp = new CoreClientParam();
  484. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  485. ccp.MethodName = "ex_remark1";
  486. ccp.ServerParams = new object[] { username, material_no, utm_id, "4001LGX", "板坯", frm._noRedSendReason, frm._noRedirectSendReason, frm._ischk, frm._memo };
  487. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  488. DoQuery();
  489. }
  490. }
  491. }
  492. catch (Exception EX)
  493. {
  494. MessageBox.Show(EX.ToString());
  495. }
  496. }
  497. private void DoQuery()
  498. {
  499. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  500. {
  501. DoQueryMe();
  502. }
  503. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  504. {
  505. DoQueryRe();
  506. }
  507. }
  508. //查询待判信息
  509. private void DoQueryMe()
  510. {
  511. try
  512. {
  513. this.dataSet1.Clear();
  514. string bbatchno = textBox1.Text.Trim();
  515. string prod_name = this.comboBox2.Text.ToString();
  516. CoreClientParam ccp = new CoreClientParam();
  517. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  518. ccp.MethodName = "getLgZRejudgeInfo";
  519. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), bbatchno, "4001LGX", prod_name, "J" };
  520. ccp.SourceDataTable = this.dataSet1.Tables[0];
  521. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  522. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  523. {
  524. if (ugr.Cells["SURFACERESULT_DESC"].Text.ToString() == "")
  525. {
  526. ugr.Cells["SURFACERESULT_DESC"].Appearance.BackColor = Color.Red;
  527. }
  528. if (ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString() == "")
  529. {
  530. ugr.Cells["R_CHEMRESULT_DESC"].Appearance.BackColor = Color.Red;
  531. }
  532. }
  533. }
  534. catch (Exception ex)
  535. {
  536. System.Diagnostics.Debug.WriteLine(ex.ToString());
  537. MessageBox.Show("系统出错,请联系管理人员", "警告");
  538. }
  539. }
  540. //查询判定记录
  541. private void DoQueryRe()
  542. {
  543. try
  544. {
  545. this.dataSet14.Clear();
  546. string bbatchno = textBox1.Text.Trim();
  547. //string prod_name = this.comboBox2.Text.ToString();
  548. //string isvalid = "0";
  549. //this.label20.Text = "";
  550. //if (checkBox1.Checked)
  551. //{
  552. // isvalid = "1";
  553. //}
  554. CoreClientParam ccp = new CoreClientParam();
  555. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  556. ccp.MethodName = "GetHeatProcessInfo";
  557. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), bbatchno, "4001LGX"};
  558. ccp.SourceDataTable = this.dataSet14.Tables[0];
  559. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  560. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  561. //{
  562. // foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
  563. // {
  564. // if (ugr2.Cells["UTM_RESULT_DESC"].Value.ToString() == "合格")
  565. // {
  566. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(185, 235, 204);
  567. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
  568. // }
  569. // else
  570. // {
  571. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(249, 198, 186);
  572. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
  573. // }
  574. // }
  575. //}
  576. }
  577. catch (Exception ex)
  578. {
  579. System.Diagnostics.Debug.WriteLine(ex.ToString());
  580. MessageBox.Show("系统出错,请联系管理人员", "警告");
  581. }
  582. }
  583. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  584. {
  585. DoQueryR();
  586. DoQueryS();//表面信息
  587. }
  588. private void DoQueryS()
  589. {
  590. try
  591. {
  592. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  593. if (ugr == null)
  594. return;
  595. this.dataSet7.Clear();
  596. if (ugr.Cells["SURFACEID"].Text.ToString() == "")
  597. {
  598. return;
  599. }
  600. string surface_id = ugr.Cells["SURFACEID"].Value.ToString();
  601. CoreClientParam ccp = new CoreClientParam();
  602. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  603. ccp.MethodName = "findNameByMN";
  604. ccp.ServerParams = new object[] { surface_id };
  605. ccp.SourceDataTable = this.dataSet7.Tables[0];
  606. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  607. }
  608. catch (Exception ex)
  609. {
  610. System.Diagnostics.Debug.WriteLine(ex.ToString());
  611. MessageBox.Show("系统出错,请联系管理人员", "警告");
  612. }
  613. }
  614. private void DoQueryR()
  615. {
  616. try
  617. {
  618. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  619. if (ugr == null)
  620. return;
  621. this.dataSet9.Clear();
  622. if (ugr.Cells["R_CHEMID"].Text.ToString() == "")
  623. {
  624. return;
  625. }
  626. string cic_id = ugr.Cells["R_CHEMID"].Value.ToString();
  627. CoreClientParam ccp = new CoreClientParam();
  628. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  629. ccp.MethodName = "GetLgRChemeResult";
  630. ccp.ServerParams = new object[] { cic_id };
  631. ccp.SourceDataTable = this.dataSet9.Tables[0];
  632. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  633. //ccp = new CoreClientParam();
  634. //ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  635. //ccp.MethodName = "GetCheme";
  636. //ccp.ServerParams = new object[] { cic_id };
  637. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  638. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  639. //{
  640. // foreach (UltraGridRow ugr5 in this.ultraGrid10.Rows)
  641. // {
  642. // if (ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmin"].ToString()) && ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmax"].ToString()))
  643. // {
  644. // ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red;
  645. // }
  646. // }
  647. //}
  648. UltraGridRow judge_row = null;
  649. foreach (UltraGridRow ugst in this.ultraGrid10.Rows)
  650. {
  651. if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()) && ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString().Trim() != "")
  652. {
  653. ugst.Appearance.BackColor = Color.Green;
  654. }
  655. if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
  656. {
  657. judge_row = ugst;
  658. }
  659. if (judge_row != null)
  660. {
  661. foreach (UltraGridRow ugs in this.ultraGrid10.Rows)
  662. {
  663. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)"))
  664. {
  665. for (int i = 0; i < ugs.Cells.Count; i++)
  666. {
  667. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  668. {
  669. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  670. if (str_arr.Length == 1)
  671. {
  672. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  673. {
  674. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  675. {
  676. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  677. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  678. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  679. {
  680. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  681. }
  682. }
  683. }
  684. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  685. {
  686. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  687. {
  688. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  689. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  690. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  691. {
  692. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  693. }
  694. }
  695. }
  696. else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
  697. {
  698. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  699. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  700. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  701. {
  702. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  703. }
  704. }
  705. }
  706. else if (str_arr.Length == 2)
  707. {
  708. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  709. {
  710. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  711. {
  712. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  713. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  714. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  715. {
  716. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  717. }
  718. }
  719. }
  720. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  721. {
  722. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  723. {
  724. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  725. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  726. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  727. {
  728. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  729. }
  730. }
  731. }
  732. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  733. {
  734. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  735. {
  736. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  737. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  738. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  739. {
  740. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  741. }
  742. }
  743. }
  744. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  745. {
  746. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  747. {
  748. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  749. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  750. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  751. {
  752. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  753. }
  754. }
  755. }
  756. else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
  757. {
  758. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  759. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  760. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  761. {
  762. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  763. }
  764. }
  765. }
  766. }
  767. }
  768. }
  769. }
  770. }
  771. }
  772. }
  773. catch (Exception ex)
  774. {
  775. System.Diagnostics.Debug.WriteLine(ex.ToString());
  776. MessageBox.Show("系统出错,请联系管理人员", "警告");
  777. }
  778. }
  779. private void QCM030604_Load(object sender, EventArgs e)
  780. {
  781. this.comboBox2.SelectedIndex = 0;
  782. this.checkBox1.Checked = true;
  783. this.checkBox1.Visible = false;
  784. this.label19.Visible = false;
  785. this.label20.Visible = false;
  786. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  787. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  788. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  789. }
  790. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  791. {
  792. DoQueryR1();
  793. DoQueryS1();//表面信息
  794. }
  795. private void DoQueryS1()
  796. {
  797. try
  798. {
  799. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  800. if (ugr == null)
  801. return;
  802. this.dataSet12.Clear();
  803. if (ugr.Cells["SFU_ID"].Text.ToString() == "")
  804. {
  805. return;
  806. }
  807. string surface_id = ugr.Cells["SFU_ID"].Value.ToString();
  808. CoreClientParam ccp = new CoreClientParam();
  809. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  810. ccp.MethodName = "findNameByMN";
  811. ccp.ServerParams = new object[] { surface_id };
  812. ccp.SourceDataTable = this.dataSet12.Tables[0];
  813. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  814. }
  815. catch (Exception ex)
  816. {
  817. System.Diagnostics.Debug.WriteLine(ex.ToString());
  818. MessageBox.Show("系统出错,请联系管理人员", "警告");
  819. }
  820. }
  821. private void DoQueryR1()
  822. {
  823. try
  824. {
  825. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  826. if (ugr == null)
  827. return;
  828. this.dataSet13.Clear();
  829. if (ugr.Cells["R_CIC_ID"].Text.ToString() == "")
  830. {
  831. return;
  832. }
  833. string cic_id = ugr.Cells["R_CIC_ID"].Value.ToString();
  834. CoreClientParam ccp = new CoreClientParam();
  835. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  836. ccp.MethodName = "GetLgRChemeResult";
  837. ccp.ServerParams = new object[] { cic_id };
  838. ccp.SourceDataTable = this.dataSet13.Tables[0];
  839. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  840. //ccp = new CoreClientParam();
  841. //ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  842. //ccp.MethodName = "GetCheme";
  843. //ccp.ServerParams = new object[] { cic_id };
  844. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  845. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  846. //{
  847. // foreach (UltraGridRow ugr5 in this.ultraGrid10.Rows)
  848. // {
  849. // if (ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmin"].ToString()) && ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmax"].ToString()))
  850. // {
  851. // ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red;
  852. // }
  853. // }
  854. //}
  855. UltraGridRow judge_row = null;
  856. foreach (UltraGridRow ugst in this.ultraGrid4.Rows)
  857. {
  858. if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()))
  859. {
  860. ugst.Appearance.BackColor = Color.Green;
  861. }
  862. if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
  863. {
  864. judge_row = ugst;
  865. }
  866. if (judge_row != null)
  867. {
  868. foreach (UltraGridRow ugs in this.ultraGrid4.Rows)
  869. {
  870. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)"))
  871. {
  872. for (int i = 0; i < ugs.Cells.Count; i++)
  873. {
  874. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  875. {
  876. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  877. if (str_arr.Length == 1)
  878. {
  879. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  880. {
  881. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  882. {
  883. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  884. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  885. {
  886. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  887. }
  888. }
  889. }
  890. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  891. {
  892. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  893. {
  894. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  895. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  896. {
  897. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  898. }
  899. }
  900. }
  901. else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
  902. {
  903. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  904. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  905. {
  906. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  907. }
  908. }
  909. }
  910. else if (str_arr.Length == 2)
  911. {
  912. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  913. {
  914. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  915. {
  916. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  917. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  918. {
  919. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  920. }
  921. }
  922. }
  923. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  924. {
  925. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  926. {
  927. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  928. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  929. {
  930. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  931. }
  932. }
  933. }
  934. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  935. {
  936. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  937. {
  938. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  939. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  940. {
  941. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  942. }
  943. }
  944. }
  945. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  946. {
  947. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  948. {
  949. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  950. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  951. {
  952. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  953. }
  954. }
  955. }
  956. else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
  957. {
  958. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  959. if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
  960. {
  961. ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  962. }
  963. }
  964. }
  965. }
  966. }
  967. }
  968. }
  969. }
  970. }
  971. }
  972. catch (Exception ex)
  973. {
  974. System.Diagnostics.Debug.WriteLine(ex.ToString());
  975. MessageBox.Show("系统出错,请联系管理人员", "警告");
  976. }
  977. }
  978. private void ultraTabControl1_Click(object sender, EventArgs e)
  979. {
  980. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  981. {
  982. this.label4.Text = "判定时间";
  983. this.checkBox1.Visible = true;
  984. this.label19.Visible = true;
  985. this.label20.Visible = true;
  986. this.dateTimePicker1.Value = System.DateTime.Now;
  987. }
  988. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  989. {
  990. this.label4.Text = "生产时间";
  991. this.checkBox1.Visible = false;
  992. this.label19.Visible = false;
  993. this.label20.Visible = false;
  994. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  995. }
  996. }
  997. private void DoExport()
  998. {
  999. try
  1000. {
  1001. //if (this.ultraGrid2.Rows.Count == 0)
  1002. //{
  1003. // MessageBox.Show("没有可以导出的数据", "提示");
  1004. // return;
  1005. //}
  1006. this.dataSet2.Clear();
  1007. string prod_name = this.comboBox2.Text.ToString();
  1008. string isvalid = "0";
  1009. if (checkBox1.Checked)
  1010. {
  1011. isvalid = "1";
  1012. }
  1013. CoreClientParam ccp = new CoreClientParam();
  1014. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1015. ccp.MethodName = "getLgZjudgeInfo";
  1016. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), "", "4001LGX", prod_name, "J", isvalid };
  1017. ccp.SourceDataTable = this.dataSet2.Tables[0];
  1018. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1019. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  1020. {
  1021. string fName = this.saveFileDialog1.FileName;
  1022. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  1023. Process.Start(fName);
  1024. }
  1025. }
  1026. catch (Exception ex)
  1027. {
  1028. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1029. }
  1030. }
  1031. private void label9_Click(object sender, EventArgs e)
  1032. {
  1033. CoreClientParam ccp = new CoreClientParam();
  1034. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  1035. {
  1036. if (ugr.Cells["checked"].Text.ToString() == "True")
  1037. {
  1038. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  1039. string length = this.textBox4.Text.ToString();
  1040. string width = this.textBox3.Text.ToString();
  1041. string thick = this.textBox2.Text.ToString();
  1042. ccp = new CoreClientParam();
  1043. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1044. ccp.MethodName = "upLGSize";
  1045. ccp.ServerParams = new object[] { material_no, length, width, thick };
  1046. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1047. if (ccp.ReturnCode == -1)
  1048. {
  1049. return;
  1050. }
  1051. ugr.Cells["checked"].Value = "False";
  1052. }
  1053. }
  1054. MessageBox.Show("登记成功");
  1055. }
  1056. private void label8_Click(object sender, EventArgs e)
  1057. {
  1058. CoreClientParam ccp = new CoreClientParam();
  1059. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  1060. {
  1061. if (ugr.Cells["checked"].Text.ToString() == "True")
  1062. {
  1063. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  1064. string check_remarks = this.checkBoxComboBox2.Text.ToString();
  1065. string fix_remarks = this.checkBoxComboBox1.Text.ToString();
  1066. string pline = "4001LGX";
  1067. string username = this.UserInfo.GetUserName().ToString();
  1068. string prod_type = this.comboBox2.Text.ToString();
  1069. ccp = new CoreClientParam();
  1070. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1071. ccp.MethodName = "upLGMemo";
  1072. ccp.ServerParams = new object[] { material_no, fix_remarks, check_remarks, pline, username, prod_type };
  1073. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1074. if (ccp.ReturnCode == -1)
  1075. {
  1076. return;
  1077. }
  1078. ugr.Cells["checked"].Value = "False";
  1079. }
  1080. }
  1081. this.checkBoxComboBox2.Text = "";
  1082. this.checkBoxComboBox1.Text = "";
  1083. MessageBox.Show("登记成功");
  1084. }
  1085. private void label12_Click(object sender, EventArgs e)
  1086. {
  1087. CoreClientParam ccp = new CoreClientParam();
  1088. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1089. {
  1090. if (ugr.Cells["checked"].Text.ToString() == "True")
  1091. {
  1092. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  1093. string check_remarks = this.checkBoxComboBox3.Text.ToString();
  1094. string fix_remarks = this.checkBoxComboBox4.Text.ToString();
  1095. string pline = "4001LGX";
  1096. string username = this.UserInfo.GetUserName().ToString();
  1097. string prod_type = this.comboBox2.Text.ToString();
  1098. ccp = new CoreClientParam();
  1099. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1100. ccp.MethodName = "upLGMemo1";
  1101. ccp.ServerParams = new object[] { material_no, fix_remarks, check_remarks, pline, username, prod_type };
  1102. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1103. if (ccp.ReturnCode == -1)
  1104. {
  1105. return;
  1106. }
  1107. ugr.Cells["checked"].Value = "False";
  1108. }
  1109. }
  1110. this.checkBoxComboBox3.Text = "";
  1111. this.checkBoxComboBox4.Text = "";
  1112. MessageBox.Show("登记成功");
  1113. }
  1114. private void label16_Click(object sender, EventArgs e)
  1115. {
  1116. CoreClientParam ccp = new CoreClientParam();
  1117. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  1118. {
  1119. if (ugr.Cells["checked"].Text.ToString() == "True")
  1120. {
  1121. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  1122. string length = this.textBox5.Text.ToString();
  1123. string width = this.textBox6.Text.ToString();
  1124. string thick = this.textBox7.Text.ToString();
  1125. ccp = new CoreClientParam();
  1126. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1127. ccp.MethodName = "upLGSize1";
  1128. ccp.ServerParams = new object[] { material_no, length, width, thick };
  1129. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1130. if (ccp.ReturnCode == -1)
  1131. {
  1132. return;
  1133. }
  1134. ugr.Cells["checked"].Value = "False";
  1135. }
  1136. }
  1137. MessageBox.Show("登记成功");
  1138. }
  1139. private void textBox5_TextChanged(object sender, EventArgs e)
  1140. {
  1141. }
  1142. private void label17_Click(object sender, EventArgs e)
  1143. {
  1144. }
  1145. private void label15_Click(object sender, EventArgs e)
  1146. {
  1147. }
  1148. private void textBox6_TextChanged(object sender, EventArgs e)
  1149. {
  1150. }
  1151. private void textBox7_TextChanged(object sender, EventArgs e)
  1152. {
  1153. }
  1154. private void label18_Click(object sender, EventArgs e)
  1155. {
  1156. }
  1157. private void ultraGrid2_AfterCellUpdate(object sender, CellEventArgs e)
  1158. {
  1159. }
  1160. private void ultraGrid2_BeforeCellUpdate(object sender, BeforeCellUpdateEventArgs e)
  1161. {
  1162. }
  1163. private void ultraGrid2_ClickCell(object sender, ClickCellEventArgs e)
  1164. {
  1165. }
  1166. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  1167. {
  1168. UltraGridRow ugr1 = this.ultraGrid2.ActiveRow;
  1169. //this.ultraGrid2.DisplayLayout.Bands[0].Header.Column["选择"]
  1170. string ss = "";
  1171. string s1 = "";
  1172. if (ugr1.Cells["checked"] == e.Cell)
  1173. {
  1174. double sum = 0.0;
  1175. foreach (UltraGridRow ugr in ultraGrid2.Rows)
  1176. {
  1177. if (ugr.Cells["checked"].Text.ToString() == "True")
  1178. {
  1179. ss = ugr.Cells["THEORYWEIGHT"].Value.ToString();
  1180. s1 = ugr.Cells["THEORYWEIGHT"].Text.ToString();
  1181. if (ugr.Cells["THEORYWEIGHT"].Value != null && ugr.Cells["THEORYWEIGHT"].Text.ToString() != "")
  1182. {
  1183. sum += Convert.ToDouble(ugr.Cells["THEORYWEIGHT"].Value);
  1184. this.label20.Text = sum.ToString();
  1185. }
  1186. }
  1187. else
  1188. {
  1189. this.label20.Text = sum.ToString();
  1190. }
  1191. }
  1192. }
  1193. }
  1194. private void ultraGrid2_AfterCellUpdate_1(object sender, CellEventArgs e)
  1195. {
  1196. double sum = 0.0;
  1197. foreach (UltraGridRow ugr in ultraGrid2.Rows)
  1198. {
  1199. if (ugr.Cells["checked"].Text.ToString() == "True")
  1200. {
  1201. if (ugr.Cells["THEORYWEIGHT"].Value != null && ugr.Cells["THEORYWEIGHT"].Text.ToString() != "")
  1202. {
  1203. sum += Convert.ToDouble(ugr.Cells["THEORYWEIGHT"].Value);
  1204. this.label20.Text = sum.ToString();
  1205. }
  1206. }
  1207. else
  1208. {
  1209. this.label20.Text = sum.ToString();
  1210. }
  1211. }
  1212. }
  1213. private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
  1214. {
  1215. try
  1216. {
  1217. UltraGridRow ugr = this.ultraGrid5.ActiveRow;
  1218. this.dataSet2.Clear();
  1219. string bbatchno = ugr.Cells["HEAT_NO"].Value.ToString();
  1220. string prod_name = ugr.Cells["PLATE_TYPE"].Value.ToString();
  1221. string isvalid = "0";
  1222. this.label20.Text = "";
  1223. if (checkBox1.Checked)
  1224. {
  1225. isvalid = "1";
  1226. }
  1227. CoreClientParam ccp = new CoreClientParam();
  1228. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1229. ccp.MethodName = "getLgZjudgeInfo";
  1230. ccp.ServerParams = new object[] { "", "", bbatchno, "4001LGX", prod_name, "J", isvalid };
  1231. ccp.SourceDataTable = this.dataSet2.Tables[0];
  1232. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1233. //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  1234. //{
  1235. // foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
  1236. // {
  1237. // if (ugr2.Cells["UTM_RESULT_DESC"].Value.ToString() == "合格")
  1238. // {
  1239. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(185, 235, 204);
  1240. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
  1241. // }
  1242. // else
  1243. // {
  1244. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(249, 198, 186);
  1245. // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
  1246. // }
  1247. // }
  1248. //}
  1249. }
  1250. catch (Exception ex)
  1251. {
  1252. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1253. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1254. }
  1255. }
  1256. }
  1257. }