bd7de7c1300173af7f68cc9df4668500cbbf5bba.svn-base 105 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037
  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;
  11. using Infragistics.Win.UltraWinGrid;
  12. using System.Diagnostics;
  13. using System.Collections;
  14. using System.Text.RegularExpressions;
  15. namespace Core.LZMes.Client.QCM
  16. {
  17. public partial class QCM030615 :FrmBase
  18. {
  19. public QCM030615()
  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. this.textBox6.Text = ugr1.Cells["ORDER_REMARK"].Text.ToString();
  396. //成分
  397. ArrayList al = new ArrayList();
  398. string cic_id = ugr1.Cells["R_CHEMID"].Value.ToString();
  399. if (ugr1.Cells["R_CHEMRESULT_DESC"].Value.ToString() != "")
  400. {
  401. CoreClientParam ccp1 = new CoreClientParam();
  402. ccp1.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  403. ccp1.MethodName = "GetChemeOrd";
  404. ccp1.ServerParams = new object[] { cic_id };
  405. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  406. string design_key = ccp1.ReturnObject.ToString();
  407. string ord_no = design_key.Substring(0, design_key.Length - 3);
  408. string ord_seq = design_key.Substring(design_key.Length - 3);
  409. list.Add(al);
  410. al.Add("UIB030220_CHEM.SELECT");
  411. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  412. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  413. /*al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  414. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);*/
  415. al.Add(ord_no);
  416. al.Add(ord_seq);
  417. }
  418. else
  419. {
  420. list.Add(al);
  421. al.Add("UIB030220_CHEM.SELECT");
  422. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  423. al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text);
  424. al.Add("");
  425. al.Add("");
  426. }
  427. //材质
  428. al = new ArrayList();
  429. list.Add(al);
  430. if (ugr1.Cells["PHYSRESULT_DESC"].Value.ToString() != "")
  431. {
  432. al.Add("UIB030110_036N.SELECT");
  433. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  434. }
  435. else
  436. {
  437. al.Add("UIB030110_036N.SELECT");
  438. al.Add("");
  439. }
  440. CoreClientParam ccp = new CoreClientParam();
  441. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  442. ccp.MethodName = "doContinuousQluery";
  443. ccp.ServerParams = new object[] { list };
  444. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  445. if (ccpList.ReturnInfo.Length == 0)
  446. {
  447. ArrayList aList = ccpList.ReturnObject as ArrayList;
  448. if (aList[0] != null)
  449. {
  450. this.dataSet18.Tables["ingr"].Clear();
  451. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet18.Tables["ingr"]);
  452. tab0.TableName = "ingr";
  453. this.dataSet18.Tables["ingr"].Merge(tab0);
  454. }
  455. if (aList[1] != null)
  456. {
  457. this.dataSet18.Tables["qlty"].Clear();
  458. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet18.Tables["qlty"]);
  459. tab0.TableName = "qlty";
  460. this.dataSet18.Tables["qlty"].Merge(tab0);
  461. }
  462. /*if (aList[2] != null)
  463. {
  464. this.dataSet18.Tables["other"].Clear();
  465. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[2] as System.Collections.ArrayList, this.dataSet18.Tables["other"]);
  466. tab0.TableName = "other";
  467. this.dataSet18.Tables["other"].Merge(tab0);
  468. }*/
  469. }
  470. this.dataSet18.Tables["other"].Clear();
  471. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  472. ccp.MethodName = "getToleranceInfoLZOther";
  473. ccp.ServerParams = new object[] { ugr1.Cells["SIZEID"].Text, ugr1.Cells["COIL_THK"].Text,
  474. ugr1.Cells["COIL_WTH"].Text, ugr1.Cells["COIL_INDIA"].Text,ugr1.Cells["SURFACEID"].Text,ugr1.Cells["ORD_NO"].Text,
  475. ugr1.Cells["ORD_SEQ"].Text,ugr1.Cells["PACKAGE_LEVEL"].Text,ugr1.Cells["ACT_WGT"].Text,ugr1.Cells["PROC_DEC_RST"].Text,
  476. ugr1.Cells["CR_DK1"].Text,ugr1.Cells["EXTSHAPE_QUALITY"].Text };
  477. ccp.SourceDataTable = this.dataSet18.Tables["other"];
  478. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  479. //成分判断
  480. foreach (UltraGridRow ugr in this.ultraGrid5.Rows)
  481. {
  482. double min = Convert.ToDouble(ugr.Cells["CHEM_MIN"].Text == "" ? "0" : ugr.Cells["CHEM_MIN"].Text);
  483. double max = Convert.ToDouble(ugr.Cells["CHEM_MAX"].Text == "" ? "9999" : ugr.Cells["CHEM_MAX"].Text);
  484. double value = Convert.ToDouble(ugr.Cells["CHEM_VAL"].Text == "" ? "-1" : ugr.Cells["CHEM_VAL"].Text);
  485. if (value < min || value > max)
  486. {
  487. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  488. }
  489. if (value == -1)//缺少实际值
  490. {
  491. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  492. }
  493. }
  494. //材质判断
  495. foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
  496. {
  497. if ((IsNumberal(ugr.Cells["QLTY_MIN"].Text) == true) || (IsNumberal(ugr.Cells["QLTY_MAX"].Text) == true))
  498. {
  499. double min = Convert.ToDouble(ugr.Cells["QLTY_MIN"].Text == "" ? "0" : ugr.Cells["QLTY_MIN"].Text);
  500. double max = Convert.ToDouble(ugr.Cells["QLTY_MAX"].Text == "" ? "9999" : ugr.Cells["QLTY_MAX"].Text);
  501. double value = Convert.ToDouble(ugr.Cells["QLTY_VAL_WK"].Text == "" ? "-1" : ugr.Cells["QLTY_VAL_WK"].Text);
  502. if (value < min || value > max)
  503. {
  504. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  505. }
  506. if (value == -1)//缺少实际值
  507. {
  508. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  509. }
  510. }
  511. else
  512. {
  513. string min = ugr.Cells["QLTY_MIN"].Text.ToString();
  514. string value = ugr.Cells["QLTY_VAL_WK"].Text.ToString();
  515. if (!value.Equals(min))
  516. {
  517. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  518. }
  519. if (value == "")
  520. {
  521. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  522. }
  523. }
  524. }
  525. //其它判断
  526. foreach (UltraGridRow ugr in this.ultraGrid4.Rows)
  527. {
  528. string name = ugr.Cells["T_NAME"].Text.Trim();
  529. if ("外观" == name)
  530. {
  531. //不相等显示红色
  532. string waiguan = ugr.Cells["T_MIN"].Text;
  533. if (waiguan != null && waiguan != "" && !waiguan.Equals("0") && String.Compare(waiguan, ugr.Cells["T_VALUE"].Text) > 0)
  534. {
  535. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  536. }
  537. continue;
  538. }
  539. else if ("内径" == name)
  540. {
  541. //不相等显示红色
  542. string india = ugr.Cells["T_MIN"].Text;
  543. if (india != null && india != "" && !india.Equals("0") && !india.Equals(ugr.Cells["T_VALUE"].Text))
  544. {
  545. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  546. }
  547. continue;
  548. }
  549. else if ("包装" == name)
  550. {
  551. if ("不包装".Equals(ugr.Cells["T_MIN"].Text) && "XX".Equals(ugr.Cells["T_VALUE"].Text))
  552. { }
  553. else
  554. {
  555. //不相等显示红色
  556. if (!ugr.Cells["T_MIN"].Text.Equals(ugr.Cells["T_VALUE"].Text))
  557. {
  558. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  559. }
  560. }
  561. continue;
  562. }
  563. else if ("切边" == name)
  564. {
  565. if ("Y".Equals(ugr.Cells["T_MIN"].Text) && "2".Equals(ugr.Cells["T_VALUE"].Text))
  566. {
  567. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  568. }
  569. continue;
  570. }
  571. if ((IsNumberal(ugr.Cells["T_MIN"].Text) == true) || (IsNumberal(ugr.Cells["T_MAX"].Text) == true))
  572. {
  573. double min = Convert.ToDouble(ugr.Cells["T_MIN"].Text == "" ? "0" : ugr.Cells["T_MIN"].Text);
  574. double max = Convert.ToDouble(ugr.Cells["T_MAX"].Text == "" ? "9999" : ugr.Cells["T_MAX"].Text);
  575. double value = Convert.ToDouble(ugr.Cells["T_VALUE"].Text == "" ? "-1" : ugr.Cells["T_VALUE"].Text);
  576. if (value < min || value > max)
  577. {
  578. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  579. }
  580. if (value == -1)//缺少实际值
  581. {
  582. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  583. }
  584. }
  585. }
  586. }
  587. /*private void DoQueryM()
  588. {
  589. try
  590. {
  591. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  592. if (ugr == null)
  593. return;
  594. this.dataSet10.Clear();
  595. if (ugr.Cells["SIZEID"].Text.ToString() == "")
  596. {
  597. return;
  598. }
  599. string sic = ugr.Cells["SIZEID"].Text.ToString();
  600. CoreClientParam ccp = new CoreClientParam();
  601. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  602. ccp.MethodName = "getToleranceInfoNew";
  603. ccp.ServerParams = new object[] { sic };
  604. ccp.SourceDataTable = this.dataSet10.Tables[0];
  605. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  606. this.dataSet6.Clear();
  607. ccp = new CoreClientParam();
  608. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  609. ccp.MethodName = "getQcmJudgeMeasureJ";
  610. ccp.ServerParams = new object[] { sic };
  611. ccp.SourceDataTable = this.dataSet6.Tables[0];
  612. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  613. foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
  614. {
  615. ugrs.Cells["val"].Appearance.BackColor = Color.White;
  616. double val1 = 0;
  617. ArrayList list = new ArrayList();
  618. ugrs.Appearance.BackColor = Color.White;
  619. if (ugrs.Cells["val"].Text.ToString() == "")
  620. {
  621. continue;
  622. }
  623. if (!IsNumberal(ugrs.Cells["val"].Text.ToString()))
  624. {
  625. continue;
  626. }
  627. else if (ugrs.Cells["plan"].Text.ToString() != "")
  628. {
  629. val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString()) - Convert.ToDouble(ugrs.Cells["plan"].Text.ToString());
  630. }
  631. else
  632. {
  633. val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString());
  634. }
  635. if (ugrs.Cells["std_min_val"].Text.ToString() != "" && ugrs.Cells["std_min_val"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_min_val"].Text.ToString()) - val1 > 0)
  636. {
  637. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  638. this.comboBox1.SelectedIndex = 0;
  639. }
  640. if (ugrs.Cells["std_max_val"].Text.ToString() != "" && ugrs.Cells["std_max_val"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_max_val"].Text.ToString()) - val1 < 0)
  641. {
  642. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  643. this.comboBox1.SelectedIndex = 0;
  644. }
  645. if (ugrs.Cells["std_min_val_k"].Text.ToString() != "" && ugrs.Cells["std_min_val_k"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_min_val_k"].Text.ToString()) - val1 > 0)
  646. {
  647. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  648. this.comboBox1.SelectedIndex = 0;
  649. }
  650. if (ugrs.Cells["std_max_val_k"].Text.ToString() != "" && ugrs.Cells["std_max_val_k"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_max_val_k"].Text.ToString()) - val1 < 0)
  651. {
  652. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  653. this.comboBox1.SelectedIndex = 0;
  654. }
  655. if (ugrs.Cells["std_min_val_n"].Text.ToString() != "" && ugrs.Cells["std_min_val_n"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_min_val_n"].Text.ToString()) - val1 > 0)
  656. {
  657. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  658. this.comboBox1.SelectedIndex = 0;
  659. }
  660. if (ugrs.Cells["std_max_val_n"].Text.ToString() != "" && ugrs.Cells["std_max_val_n"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_max_val_n"].Text.ToString()) - val1 < 0)
  661. {
  662. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  663. this.comboBox1.SelectedIndex = 0;
  664. }
  665. }
  666. }
  667. catch (Exception ex)
  668. {
  669. System.Diagnostics.Debug.WriteLine(ex.ToString());
  670. MessageBox.Show("系统出错,请联系管理人员", "警告");
  671. }
  672. }*/
  673. /*private void DoQueryS()
  674. {
  675. try
  676. {
  677. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  678. if (ugr == null)
  679. return;
  680. this.dataSet7.Clear();
  681. if (ugr.Cells["SURFACEID"].Text.ToString() == "")
  682. {
  683. return;
  684. }
  685. string surface_id = ugr.Cells["SURFACEID"].Value.ToString();
  686. CoreClientParam ccp = new CoreClientParam();
  687. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  688. ccp.MethodName = "findNameByMN";
  689. ccp.ServerParams = new object[] { surface_id };
  690. ccp.SourceDataTable = this.dataSet7.Tables[0];
  691. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  692. }
  693. catch (Exception ex)
  694. {
  695. System.Diagnostics.Debug.WriteLine(ex.ToString());
  696. MessageBox.Show("系统出错,请联系管理人员", "警告");
  697. }
  698. }*/
  699. private void DoQueryD()
  700. {
  701. }
  702. public static bool IsNumberal(string input)
  703. {
  704. bool flag = true;
  705. int count = 0;
  706. int count1 = 0;
  707. if (input.Length == 0)
  708. {
  709. flag = false;
  710. }
  711. else
  712. {
  713. char[] x = input.ToCharArray();
  714. for (int i = 0; i < input.Length; i++)
  715. {
  716. if (!char.IsNumber(x[i]) && x[i] != '.'&&x[i] != '-')
  717. {
  718. flag = false; break;
  719. }
  720. if (x[i] == '.')
  721. {
  722. count++;
  723. if (i == 0 || i == input.Length - 1) flag = false;
  724. }
  725. if (x[i] == '-')
  726. {
  727. count1++;
  728. if (i >1) flag = false;
  729. }
  730. }
  731. if (count > 1 || count1 > 1) flag = false;
  732. }
  733. return flag;
  734. }
  735. private static bool ishz(string text)
  736. {
  737. if (Regex.IsMatch(text, @"[\u4e00-\u9fa5]"))
  738. {
  739. return true;
  740. }
  741. else
  742. {
  743. return false;
  744. }
  745. }
  746. /*private void DoQueryP()
  747. {
  748. try
  749. {
  750. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  751. if (ugr == null)
  752. return;
  753. this.dataSet11.Clear();
  754. if (ugr.Cells["PHYSID"].Text.ToString() == "")
  755. {
  756. return;
  757. }
  758. string pic_id = ugr.Cells["PHYSID"].Value.ToString();
  759. CoreClientParam ccp = new CoreClientParam();
  760. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  761. ccp.MethodName = "querryJudgeResult";
  762. ccp.ServerParams = new object[] { pic_id };
  763. ccp.SourceDataTable = this.dataSet11.Tables[1];
  764. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  765. ccp = new CoreClientParam();
  766. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  767. ccp.MethodName = "querryJudgetItem";
  768. ccp.ServerParams = new object[] { pic_id };
  769. ccp.SourceDataTable = this.dataSet11.Tables[0];
  770. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  771. this.ultraGrid4.Rows.ExpandAll(true);
  772. foreach (UltraGridRow ugr1 in this.ultraGrid4.Rows)
  773. {
  774. foreach (UltraGridRow ugrs in ugr1.ChildBands[0].Rows)
  775. {
  776. if (ugrs.Cells["defect_flag"].Value.ToString() == "是")
  777. {
  778. ugrs.Cells["defect_flag"].Appearance.ForeColor = Color.Red;
  779. }
  780. if (ugrs.Cells["isjudge"].Value.ToString() == "是")
  781. {
  782. if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定")
  783. {
  784. if (ugrs.Cells["val1"].Text.ToString() == "")
  785. {
  786. ugrs.Cells["val1"].Appearance.BackColor = Color.Yellow;
  787. }
  788. }
  789. else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值")
  790. {
  791. if (ugrs.Cells["avg_val"].Text.ToString() == "")
  792. {
  793. ugrs.Cells["avg_val"].Appearance.BackColor = Color.Yellow;
  794. }
  795. }
  796. }
  797. if (ugrs.Cells["isjudge"].Value.ToString() == "是")
  798. {
  799. if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定")
  800. {
  801. DataTable dt = new DataTable();
  802. if (IsNumberal(ugrs.Cells["val1"].Value.ToString()))
  803. {
  804. if (ishz(ugrs.Cells["jf_stdmin"].Value.ToString()) || ishz(ugrs.Cells["jf_stdmax"].Value.ToString()))
  805. {
  806. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  807. }
  808. else
  809. {
  810. 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(), ""))
  811. {
  812. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  813. }
  814. 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(), ""))
  815. {
  816. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  817. }
  818. }
  819. }
  820. else
  821. {
  822. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "="+ ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmin"].Value.ToString())
  823. {
  824. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  825. }
  826. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "="+ ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmax"].Value.ToString())
  827. {
  828. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  829. }
  830. }
  831. 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(), ""))
  832. {
  833. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  834. }
  835. 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(), ""))
  836. {
  837. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  838. }
  839. 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(), ""))
  840. {
  841. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  842. }
  843. 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(), ""))
  844. {
  845. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  846. }
  847. 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(), ""))
  848. {
  849. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  850. }
  851. 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(), ""))
  852. {
  853. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  854. }
  855. 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(), ""))
  856. {
  857. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  858. }
  859. 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(), ""))
  860. {
  861. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  862. }
  863. 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(), ""))
  864. {
  865. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  866. }
  867. 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(), ""))
  868. {
  869. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  870. }
  871. 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(), ""))
  872. {
  873. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  874. }
  875. 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(), ""))
  876. {
  877. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  878. }
  879. 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(), ""))
  880. {
  881. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  882. }
  883. 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(), ""))
  884. {
  885. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  886. }
  887. 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(), ""))
  888. {
  889. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  890. }
  891. 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(), ""))
  892. {
  893. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  894. }
  895. }
  896. else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值")
  897. {
  898. DataTable dt = new DataTable();
  899. 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(), ""))
  900. {
  901. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  902. }
  903. 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(), ""))
  904. {
  905. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  906. }
  907. 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(), ""))
  908. {
  909. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  910. }
  911. 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(), ""))
  912. {
  913. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  914. }
  915. 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(), ""))
  916. {
  917. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  918. }
  919. 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(), ""))
  920. {
  921. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  922. }
  923. }
  924. }
  925. }
  926. }
  927. }
  928. catch (Exception ex)
  929. {
  930. System.Diagnostics.Debug.WriteLine(ex.ToString());
  931. MessageBox.Show("系统出错,请联系管理人员", "警告");
  932. }
  933. }*/
  934. /*private void DoQueryC()
  935. {
  936. try
  937. {
  938. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  939. if (ugr == null)
  940. return;
  941. this.dataSet3.Clear();
  942. if (ugr.Cells["CHEMID"].Text.ToString() == "")
  943. {
  944. return;
  945. }
  946. string cic_id = ugr.Cells["CHEMID"].Value.ToString();
  947. CoreClientParam ccp = new CoreClientParam();
  948. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  949. ccp.MethodName = "GetChemeResult";
  950. ccp.ServerParams = new object[] { cic_id };
  951. ccp.SourceDataTable = this.dataSet3.Tables[0];
  952. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  953. ccp = new CoreClientParam();
  954. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  955. ccp.MethodName = "GetCheme";
  956. ccp.ServerParams = new object[] { cic_id };
  957. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  958. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  959. {
  960. foreach (UltraGridRow ugr5 in this.ultraGrid8.Rows)
  961. {
  962. 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()))
  963. {
  964. ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red;
  965. }
  966. }
  967. }
  968. }
  969. catch (Exception ex)
  970. {
  971. System.Diagnostics.Debug.WriteLine(ex.ToString());
  972. MessageBox.Show("系统出错,请联系管理人员", "警告");
  973. }
  974. }*/
  975. /*private void DoQueryR()
  976. {
  977. try
  978. {
  979. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  980. if (ugr == null)
  981. return;
  982. this.dataSet9.Clear();
  983. if (ugr.Cells["R_CHEMID"].Text.ToString() == "")
  984. {
  985. return;
  986. }
  987. string cic_id = ugr.Cells["R_CHEMID"].Value.ToString();
  988. CoreClientParam ccp = new CoreClientParam();
  989. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  990. ccp.MethodName = "GetRChemeResult";
  991. ccp.ServerParams = new object[] { cic_id };
  992. ccp.SourceDataTable = this.dataSet9.Tables[0];
  993. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  994. ccp = new CoreClientParam();
  995. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  996. ccp.MethodName = "GetCheme";
  997. ccp.ServerParams = new object[] { cic_id };
  998. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  999. UltraGridRow judge_row = null;
  1000. foreach (UltraGridRow ugst in this.ultraGrid10.Rows)
  1001. {
  1002. if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()) && ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString().Trim() != "")
  1003. {
  1004. ugst.Appearance.BackColor = Color.Green;
  1005. }
  1006. if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
  1007. {
  1008. judge_row = ugst;
  1009. }
  1010. if (judge_row != null)
  1011. {
  1012. foreach (UltraGridRow ugs in this.ultraGrid10.Rows)
  1013. {
  1014. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)"))
  1015. {
  1016. for (int i = 0; i < ugs.Cells.Count; i++)
  1017. {
  1018. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  1019. {
  1020. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  1021. if (str_arr.Length == 1)
  1022. {
  1023. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1024. {
  1025. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  1026. {
  1027. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1028. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1029. }
  1030. }
  1031. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1032. {
  1033. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  1034. {
  1035. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1036. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1037. }
  1038. }
  1039. }
  1040. else if (str_arr.Length == 2)
  1041. {
  1042. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1043. {
  1044. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  1045. {
  1046. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1047. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1048. }
  1049. }
  1050. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1051. {
  1052. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  1053. {
  1054. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1055. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1056. }
  1057. }
  1058. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1059. {
  1060. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  1061. {
  1062. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1063. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1064. }
  1065. }
  1066. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1067. {
  1068. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  1069. {
  1070. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1071. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. }
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. catch (Exception ex)
  1083. {
  1084. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1085. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1086. }
  1087. }*/
  1088. private void QCM030615_Load(object sender, EventArgs e)
  1089. {
  1090. ValueList vsflv = new ValueList();
  1091. CoreClientParam ccp = new CoreClientParam();
  1092. ccp = new CoreClientParam();
  1093. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  1094. ccp.MethodName = "findCretInstName";
  1095. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1096. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  1097. {
  1098. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["CERT_INST_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["CERT_INST_NAME"].ToString());
  1099. }
  1100. this.comboBox1.DataSource = vsflv.ValueListItems;
  1101. this.comboBox3.SelectedIndex = 0;
  1102. this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  1103. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  1104. this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  1105. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  1106. this.DoQuery();
  1107. }
  1108. private void ultraGrid18_AfterRowActivate(object sender, EventArgs e)
  1109. {
  1110. this.dataSet19.Clear();
  1111. UltraGridRow ugr1 = this.ultraGrid18.ActiveRow;
  1112. ArrayList list = new ArrayList();
  1113. //成分
  1114. ArrayList al = new ArrayList();
  1115. //list.Add(al);
  1116. /*al.Add("UIB030220_CHEM.SELECT");
  1117. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1118. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1119. al.Add(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(0,this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3));
  1120. al.Add(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3)); */
  1121. //材质
  1122. /*al = new ArrayList();
  1123. list.Add(al);
  1124. /*if (ugr1.Cells["PHYSRESULT_DESC"].Value.ToString() != "")
  1125. {*/
  1126. /* al.Add("UIB030110_036N.SELECT");
  1127. al.Add(this.ultraGrid18.ActiveRow.Cells["SMP_NO"].Text);*/
  1128. /*}
  1129. else
  1130. {
  1131. al.Add("UIB030110_036N.SELECT");
  1132. al.Add("");
  1133. al.Add("");
  1134. }*/
  1135. string cic_id = ugr1.Cells["R_CIC_ID"].Value.ToString();
  1136. if (ugr1.Cells["R_CIC_RESULT_DESC"].Value.ToString() != "")
  1137. {
  1138. CoreClientParam ccp1 = new CoreClientParam();
  1139. ccp1.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1140. ccp1.MethodName = "GetChemeOrd";
  1141. ccp1.ServerParams = new object[] { cic_id };
  1142. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  1143. string design_key = ccp1.ReturnObject.ToString();
  1144. string ord_no = design_key.Substring(0, design_key.Length - 3);
  1145. string ord_seq = design_key.Substring(design_key.Length - 3);
  1146. list.Add(al);
  1147. al.Add("UIB030220_CHEM.SELECT");
  1148. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1149. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1150. /*al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text);
  1151. al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);*/
  1152. al.Add(ord_no);
  1153. al.Add(ord_seq);
  1154. }
  1155. else
  1156. {
  1157. list.Add(al);
  1158. al.Add("UIB030220_CHEM.SELECT");
  1159. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1160. al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text);
  1161. al.Add("");
  1162. al.Add("");
  1163. }
  1164. //材质
  1165. al = new ArrayList();
  1166. list.Add(al);
  1167. if (ugr1.Cells["PIC_RESULT_DESC"].Value.ToString() != "")
  1168. {
  1169. al.Add("UIB030110_036N.SELECT");
  1170. al.Add(this.ultraGrid18.ActiveRow.Cells["SMP_NO"].Text);
  1171. }
  1172. else
  1173. {
  1174. al.Add("UIB030110_036N.SELECT");
  1175. al.Add("");
  1176. }
  1177. //其它
  1178. /*al = new ArrayList();
  1179. list.Add(al);
  1180. al.Add("UIB030110_OTHERS.SELECT");
  1181. al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_THK"].Text);//厚度
  1182. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1183. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1184. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1185. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1186. al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_WTH"].Text);//宽度
  1187. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1188. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1189. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1190. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1191. al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_INDIA"].Text);//内径
  1192. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1193. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1194. al.Add(this.ultraGrid18.ActiveRow.Cells["ACT_WGT"].Text);//重量
  1195. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1196. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1197. al.Add(this.ultraGrid18.ActiveRow.Cells["EXTSHAPE_QUALITY"].Text);//外观
  1198. al.Add(this.ultraGrid18.ActiveRow.Cells["CR_DK1"].Text);//缺陷
  1199. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1200. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1201. al.Add(this.ultraGrid18.ActiveRow.Cells["PACKAGE_LEVEL"].Text);//包装
  1202. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1203. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);
  1204. al.Add(this.ultraGrid18.ActiveRow.Cells["PROC_DEC_RST"].Text);//切边
  1205. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text);
  1206. al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);*/
  1207. //this.dataSet1.Tables[1].Clear();
  1208. CoreClientParam ccp = new CoreClientParam();
  1209. ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM";
  1210. ccp.MethodName = "doContinuousQluery";
  1211. ccp.ServerParams = new object[] { list };
  1212. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  1213. if (ccpList.ReturnInfo.Length == 0)
  1214. {
  1215. ArrayList aList = ccpList.ReturnObject as ArrayList;
  1216. if (aList[0] != null)
  1217. {
  1218. this.dataSet19.Tables["ingr"].Clear();
  1219. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet18.Tables["ingr"]);
  1220. tab0.TableName = "ingr";
  1221. this.dataSet19.Tables["ingr"].Merge(tab0);
  1222. }
  1223. if (aList[1] != null)
  1224. {
  1225. this.dataSet19.Tables["qlty"].Clear();
  1226. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet18.Tables["qlty"]);
  1227. tab0.TableName = "qlty";
  1228. this.dataSet19.Tables["qlty"].Merge(tab0);
  1229. }
  1230. /*if (aList[2] != null)
  1231. {
  1232. this.dataSet18.Tables["other"].Clear();
  1233. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[2] as System.Collections.ArrayList, this.dataSet18.Tables["other"]);
  1234. tab0.TableName = "other";
  1235. this.dataSet18.Tables["other"].Merge(tab0);
  1236. }*/
  1237. }//end else if
  1238. this.dataSet19.Tables["other"].Clear();
  1239. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1240. ccp.MethodName = "getToleranceInfoLZOther";
  1241. ccp.ServerParams = new object[] { ugr1.Cells["SIC_ID"].Text, ugr1.Cells["COIL_THK"].Text,
  1242. ugr1.Cells["COIL_WTH"].Text, ugr1.Cells["COIL_INDIA"].Text,ugr1.Cells["SFU_ID"].Text,
  1243. this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text,
  1244. this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text,
  1245. ugr1.Cells["PACKAGE_LEVEL"].Text,ugr1.Cells["ACT_WGT"].Text,ugr1.Cells["PROC_DEC_RST"].Text,
  1246. ugr1.Cells["CR_DK1"].Text ,ugr1.Cells["EXTSHAPE_QUALITY"].Text};
  1247. ccp.SourceDataTable = this.dataSet19.Tables["other"];
  1248. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1249. //成分判断
  1250. foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
  1251. {
  1252. double min = Convert.ToDouble(ugr.Cells["CHEM_MIN"].Text == "" ? "0" : ugr.Cells["CHEM_MIN"].Text);
  1253. double max = Convert.ToDouble(ugr.Cells["CHEM_MAX"].Text == "" ? "9999" : ugr.Cells["CHEM_MAX"].Text);
  1254. double value = Convert.ToDouble(ugr.Cells["CHEM_VAL"].Text == "" ? "-1" : ugr.Cells["CHEM_VAL"].Text);
  1255. if (value < min || value > max)
  1256. {
  1257. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1258. }
  1259. if (value == -1)//缺少实际值
  1260. {
  1261. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1262. }
  1263. }
  1264. //材质判断
  1265. foreach (UltraGridRow ugr in this.ultraGrid8.Rows)
  1266. {
  1267. if ((IsNumberal(ugr.Cells["QLTY_MIN"].Text) == true) || (IsNumberal(ugr.Cells["QLTY_MAX"].Text) == true))
  1268. {
  1269. double min = Convert.ToDouble(ugr.Cells["QLTY_MIN"].Text == "" ? "0" : ugr.Cells["QLTY_MIN"].Text);
  1270. double max = Convert.ToDouble(ugr.Cells["QLTY_MAX"].Text == "" ? "9999" : ugr.Cells["QLTY_MAX"].Text);
  1271. double value = Convert.ToDouble(ugr.Cells["QLTY_VAL_WK"].Text == "" ? "-1" : ugr.Cells["QLTY_VAL_WK"].Text);
  1272. if (value < min || value > max)
  1273. {
  1274. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1275. }
  1276. if (value == -1)//缺少实际值
  1277. {
  1278. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1279. }
  1280. }
  1281. else
  1282. {
  1283. string min = ugr.Cells["QLTY_MIN"].Text.ToString();
  1284. string value = ugr.Cells["QLTY_VAL_WK"].Text.ToString();
  1285. if (!value.Equals(min))
  1286. {
  1287. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1288. }
  1289. if (value == "")
  1290. {
  1291. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1292. }
  1293. }
  1294. }
  1295. //其它判断
  1296. foreach (UltraGridRow ugr in this.ultraGrid6.Rows)
  1297. {
  1298. string name = ugr.Cells["T_NAME"].Text.Trim();
  1299. if ("外观" == name)
  1300. {
  1301. //不相等显示红色
  1302. string waiguan = ugr.Cells["T_MIN"].Text;
  1303. if (waiguan != null && waiguan != "" && !waiguan.Equals("0") && String.Compare(waiguan, ugr.Cells["T_VALUE"].Text) > 0)
  1304. {
  1305. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1306. }
  1307. continue;
  1308. }
  1309. else if ("内径" == name)
  1310. {
  1311. //不相等显示红色
  1312. string india = ugr.Cells["T_MIN"].Text;
  1313. if (india != null && india != "" && !india.Equals("0") && !india.Equals(ugr.Cells["T_VALUE"].Text))
  1314. {
  1315. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1316. }
  1317. continue;
  1318. }
  1319. else if ("包装" == name)
  1320. {
  1321. if ("不包装".Equals(ugr.Cells["T_MIN"].Text) && "XX".Equals(ugr.Cells["T_VALUE"].Text))
  1322. { }
  1323. else
  1324. {
  1325. //不相等显示红色
  1326. if (!ugr.Cells["T_MIN"].Text.Equals(ugr.Cells["T_VALUE"].Text))
  1327. {
  1328. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1329. }
  1330. }
  1331. continue;
  1332. }
  1333. else if ("切边" == name)
  1334. {
  1335. if ("Y".Equals(ugr.Cells["T_MIN"].Text) && "2".Equals(ugr.Cells["T_VALUE"].Text))
  1336. {
  1337. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1338. }
  1339. continue;
  1340. }
  1341. if ((IsNumberal(ugr.Cells["T_MIN"].Text) == true) || (IsNumberal(ugr.Cells["T_MAX"].Text) == true))
  1342. {
  1343. double min = Convert.ToDouble(ugr.Cells["T_MIN"].Text == "" ? "0" : ugr.Cells["T_MIN"].Text);
  1344. double max = Convert.ToDouble(ugr.Cells["T_MAX"].Text == "" ? "9999" : ugr.Cells["T_MAX"].Text);
  1345. double value = Convert.ToDouble(ugr.Cells["T_VALUE"].Text == "" ? "-1" : ugr.Cells["T_VALUE"].Text);
  1346. if (value < min || value > max)
  1347. {
  1348. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1349. }
  1350. if (value == -1)//缺少实际值
  1351. {
  1352. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  1353. }
  1354. }
  1355. }
  1356. }
  1357. /*private void DoQueryM1()
  1358. {
  1359. try
  1360. {
  1361. UltraGridRow ugr = this.ultraGrid18.ActiveRow;
  1362. if (ugr == null)
  1363. return;
  1364. this.dataSet15.Clear();
  1365. if (ugr.Cells["SIC_ID"].Text.ToString() == "")
  1366. {
  1367. return;
  1368. }
  1369. string sic = ugr.Cells["SIC_ID"].Text.ToString();
  1370. CoreClientParam ccp = new CoreClientParam();
  1371. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1372. ccp.MethodName = "getToleranceInfoNew";
  1373. ccp.ServerParams = new object[] { sic };
  1374. ccp.SourceDataTable = this.dataSet15.Tables[0];
  1375. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1376. this.dataSet16.Clear();
  1377. ccp = new CoreClientParam();
  1378. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  1379. ccp.MethodName = "getQcmJudgeMeasureJ";
  1380. ccp.ServerParams = new object[] { sic };
  1381. ccp.SourceDataTable = this.dataSet16.Tables[0];
  1382. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1383. foreach (UltraGridRow ugrs in this.ultraGrid22.Rows)
  1384. {
  1385. ugrs.Cells["val"].Appearance.BackColor = Color.White;
  1386. double val1 = 0;
  1387. ArrayList list = new ArrayList();
  1388. ugrs.Appearance.BackColor = Color.White;
  1389. if (ugrs.Cells["val"].Text.ToString() == "")
  1390. {
  1391. continue;
  1392. }
  1393. if (!IsNumberal(ugrs.Cells["val"].Text.ToString()))
  1394. {
  1395. continue;
  1396. }
  1397. else if (ugrs.Cells["plan"].Text.ToString() != "")
  1398. {
  1399. val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString()) - Convert.ToDouble(ugrs.Cells["plan"].Text.ToString());
  1400. }
  1401. else
  1402. {
  1403. val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString());
  1404. }
  1405. if (ugrs.Cells["std_min_val"].Text.ToString() != "" && ugrs.Cells["std_min_val"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_min_val"].Text.ToString()) - val1 > 0)
  1406. {
  1407. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  1408. this.comboBox1.SelectedIndex = 0;
  1409. }
  1410. if (ugrs.Cells["std_max_val"].Text.ToString() != "" && ugrs.Cells["std_max_val"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_max_val"].Text.ToString()) - val1 < 0)
  1411. {
  1412. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  1413. this.comboBox1.SelectedIndex = 0;
  1414. }
  1415. if (ugrs.Cells["std_min_val_k"].Text.ToString() != "" && ugrs.Cells["std_min_val_k"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_min_val_k"].Text.ToString()) - val1 > 0)
  1416. {
  1417. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  1418. this.comboBox1.SelectedIndex = 0;
  1419. }
  1420. if (ugrs.Cells["std_max_val_k"].Text.ToString() != "" && ugrs.Cells["std_max_val_k"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_max_val_k"].Text.ToString()) - val1 < 0)
  1421. {
  1422. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  1423. this.comboBox1.SelectedIndex = 0;
  1424. }
  1425. if (ugrs.Cells["std_min_val_n"].Text.ToString() != "" && ugrs.Cells["std_min_val_n"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_min_val_n"].Text.ToString()) - val1 > 0)
  1426. {
  1427. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  1428. this.comboBox1.SelectedIndex = 0;
  1429. }
  1430. if (ugrs.Cells["std_max_val_n"].Text.ToString() != "" && ugrs.Cells["std_max_val_n"].Text.ToString() != "null" && Convert.ToDouble(ugrs.Cells["std_max_val_n"].Text.ToString()) - val1 < 0)
  1431. {
  1432. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  1433. this.comboBox1.SelectedIndex = 0;
  1434. }
  1435. }
  1436. }
  1437. catch (Exception ex)
  1438. {
  1439. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1440. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1441. }
  1442. }*/
  1443. /*private void DoQueryS1()
  1444. {
  1445. try
  1446. {
  1447. UltraGridRow ugr = this.ultraGrid18.ActiveRow;
  1448. if (ugr == null)
  1449. return;
  1450. this.dataSet17.Clear();
  1451. if (ugr.Cells["SFU_ID"].Text.ToString() == "")
  1452. {
  1453. return;
  1454. }
  1455. string surface_id = ugr.Cells["SFU_ID"].Value.ToString();
  1456. CoreClientParam ccp = new CoreClientParam();
  1457. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  1458. ccp.MethodName = "findNameByMN";
  1459. ccp.ServerParams = new object[] { surface_id };
  1460. ccp.SourceDataTable = this.dataSet17.Tables[0];
  1461. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1462. }
  1463. catch (Exception ex)
  1464. {
  1465. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1466. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1467. }
  1468. }*/
  1469. /*private void DoQueryP1()
  1470. {
  1471. try
  1472. {
  1473. UltraGridRow ugr = this.ultraGrid18.ActiveRow;
  1474. if (ugr == null)
  1475. return;
  1476. this.dataSet14.Clear();
  1477. if (ugr.Cells["PIC_ID"].Text.ToString() == "")
  1478. {
  1479. return;
  1480. }
  1481. string pic_id = ugr.Cells["PIC_ID"].Value.ToString();
  1482. CoreClientParam ccp = new CoreClientParam();
  1483. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  1484. ccp.MethodName = "querryJudgeResult";
  1485. ccp.ServerParams = new object[] { pic_id };
  1486. ccp.SourceDataTable = this.dataSet14.Tables[1];
  1487. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1488. ccp = new CoreClientParam();
  1489. ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
  1490. ccp.MethodName = "querryJudgetItem";
  1491. ccp.ServerParams = new object[] { pic_id };
  1492. ccp.SourceDataTable = this.dataSet14.Tables[0];
  1493. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1494. this.ultraGrid21.Rows.ExpandAll(true);
  1495. foreach (UltraGridRow ugr1 in this.ultraGrid21.Rows)
  1496. {
  1497. foreach (UltraGridRow ugrs in ugr1.ChildBands[0].Rows)
  1498. {
  1499. if (ugrs.Cells["defect_flag"].Value.ToString() == "是")
  1500. {
  1501. ugrs.Cells["defect_flag"].Appearance.ForeColor = Color.Red;
  1502. }
  1503. if (ugrs.Cells["isjudge"].Value.ToString() == "是")
  1504. {
  1505. if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定")
  1506. {
  1507. if (ugrs.Cells["val1"].Text.ToString() == "")
  1508. {
  1509. ugrs.Cells["val1"].Appearance.BackColor = Color.Yellow;
  1510. }
  1511. }
  1512. else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值")
  1513. {
  1514. if (ugrs.Cells["avg_val"].Text.ToString() == "")
  1515. {
  1516. ugrs.Cells["avg_val"].Appearance.BackColor = Color.Yellow;
  1517. }
  1518. }
  1519. }
  1520. if (ugrs.Cells["isjudge"].Value.ToString() == "是")
  1521. {
  1522. if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定")
  1523. {
  1524. DataTable dt = new DataTable();
  1525. if (IsNumberal(ugrs.Cells["val1"].Value.ToString()))
  1526. {
  1527. if (ishz(ugrs.Cells["jf_stdmin"].Value.ToString()) || ishz(ugrs.Cells["jf_stdmax"].Value.ToString()))
  1528. {
  1529. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1530. }
  1531. else
  1532. {
  1533. 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(), ""))
  1534. {
  1535. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1536. }
  1537. 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(), ""))
  1538. {
  1539. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1540. }
  1541. }
  1542. }
  1543. else
  1544. {
  1545. if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "=" + ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmin"].Value.ToString())
  1546. {
  1547. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1548. }
  1549. if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "=" + ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmax"].Value.ToString())
  1550. {
  1551. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1552. }
  1553. }
  1554. 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(), ""))
  1555. {
  1556. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  1557. }
  1558. 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(), ""))
  1559. {
  1560. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  1561. }
  1562. 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(), ""))
  1563. {
  1564. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  1565. }
  1566. 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(), ""))
  1567. {
  1568. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  1569. }
  1570. 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(), ""))
  1571. {
  1572. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1573. }
  1574. 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(), ""))
  1575. {
  1576. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1577. }
  1578. 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(), ""))
  1579. {
  1580. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  1581. }
  1582. 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(), ""))
  1583. {
  1584. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  1585. }
  1586. 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(), ""))
  1587. {
  1588. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  1589. }
  1590. 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(), ""))
  1591. {
  1592. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  1593. }
  1594. 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(), ""))
  1595. {
  1596. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1597. }
  1598. 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(), ""))
  1599. {
  1600. ugrs.Cells["val1"].Appearance.ForeColor = Color.Red;
  1601. }
  1602. 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(), ""))
  1603. {
  1604. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  1605. }
  1606. 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(), ""))
  1607. {
  1608. ugrs.Cells["val2"].Appearance.ForeColor = Color.Red;
  1609. }
  1610. 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(), ""))
  1611. {
  1612. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  1613. }
  1614. 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(), ""))
  1615. {
  1616. ugrs.Cells["val3"].Appearance.ForeColor = Color.Red;
  1617. }
  1618. }
  1619. else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值")
  1620. {
  1621. DataTable dt = new DataTable();
  1622. 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(), ""))
  1623. {
  1624. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  1625. }
  1626. 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(), ""))
  1627. {
  1628. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  1629. }
  1630. 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(), ""))
  1631. {
  1632. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  1633. }
  1634. 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(), ""))
  1635. {
  1636. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  1637. }
  1638. 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(), ""))
  1639. {
  1640. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  1641. }
  1642. 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(), ""))
  1643. {
  1644. ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red;
  1645. }
  1646. }
  1647. }
  1648. }
  1649. }
  1650. }
  1651. catch (Exception ex)
  1652. {
  1653. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1654. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1655. }
  1656. }*/
  1657. /*private void DoQueryC1()
  1658. {
  1659. try
  1660. {
  1661. UltraGridRow ugr = this.ultraGrid18.ActiveRow;
  1662. if (ugr == null)
  1663. return;
  1664. this.dataSet13.Clear();
  1665. if (ugr.Cells["CIC_ID"].Text.ToString() == "")
  1666. {
  1667. return;
  1668. }
  1669. string cic_id = ugr.Cells["CIC_ID"].Value.ToString();
  1670. CoreClientParam ccp = new CoreClientParam();
  1671. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1672. ccp.MethodName = "GetChemeResult";
  1673. ccp.ServerParams = new object[] { cic_id };
  1674. ccp.SourceDataTable = this.dataSet13.Tables[0];
  1675. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1676. ccp = new CoreClientParam();
  1677. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1678. ccp.MethodName = "GetCheme";
  1679. ccp.ServerParams = new object[] { cic_id };
  1680. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1681. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  1682. {
  1683. foreach (UltraGridRow ugr5 in this.ultraGrid8.Rows)
  1684. {
  1685. 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()))
  1686. {
  1687. ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red;
  1688. }
  1689. }
  1690. }
  1691. }
  1692. catch (Exception ex)
  1693. {
  1694. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1695. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1696. }
  1697. }*/
  1698. /*private void DoQueryR1()
  1699. {
  1700. try
  1701. {
  1702. UltraGridRow ugr = this.ultraGrid18.ActiveRow;
  1703. if (ugr == null)
  1704. return;
  1705. this.dataSet12.Clear();
  1706. if (ugr.Cells["R_CIC_ID"].Text.ToString() == "")
  1707. {
  1708. return;
  1709. }
  1710. string cic_id = ugr.Cells["R_CIC_ID"].Value.ToString();
  1711. CoreClientParam ccp = new CoreClientParam();
  1712. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1713. ccp.MethodName = "GetRChemeResult";
  1714. ccp.ServerParams = new object[] { cic_id };
  1715. ccp.SourceDataTable = this.dataSet12.Tables[0];
  1716. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1717. ccp = new CoreClientParam();
  1718. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  1719. ccp.MethodName = "GetCheme";
  1720. ccp.ServerParams = new object[] { cic_id };
  1721. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  1722. UltraGridRow judge_row = null;
  1723. foreach (UltraGridRow ugst in this.ultraGrid25.Rows)
  1724. {
  1725. if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()) && ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString().Trim() != "")
  1726. {
  1727. ugst.Appearance.BackColor = Color.Green;
  1728. }
  1729. if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
  1730. {
  1731. judge_row = ugst;
  1732. }
  1733. if (judge_row != null)
  1734. {
  1735. foreach (UltraGridRow ugs in this.ultraGrid25.Rows)
  1736. {
  1737. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)"))
  1738. {
  1739. for (int i = 0; i < ugs.Cells.Count; i++)
  1740. {
  1741. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  1742. {
  1743. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  1744. if (str_arr.Length == 1)
  1745. {
  1746. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1747. {
  1748. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  1749. {
  1750. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1751. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1752. }
  1753. }
  1754. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1755. {
  1756. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  1757. {
  1758. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1759. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1760. }
  1761. }
  1762. }
  1763. else if (str_arr.Length == 2)
  1764. {
  1765. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1766. {
  1767. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  1768. {
  1769. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1770. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1771. }
  1772. }
  1773. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1774. {
  1775. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  1776. {
  1777. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1778. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1779. }
  1780. }
  1781. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1782. {
  1783. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  1784. {
  1785. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1786. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1787. }
  1788. }
  1789. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  1790. {
  1791. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  1792. {
  1793. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  1794. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  1795. }
  1796. }
  1797. }
  1798. }
  1799. }
  1800. }
  1801. }
  1802. }
  1803. }
  1804. }
  1805. catch (Exception ex)
  1806. {
  1807. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1808. MessageBox.Show("系统出错,请联系管理人员", "警告");
  1809. }
  1810. }*/
  1811. private void ultraGrid12_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1812. {
  1813. }
  1814. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  1815. {
  1816. SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked);
  1817. SetFilterUIType(this.ultraGrid18, this.checkBox1.Checked);
  1818. /*SetFilterUIType(this.ultraGrid10, this.checkBox1.Checked);
  1819. SetFilterUIType(this.ultraGrid8, this.checkBox1.Checked);
  1820. SetFilterUIType(this.ultraGrid4, this.checkBox1.Checked);
  1821. SetFilterUIType(this.ultraGrid5, this.checkBox1.Checked);
  1822. SetFilterUIType(this.ultraGrid9, this.checkBox1.Checked);
  1823. SetFilterUIType(this.ultraGrid6, this.checkBox1.Checked);
  1824. SetFilterUIType(this.ultraGrid16, this.checkBox1.Checked);
  1825. SetFilterUIType(this.ultraGrid7, this.checkBox1.Checked);
  1826. SetFilterUIType(this.ultraGrid11, this.checkBox1.Checked);
  1827. SetFilterUIType(this.ultraGrid12, this.checkBox1.Checked);
  1828. SetFilterUIType(this.ultraGrid13, this.checkBox1.Checked);
  1829. SetFilterUIType(this.ultraGrid14, this.checkBox1.Checked);
  1830. SetFilterUIType(this.ultraGrid15, this.checkBox1.Checked);*/
  1831. }
  1832. private void SetFilterUIType(UltraGrid grid, bool checkType)
  1833. {
  1834. if (checkType)
  1835. {
  1836. grid.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  1837. }
  1838. else
  1839. {
  1840. grid.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters();
  1841. grid.DisplayLayout.Override.FilterUIType = FilterUIType.Default;
  1842. }
  1843. }
  1844. private void ultraTabControl1_Click(object sender, EventArgs e)
  1845. {
  1846. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  1847. {
  1848. this.label6.Text = "判定时间";
  1849. }
  1850. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  1851. {
  1852. this.label6.Text = "生产时间";
  1853. }
  1854. }
  1855. private void DoExport()
  1856. {
  1857. try
  1858. {
  1859. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  1860. {
  1861. if (this.ultraGrid1.Rows.Count == 0)
  1862. {
  1863. MessageBox.Show("没有可以导出的数据", "提示");
  1864. return;
  1865. }
  1866. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  1867. {
  1868. string fName = this.saveFileDialog1.FileName;
  1869. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  1870. Process.Start(fName);
  1871. }
  1872. }
  1873. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  1874. {
  1875. if (this.ultraGrid18.Rows.Count == 0)
  1876. {
  1877. MessageBox.Show("没有可以导出的数据", "提示");
  1878. return;
  1879. }
  1880. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  1881. {
  1882. string fName = this.saveFileDialog1.FileName;
  1883. this.ultraGridExcelExporter1.Export(this.ultraGrid18, fName);
  1884. Process.Start(fName);
  1885. }
  1886. }
  1887. }
  1888. catch (Exception ex)
  1889. {
  1890. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1891. }
  1892. }
  1893. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  1894. {
  1895. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  1896. {
  1897. foreach (UltraGridRow ugr in this.ultraGrid1.Rows.Where(p => p.IsFilteredOut == false).ToList())
  1898. {
  1899. if (checkBox2.Checked)
  1900. {
  1901. ugr.Selected = true;
  1902. }
  1903. else
  1904. {
  1905. ugr.Selected = false;
  1906. }
  1907. }
  1908. }
  1909. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  1910. {
  1911. foreach (UltraGridRow ugr in this.ultraGrid18.Rows.Where(p => p.IsFilteredOut == false).ToList())
  1912. {
  1913. if (checkBox2.Checked)
  1914. {
  1915. ugr.Cells["CHECK"].Value = "True";
  1916. }
  1917. else
  1918. {
  1919. ugr.Cells["CHECK"].Value = "False";
  1920. }
  1921. }
  1922. }
  1923. }
  1924. private void ultraGrid18_MouseClick(object sender, MouseEventArgs e)
  1925. {
  1926. try
  1927. {
  1928. if (this.ultraGrid18.ActiveCell.Column.Key == "DESIGN_KEY")//链接到品质设计结果查询
  1929. {
  1930. CUIB010301 frm = new CUIB010301();
  1931. frm.ob = this.ob;
  1932. frm.OrderNO = this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text;
  1933. frm.OrderSEQ = this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text;
  1934. frm.ShowDialog();
  1935. this.ultraGrid18.ActiveRow.Cells["ORDCUST_CD"].Activate();//换焦点
  1936. }
  1937. }
  1938. catch (Exception ex)
  1939. {
  1940. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1941. }
  1942. }
  1943. private void ultraGrid1_MouseDown(object sender, MouseEventArgs e)
  1944. {
  1945. try
  1946. {
  1947. if (this.ultraGrid1.ActiveCell.Column.Key == "DESIGN_KEY")//链接到品质设计结果查询
  1948. {
  1949. CUIB010301 frm = new CUIB010301();
  1950. frm.ob = this.ob;
  1951. frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text;
  1952. frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text;
  1953. frm.ShowDialog();
  1954. this.ultraGrid1.ActiveRow.Cells["CUR_PROG_CD"].Activate();//换焦点
  1955. }
  1956. }
  1957. catch (Exception ex)
  1958. {
  1959. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1960. }
  1961. }
  1962. }
  1963. }