f40604ba8c79118025c45aefe80b3166e74e2159.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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 System.Collections;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Diagnostics;
  14. namespace Core.LZMes.Client.QCM
  15. {
  16. public partial class QCM030302 : FrmBase
  17. {
  18. public QCM030302()
  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 "Export":
  30. this.DoExport();
  31. break;
  32. }
  33. }
  34. private void DoQuery()
  35. {
  36. if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
  37. {
  38. DoQueryMe();
  39. }
  40. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  41. {
  42. DoQueryRe();
  43. }
  44. }
  45. //查询待判信息
  46. private void DoQueryMe()
  47. {
  48. try
  49. {
  50. this.dataSet2.Clear();
  51. string starttime = "";
  52. string endtime = "";
  53. if (checkBox2.Checked)
  54. {
  55. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  56. endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
  57. }
  58. string sbatchno = "";
  59. string ebatchno = "";
  60. if (checkBox3.Checked)
  61. {
  62. sbatchno = this.textBox1.Text.Trim();
  63. if (textBox2.Text.ToString() == "")
  64. {
  65. ebatchno = this.textBox1.Text.Trim();
  66. }
  67. else
  68. {
  69. ebatchno = this.textBox2.Text.Trim();
  70. }
  71. }
  72. if (!checkBox2.Checked && !checkBox3.Checked)
  73. {
  74. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  75. return;
  76. }
  77. string orderno = this.textBox3.Text.Trim();// 订单号
  78. string psc = textBox4.Text.Trim(); //产品描述
  79. string prodline = this.comboBox3.Text.ToString();
  80. string isjudge = comboBox4.Text.ToString();
  81. CoreClientParam ccp = new CoreClientParam();
  82. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  83. ccp.MethodName = "doQueryMaterialDetailsX";
  84. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "M", prodline, isjudge };
  85. ccp.SourceDataTable = this.dataSet2.Tables[0];
  86. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  87. }
  88. catch (Exception ex)
  89. {
  90. System.Diagnostics.Debug.WriteLine(ex.ToString());
  91. MessageBox.Show("系统出错,请联系管理人员", "警告");
  92. }
  93. }
  94. //查询判定记录
  95. private void DoQueryRe()
  96. {
  97. try
  98. {
  99. this.dataSet5.Clear();
  100. string starttime = "";
  101. string endtime = "";
  102. if (checkBox2.Checked)
  103. {
  104. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  105. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  106. }
  107. string sbatchno = "";
  108. string ebatchno = "";
  109. if (checkBox3.Checked)
  110. {
  111. sbatchno = this.textBox1.Text.Trim();
  112. if (textBox2.Text.ToString() == "")
  113. {
  114. ebatchno = this.textBox1.Text.Trim();
  115. }
  116. else
  117. {
  118. ebatchno = this.textBox2.Text.Trim();
  119. }
  120. }
  121. if (!checkBox2.Checked && !checkBox3.Checked)
  122. {
  123. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  124. return;
  125. }
  126. string orderno = this.textBox3.Text.Trim();// 订单号
  127. string psc = textBox4.Text.Trim(); //产品描述
  128. string prodline = this.comboBox3.Text.ToString();
  129. CoreClientParam ccp = new CoreClientParam();
  130. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  131. ccp.MethodName = "GetMeasureInfoX";
  132. ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno,psc,prodline };
  133. ccp.SourceDataTable = this.dataSet5.Tables[0];
  134. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  135. }
  136. catch (Exception ex)
  137. {
  138. System.Diagnostics.Debug.WriteLine(ex.ToString());
  139. MessageBox.Show("系统出错,请联系管理人员", "警告");
  140. }
  141. }
  142. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  143. {
  144. try
  145. {
  146. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  147. if (ugr == null)
  148. return;
  149. this.dataSet3.Clear();
  150. string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
  151. string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
  152. CoreClientParam ccp = new CoreClientParam();
  153. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  154. ccp.MethodName = "getToleranceNew";
  155. ccp.ServerParams = new object[] { design_key, material_no };
  156. ccp.SourceDataTable = this.dataSet3.Tables[0];
  157. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  158. this.dataSet4.Clear();
  159. string sic_id = ugr.Cells["SIZEID"].Value.ToString();
  160. if (sic_id != "")
  161. {
  162. ccp = new CoreClientParam();
  163. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  164. ccp.MethodName = "getQcmJudgeMeasure";
  165. ccp.ServerParams = new object[] { sic_id };
  166. ccp.SourceDataTable = this.dataSet7.Tables[0];
  167. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  168. }
  169. if (design_key != "")
  170. {
  171. ccp = new CoreClientParam();
  172. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  173. ccp.MethodName = "GetMemo";
  174. ccp.ServerParams = new object[] { design_key };
  175. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  176. if (ccp.SourceDataTable.Rows.Count == 0)
  177. {
  178. this.textBox6.Text = "";
  179. }
  180. else
  181. {
  182. this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
  183. }
  184. }
  185. }
  186. catch (Exception ex)
  187. {
  188. System.Diagnostics.Debug.WriteLine(ex.ToString());
  189. MessageBox.Show("系统出错,请联系管理人员", "警告");
  190. }
  191. }
  192. private void QCM0303_Load(object sender, EventArgs e)
  193. {
  194. this.comboBox3.SelectedIndex = 0;
  195. this.comboBox4.SelectedIndex = 0;
  196. ValueList vsflv = new ValueList();
  197. CoreClientParam ccp = new CoreClientParam(); ccp = new CoreClientParam();
  198. ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
  199. ccp.MethodName = "findSfLv";
  200. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  201. for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
  202. {
  203. vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
  204. }
  205. this.comboBox2.DataSource = vsflv.ValueListItems;
  206. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  207. this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  208. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
  209. DoQuery();
  210. }
  211. private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
  212. {
  213. try
  214. {
  215. UltraGridRow ugr = this.ultraGrid4.ActiveRow;
  216. if (ugr == null)
  217. return;
  218. this.dataSet6.Clear();
  219. string sic = ugr.Cells["SIC_ID"].Value.ToString();
  220. CoreClientParam ccp = new CoreClientParam();
  221. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  222. ccp.MethodName = "getToleranceInfo";
  223. ccp.ServerParams = new object[] { sic };
  224. ccp.SourceDataTable = this.dataSet6.Tables[0];
  225. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  226. this.dataSet7.Clear();
  227. ccp = new CoreClientParam();
  228. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  229. ccp.MethodName = "getQcmJudgeMeasure";
  230. ccp.ServerParams = new object[] { sic };
  231. ccp.SourceDataTable = this.dataSet7.Tables[0];
  232. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  233. }
  234. catch (Exception ex)
  235. {
  236. System.Diagnostics.Debug.WriteLine(ex.ToString());
  237. MessageBox.Show("系统出错,请联系管理人员", "警告");
  238. }
  239. }
  240. private void button1_Click(object sender, EventArgs e)
  241. {
  242. try
  243. {
  244. int count = 0;
  245. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  246. {
  247. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  248. {
  249. count++;
  250. }
  251. }
  252. List<UltraGridRow> lists = new List<UltraGridRow>();
  253. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  254. {
  255. if (ugr.Cells["CHECK"].Text.ToString() == "True")
  256. {
  257. if (count == 1)
  258. {
  259. ArrayList list1 = new ArrayList();
  260. List<ArrayList> list2 = new List<ArrayList>();
  261. List<ArrayList> list3 = new List<ArrayList>();
  262. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  263. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  264. if (comboBox1.Text.ToString() == "")
  265. {
  266. MessageBox.Show("请输入登记结果!");
  267. return;
  268. }
  269. else
  270. {
  271. if (comboBox1.Text.ToString() == "合格")
  272. {
  273. list1.Add("1");
  274. list1.Add("合格");
  275. }
  276. else if (comboBox1.Text.ToString() == "不合格")
  277. {
  278. list1.Add("2");
  279. list1.Add("不合格");
  280. }
  281. else
  282. {
  283. list1.Add("0");
  284. list1.Add("待判");
  285. }
  286. }
  287. string is_zl = "";
  288. if (comboBox2.Text.ToString() == "正品")
  289. {
  290. is_zl = "512601";
  291. }
  292. else if (comboBox2.Text.ToString() == "次品")
  293. {
  294. is_zl = "512602";
  295. }
  296. else if (comboBox2.Text.ToString() == "废品")
  297. {
  298. is_zl = "512603";
  299. }
  300. else if (comboBox2.Text.ToString() == "协议品")
  301. {
  302. is_zl = "512604";
  303. }
  304. else if (comboBox2.Text.ToString() == "订单外")
  305. {
  306. is_zl = "512605";
  307. }
  308. list1.Add(textBox5.Text.Trim().ToString());
  309. list1.Add(this.UserInfo.GetUserName());
  310. list1.Add(this.UserInfo.GetUserOrderText());
  311. list1.Add(this.UserInfo.GetUserGroupText());
  312. list1.Add(is_zl);//质量等级代码
  313. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  314. foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
  315. {
  316. ArrayList list = new ArrayList();
  317. list.Add(ugrs.Cells["bias_code"].Text.ToString());
  318. list.Add(ugrs.Cells["val"].Text.ToString());
  319. list.Add(ugrs.Cells["bias_name"].Text.ToString());
  320. list.Add(ugrs.Cells["plan"].Text.ToString());
  321. list2.Add(list);
  322. }
  323. CoreClientParam ccp = new CoreClientParam();
  324. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  325. ccp.MethodName = "judgeByHuman";
  326. ccp.ServerParams = new object[] { list1, list2, list3 };
  327. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  328. if (ccp.ReturnCode == -1)
  329. {
  330. return;
  331. }
  332. lists.Add(ugr);
  333. }
  334. else
  335. {
  336. ArrayList list1 = new ArrayList();
  337. List<ArrayList> list2 = new List<ArrayList>();
  338. List<ArrayList> list3 = new List<ArrayList>();
  339. list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
  340. list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
  341. if (comboBox1.Text.ToString() == "")
  342. {
  343. MessageBox.Show("请输入登记结果!");
  344. return;
  345. }
  346. else
  347. {
  348. if (comboBox1.Text.ToString() == "合格")
  349. {
  350. list1.Add("1");
  351. list1.Add("合格");
  352. }
  353. else if (comboBox1.Text.ToString() == "待判")
  354. {
  355. list1.Add("0");
  356. list1.Add("待判");
  357. }
  358. else
  359. {
  360. list1.Add("2");
  361. list1.Add("不合格");
  362. }
  363. }
  364. string is_zl = "";
  365. if (comboBox2.Text.ToString() == "正品")
  366. {
  367. is_zl = "512601";
  368. }
  369. else if (comboBox2.Text.ToString() == "次品")
  370. {
  371. is_zl = "512602";
  372. }
  373. else if (comboBox2.Text.ToString() == "废品")
  374. {
  375. is_zl = "512603";
  376. }
  377. else if (comboBox2.Text.ToString() == "协议品")
  378. {
  379. is_zl = "512604";
  380. }
  381. else if (comboBox2.Text.ToString() == "订单外")
  382. {
  383. is_zl = "512605";
  384. }
  385. list1.Add(textBox5.Text.Trim().ToString());
  386. list1.Add(this.UserInfo.GetUserName());
  387. list1.Add(this.UserInfo.GetUserOrderText());
  388. list1.Add(this.UserInfo.GetUserGroupText());
  389. list1.Add(is_zl);//质量等级代码
  390. list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
  391. foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
  392. {
  393. ArrayList list = new ArrayList();
  394. list.Add(ugrs.Cells["bias_code"].Text.ToString());
  395. list.Add(ugrs.Cells["val"].Text.ToString());
  396. list.Add(ugrs.Cells["bias_name"].Text.ToString());
  397. list.Add(ugrs.Cells["plan"].Text.ToString());
  398. list2.Add(list);
  399. }
  400. CoreClientParam ccp = new CoreClientParam();
  401. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  402. ccp.MethodName = "judgeByHumanX";
  403. ccp.ServerParams = new object[] { list1,list2};
  404. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  405. if (ccp.ReturnCode == -1)
  406. {
  407. return;
  408. }
  409. lists.Add(ugr);
  410. }
  411. }
  412. }
  413. for (int i = 0; i < lists.Count; i++)
  414. {
  415. lists[i].Delete(false);
  416. }
  417. MessageBox.Show("检验登记成功!");
  418. }
  419. catch (Exception EX)
  420. {
  421. MessageBox.Show(EX.ToString());
  422. }
  423. // DoQuery();
  424. }
  425. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  426. {
  427. foreach (UltraGridRow ugr in this.ultraGrid2.Rows.Where(p => p.IsFilteredOut == false).ToList())
  428. {
  429. if (checkBox1.Checked)
  430. {
  431. ugr.Cells["CHECK"].Value = "True";
  432. }
  433. else
  434. {
  435. ugr.Cells["CHECK"].Value = "False";
  436. }
  437. }
  438. }
  439. private void ultraGrid3_KeyDown(object sender, KeyEventArgs e)
  440. {
  441. }
  442. private void ultraTabControl1_Click(object sender, EventArgs e)
  443. {
  444. if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
  445. {
  446. this.label11.Visible = false;
  447. this.comboBox4.Visible = false;
  448. this.label12.Text = "判定时间";
  449. }
  450. if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
  451. {
  452. this.label11.Visible = true;
  453. this.comboBox4.Visible = true;
  454. this.label12.Text = "生产时间";
  455. }
  456. }
  457. private void DoExport()
  458. {
  459. try
  460. {
  461. if (this.ultraGrid4.Rows.Count == 0)
  462. {
  463. MessageBox.Show("没有可以导出的数据", "提示");
  464. return;
  465. }
  466. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  467. {
  468. string fName = this.saveFileDialog1.FileName;
  469. this.ultraGridExcelExporter1.Export(this.ultraGrid4, fName);
  470. Process.Start(fName);
  471. }
  472. }
  473. catch (Exception ex)
  474. {
  475. System.Diagnostics.Debug.WriteLine(ex.ToString());
  476. }
  477. }
  478. public static bool IsNumberal(string input)
  479. {
  480. bool flag = true;
  481. int count = 0;
  482. int count1 = 0;
  483. if (input.Length == 0)
  484. {
  485. flag = false;
  486. }
  487. else
  488. {
  489. char[] x = input.ToCharArray();
  490. for (int i = 0; i < input.Length; i++)
  491. {
  492. if (!char.IsNumber(x[i]) && x[i] != '.' && x[i] != '-')
  493. {
  494. flag = false; break;
  495. }
  496. if (x[i] == '.')
  497. {
  498. count++;
  499. if (i == 0 || i == input.Length - 1) flag = false;
  500. }
  501. if (x[i] == '-')
  502. {
  503. count1++;
  504. if (i > 1) flag = false;
  505. }
  506. }
  507. if (count > 1 || count1 > 1) flag = false;
  508. }
  509. return flag;
  510. }
  511. private void ultraGrid3_CellChange(object sender, CellEventArgs e)
  512. {
  513. //UltraGrid grid = (UltraGrid)sender;
  514. ////Go down one row
  515. //grid.PerformAction(UltraGridAction.EnterEditMode);
  516. //grid.PerformAction(UltraGridAction.BelowCell);
  517. foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
  518. {
  519. ugrs.Cells["val"].Appearance.BackColor = Color.White;
  520. double val1 = 0;
  521. ArrayList list = new ArrayList();
  522. ugrs.Appearance.BackColor = Color.White;
  523. if (ugrs.Cells["val"].Text.ToString() == "")
  524. {
  525. continue;
  526. }
  527. if (!IsNumberal(ugrs.Cells["val"].Text.ToString()))
  528. {
  529. continue;
  530. }
  531. else if (ugrs.Cells["plan"].Text.ToString() != "")
  532. {
  533. val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString()) - Convert.ToDouble(ugrs.Cells["plan"].Text.ToString());
  534. }
  535. else
  536. {
  537. val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString());
  538. }
  539. 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)
  540. {
  541. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  542. this.comboBox1.SelectedIndex = 0;
  543. }
  544. 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)
  545. {
  546. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  547. this.comboBox1.SelectedIndex = 0;
  548. }
  549. 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)
  550. {
  551. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  552. this.comboBox1.SelectedIndex = 0;
  553. }
  554. 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)
  555. {
  556. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  557. this.comboBox1.SelectedIndex = 0;
  558. }
  559. 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)
  560. {
  561. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  562. this.comboBox1.SelectedIndex = 0;
  563. }
  564. 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)
  565. {
  566. ugrs.Cells["val"].Appearance.BackColor = Color.Red;
  567. this.comboBox1.SelectedIndex = 0;
  568. }
  569. }
  570. }
  571. }
  572. }