QCM030306.cs 24 KB

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