using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Collections; using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; using System.Text.RegularExpressions; namespace Core.LZMes.Client.QCM { public partial class QCM030614 :FrmBase { public QCM030614() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Judge": this.Judge(); break; case "Q_Judge": this.Q_Judge(); break; case "Cancel": this.canceljudge(); break; case "Exit": this.Close(); break; case "Export": this.DoExport(); break; case "Pass": this.pass(); break; case "C": this.C(); break; case "P": this.P(); break; case "Lock": this.locked(); break; } } private void locked() { try { foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "JudgeLocking"; ccp.ServerParams = new object[] { material_no, username }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } MessageBox.Show("异常材锁定成功!"); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void pass() { try { QCM030607 frm = new QCM030607(); if (frm.ShowDialog() == DialogResult.OK) { string remark = frm._memo; List lists = new List(); foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "ultimateJudgeAutoByHuman"; ccp.ServerParams = new object[] { material_no, username, remark, "1" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("判定成功!"); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void C() { try { QCM030607 frm = new QCM030607(); if (frm.ShowDialog() == DialogResult.OK) { string remark = frm._memo; List lists = new List(); foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "ultimateJudgeAutoByHuman"; ccp.ServerParams = new object[] { material_no, username, remark, "3" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("判定成功!"); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void P() { try { QCM030607 frm = new QCM030607(); if (frm.ShowDialog() == DialogResult.OK) { string remark = frm._memo; List lists = new List(); foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "ultimateJudgeAutoByHuman"; ccp.ServerParams = new object[] { material_no, username, remark, "4" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("判定成功!"); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void Judge() { try { if (this.ultraGrid1.Selected.Rows.Count == 0) this.ultraGrid1.ActiveRow.Selected = true; List lists = new List(); foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "ultimateJudgeAuto"; ccp.ServerParams = new object[] { material_no, username,"" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("判定成功!"); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void Q_Judge() { try { if (this.ultraGrid1.Selected.Rows.Count == 0) this.ultraGrid1.ActiveRow.Selected = true; List lists = new List(); foreach (UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "ultimateJudgeAutoQZ"; ccp.ServerParams = new object[] { material_no, username }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("强制判定成功!"); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void canceljudge() { try { QCM030607 frm = new QCM030607(); if (frm.ShowDialog() == DialogResult.OK) { string remark = frm._memo; if (remark == "") { MessageBox.Show("请录入备注信息!"); return; } if (this.ultraGrid18.Selected.Rows.Count == 0) this.ultraGrid18.ActiveRow.Selected = true; foreach (UltraGridRow ugr in this.ultraGrid18.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); string utm_id = ugr.Cells["UTM_ID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "cancelUltimateJudge"; ccp.ServerParams = new object[] { username, MATERIAL_NO, utm_id,remark }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } } } MessageBox.Show("取消判定成功!"); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void DoQuery() { if (this.ultraTabControl1.Tabs[0].Selected) //待判信息 { DoQueryMe(); } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { DoQueryRe(); } } //查询待判信息 private void DoQueryMe() { try { this.dataSet1.Clear(); string ebatchno = ""; string bbatchno = textBox4.Text.Trim(); if (textBox2.Text.ToString() == "") { ebatchno = this.textBox4.Text.Trim(); } else { ebatchno = textBox2.Text.Trim(); } string design_key = textBox1.Text.Trim(); string psc = textBox3.Text.Trim(); string cert_inst_name = this.comboBox1.Text.ToString(); string prodline = comboBox3.Text.ToString(); string heat_no = this.textBox5.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "GetUnjudgeInfoJ2N"; 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 }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } //查询判定记录 private void DoQueryRe() { try { this.dataSet2.Clear(); string ebatchno = ""; string bbatchno = textBox4.Text.Trim(); if (textBox2.Text.ToString() == "") { ebatchno = this.textBox4.Text.Trim(); } else { ebatchno = textBox2.Text.Trim(); } string design_key = textBox1.Text.Trim(); string psc = textBox3.Text.Trim(); string cert_inst_name = this.comboBox1.Text.ToString(); string prodline = comboBox3.Text.ToString(); string heat_no = this.textBox5.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "GetjudgeInfoJLZ"; 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 }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) //{ // foreach (UltraGridRow ugr2 in this.ultraGrid18.Rows) // { // if (ugr2.Cells["ISVALID"].Value.ToString() == "是 ") // { // ugr2.Cells["ISVALID"].Appearance.BackColor = Color.FromArgb(185, 235, 204); // ugr2.Cells["ISVALID"].Appearance.ForeColor = Color.Black; // } // else // { // ugr2.Cells["ISVALID"].Appearance.BackColor = Color.FromArgb(249, 198, 186); // ugr2.Cells["ISVALID"].Appearance.ForeColor = Color.Black; // } // } //} } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { this.dataSet18.Clear(); UltraGridRow ugr1 = this.ultraGrid1.ActiveRow; ArrayList list = new ArrayList(); //成分 ArrayList al = new ArrayList(); string cic_id = ugr1.Cells["R_CHEMID"].Value.ToString(); if (ugr1.Cells["R_CHEMRESULT_DESC"].Value.ToString() != "") { CoreClientParam ccp1 = new CoreClientParam(); ccp1.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp1.MethodName = "GetChemeOrd"; ccp1.ServerParams = new object[] { cic_id }; //ccp1.ReturnObject = ""; this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal); //ArrayList deskey = ccp1.ReturnObject as ArrayList; string design_key = ccp1.ReturnObject.ToString(); string ord_no = design_key.Substring(0,design_key.Length-3); string ord_seq = design_key.Substring(design_key.Length - 3); list.Add(al); al.Add("UIB030220_CHEM.SELECT"); al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text); /*al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);*/ al.Add(ord_no); al.Add(ord_seq); } else { list.Add(al); al.Add("UIB030220_CHEM.SELECT"); al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["SLAB_NO"].Text); al.Add(""); al.Add(""); } //材质 al = new ArrayList(); list.Add(al); if (ugr1.Cells["PHYSRESULT_DESC"].Value.ToString() != "") { al.Add("UIB030110_036N.SELECT"); al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text); } else { al.Add("UIB030110_036N.SELECT"); al.Add(""); } //其它 /*al = new ArrayList(); list.Add(al); al.Add("UIB030110_OTHERS.SELECT"); al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Text);//厚度 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Text);//宽度 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_INDIA"].Text);//内径 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ACT_WGT"].Text);//重量 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["EXTSHAPE_QUALITY"].Text);//外观 al.Add(this.ultraGrid1.ActiveRow.Cells["CR_DK1"].Text);//缺陷 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["PACKAGE_LEVEL"].Text);//包装 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["PROC_DEC_RST"].Text);//切边 al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text);*/ //this.dataSet1.Tables[1].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doContinuousQluery"; ccp.ServerParams = new object[] { list }; CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal); if (ccpList.ReturnInfo.Length == 0) { ArrayList aList = ccpList.ReturnObject as ArrayList; if (aList[0] != null) { this.dataSet18.Tables["ingr"].Clear(); System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet18.Tables["ingr"]); tab0.TableName = "ingr"; this.dataSet18.Tables["ingr"].Merge(tab0); } if (aList[1] != null) { this.dataSet18.Tables["qlty"].Clear(); System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet18.Tables["qlty"]); tab0.TableName = "qlty"; this.dataSet18.Tables["qlty"].Merge(tab0); } /*if (aList[2] != null) { this.dataSet18.Tables["other"].Clear(); System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[2] as System.Collections.ArrayList, this.dataSet18.Tables["other"]); tab0.TableName = "other"; this.dataSet18.Tables["other"].Merge(tab0); }*/ }//end else if this.dataSet18.Tables["other"].Clear(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "getToleranceInfoLZOther"; ccp.ServerParams = new object[] { ugr1.Cells["SIZEID"].Text, ugr1.Cells["COIL_THK"].Text, ugr1.Cells["COIL_WTH"].Text, ugr1.Cells["COIL_INDIA"].Text,ugr1.Cells["SURFACEID"].Text,ugr1.Cells["ORD_NO"].Text, ugr1.Cells["ORD_SEQ"].Text,ugr1.Cells["PACKAGE_LEVEL"].Text,ugr1.Cells["ACT_WGT"].Text,ugr1.Cells["PROC_DEC_RST"].Text, ugr1.Cells["CR_DK1"].Text,ugr1.Cells["EXTSHAPE_QUALITY"].Text }; ccp.SourceDataTable = this.dataSet18.Tables["other"]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //成分判断 foreach (UltraGridRow ugr in this.ultraGrid3.Rows) { double min = Convert.ToDouble(ugr.Cells["CHEM_MIN"].Text == "" ? "0" : ugr.Cells["CHEM_MIN"].Text); double max = Convert.ToDouble(ugr.Cells["CHEM_MAX"].Text == "" ? "9999" : ugr.Cells["CHEM_MAX"].Text); double value = Convert.ToDouble(ugr.Cells["CHEM_VAL"].Text == "" ? "-1" : ugr.Cells["CHEM_VAL"].Text); if (value < min || value > max) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == -1)//缺少实际值 { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } //材质判断 foreach (UltraGridRow ugr in this.ultraGrid4.Rows) { if ((IsNumberal(ugr.Cells["QLTY_MIN"].Text) == true) || (IsNumberal(ugr.Cells["QLTY_MAX"].Text) == true)) { double min = Convert.ToDouble(ugr.Cells["QLTY_MIN"].Text == "" ? "0" : ugr.Cells["QLTY_MIN"].Text); double max = Convert.ToDouble(ugr.Cells["QLTY_MAX"].Text == "" ? "9999" : ugr.Cells["QLTY_MAX"].Text); double value = Convert.ToDouble(ugr.Cells["QLTY_VAL_WK"].Text == "" ? "-1" : ugr.Cells["QLTY_VAL_WK"].Text); if (value < min || value > max) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == -1)//缺少实际值 { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } else { string min = ugr.Cells["QLTY_MIN"].Text.ToString(); string value = ugr.Cells["QLTY_VAL_WK"].Text.ToString(); if (!value.Equals(min)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == "") { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } } //其它判断 foreach (UltraGridRow ugr in this.ultraGrid5.Rows) { string name = ugr.Cells["T_NAME"].Text.Trim(); if ("外观" == name) { //不相等显示红色 string waiguan = ugr.Cells["T_MIN"].Text; if (waiguan != null && waiguan != "" && !waiguan.Equals("0") && String.Compare(waiguan, ugr.Cells["T_VALUE"].Text) > 0) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } continue; } else if ("内径" == name) { //不相等显示红色 string india = ugr.Cells["T_MIN"].Text; if (india != null && india != "" && !india.Equals("0") && !india.Equals(ugr.Cells["T_VALUE"].Text)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } continue; } else if ("包装" == name) { if ("不包装".Equals(ugr.Cells["T_MIN"].Text) && "XX".Equals(ugr.Cells["T_VALUE"].Text)) { } else { //不相等显示红色 if (!ugr.Cells["T_MIN"].Text.Equals(ugr.Cells["T_VALUE"].Text)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } continue; } else if ("切边" == name) { if ("Y".Equals(ugr.Cells["T_MIN"].Text) && "2".Equals(ugr.Cells["T_VALUE"].Text)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } continue; } if ((IsNumberal(ugr.Cells["T_MIN"].Text) == true) || (IsNumberal(ugr.Cells["T_MAX"].Text) == true)) { double min = Convert.ToDouble(ugr.Cells["T_MIN"].Text == "" ? "0" : ugr.Cells["T_MIN"].Text); double max = Convert.ToDouble(ugr.Cells["T_MAX"].Text == "" ? "9999" : ugr.Cells["T_MAX"].Text); double value = Convert.ToDouble(ugr.Cells["T_VALUE"].Text == "" ? "-1" : ugr.Cells["T_VALUE"].Text); if (value < min || value > max) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == -1)//缺少实际值 { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } /*else { string min = ugr.Cells["T_MIN"].Text.ToString(); string value = ugr.Cells["T_VALUE"].Text.ToString(); if (!value.Equals(min)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == "") { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } }*/ } } private void DoQueryD() { } public static bool IsNumberal(string input) { bool flag = true; int count = 0; int count1 = 0; if (input.Length == 0) { flag = false; } else { char[] x = input.ToCharArray(); for (int i = 0; i < input.Length; i++) { if (!char.IsNumber(x[i]) && x[i] != '.'&&x[i] != '-') { flag = false; break; } if (x[i] == '.') { count++; if (i == 0 || i == input.Length - 1) flag = false; } if (x[i] == '-') { count1++; if (i >1) flag = false; } } if (count > 1 || count1 > 1) flag = false; } return flag; } private static bool ishz(string text) { if (Regex.IsMatch(text, @"[\u4e00-\u9fa5]")) { return true; } else { return false; } } private void DoQueryP() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet11.Clear(); if (ugr.Cells["PHYSID"].Text.ToString() == "") { return; } string pic_id = ugr.Cells["PHYSID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "querryJudgeResult"; ccp.ServerParams = new object[] { pic_id }; ccp.SourceDataTable = this.dataSet11.Tables[1]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "querryJudgetItem"; ccp.ServerParams = new object[] { pic_id }; ccp.SourceDataTable = this.dataSet11.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); foreach (UltraGridRow ugr1 in this.ultraGrid4.Rows) { foreach (UltraGridRow ugrs in ugr1.ChildBands[0].Rows) { if (ugrs.Cells["defect_flag"].Value.ToString() == "是") { ugrs.Cells["defect_flag"].Appearance.ForeColor = Color.Red; } if (ugrs.Cells["isjudge"].Value.ToString() == "是") { if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定") { if (ugrs.Cells["val1"].Text.ToString() == "") { ugrs.Cells["val1"].Appearance.BackColor = Color.Yellow; } } else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值") { if (ugrs.Cells["avg_val"].Text.ToString() == "") { ugrs.Cells["avg_val"].Appearance.BackColor = Color.Yellow; } } } if (ugrs.Cells["isjudge"].Value.ToString() == "是") { if (ugrs.Cells["judge_basis"].Value.ToString() == "逐值判定") { DataTable dt = new DataTable(); if (IsNumberal(ugrs.Cells["val1"].Value.ToString())) { if (ishz(ugrs.Cells["jf_stdmin"].Value.ToString()) || ishz(ugrs.Cells["jf_stdmax"].Value.ToString())) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } else { 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(), "")) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } } } else { if (ugrs.Cells["jf_stdmin"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "="+ ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmin"].Value.ToString()) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } if (ugrs.Cells["jf_stdmax"].Value.ToString() != "" && ugrs.Cells["val1"].Value.ToString() != "" && "="+ ugrs.Cells["val1"].Value.ToString() != ugrs.Cells["jf_stdmax"].Value.ToString()) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } } 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(), "")) { ugrs.Cells["val2"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val2"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val3"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val3"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val2"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val2"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val3"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val3"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val1"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val2"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val2"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val3"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["val3"].Appearance.ForeColor = Color.Red; } } else if (ugrs.Cells["judge_basis"].Value.ToString() == "平均值") { DataTable dt = new DataTable(); 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(), "")) { ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red; } 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(), "")) { ugrs.Cells["avg_val"].Appearance.ForeColor = Color.Red; } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM030614_Load(object sender, EventArgs e) { ValueList vsflv = new ValueList(); CoreClientParam ccp = new CoreClientParam(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findCretInstName"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["CERT_INST_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["CERT_INST_NAME"].ToString()); } this.comboBox1.DataSource = vsflv.ValueListItems; this.comboBox3.SelectedIndex = 0; this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7); //this.DoQuery(); } private void ultraGrid12_InitializeLayout(object sender, InitializeLayoutEventArgs e) { } private void checkBox1_CheckedChanged(object sender, EventArgs e) { SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid18, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid4, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid5, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid16, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid7, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid11, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid12, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid13, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid14, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid15, this.checkBox1.Checked); } private void SetFilterUIType(UltraGrid grid, bool checkType) { if (checkType) { grid.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; } else { grid.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters(); grid.DisplayLayout.Override.FilterUIType = FilterUIType.Default; } } private void ultraTabControl1_Click(object sender, EventArgs e) { if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { this.label6.Text = "判定时间"; } if (this.ultraTabControl1.Tabs[0].Selected) //判定记录 { this.label6.Text = "生产时间"; } } private void DoExport() { try { if (this.ultraTabControl1.Tabs[0].Selected) //判定记录 { if (this.ultraGrid1.Rows.Count == 0) { MessageBox.Show("没有可以导出的数据", "提示"); return; } if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName); Process.Start(fName); } } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { if (this.ultraGrid18.Rows.Count == 0) { MessageBox.Show("没有可以导出的数据", "提示"); return; } if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid18, fName); Process.Start(fName); } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void checkBox2_CheckedChanged(object sender, EventArgs e) { if (this.ultraTabControl1.Tabs[0].Selected) //待判信息 { foreach (UltraGridRow ugr in this.ultraGrid1.Rows.Where(p => p.IsFilteredOut == false).ToList()) { if (checkBox2.Checked) { ugr.Selected = true; } else { ugr.Selected = false; } } } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { foreach (UltraGridRow ugr in this.ultraGrid18.Rows.Where(p => p.IsFilteredOut == false).ToList()) { if (checkBox2.Checked) { ugr.Cells["CHECK"].Value = "True"; } else { ugr.Cells["CHECK"].Value = "False"; } } } } private void ultraGrid18_AfterRowActivate(object sender, EventArgs e) { this.dataSet18.Clear(); UltraGridRow ugr1 = this.ultraGrid18.ActiveRow; ArrayList list = new ArrayList(); //成分 ArrayList al = new ArrayList(); list.Add(al); al.Add("UIB030220_CHEM.SELECT"); al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["SLAB_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(0,this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3)); al.Add(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3)); //材质 al = new ArrayList(); list.Add(al); /*if (ugr1.Cells["PHYSRESULT_DESC"].Value.ToString() != "") {*/ al.Add("UIB030110_036N.SELECT"); al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text); /*} else { al.Add("UIB030110_036N.SELECT"); al.Add(""); al.Add(""); }*/ //其它 /*al = new ArrayList(); list.Add(al); al.Add("UIB030110_OTHERS.SELECT"); al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_THK"].Text);//厚度 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_WTH"].Text);//宽度 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["COIL_INDIA"].Text);//内径 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ACT_WGT"].Text);//重量 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["EXTSHAPE_QUALITY"].Text);//外观 al.Add(this.ultraGrid18.ActiveRow.Cells["CR_DK1"].Text);//缺陷 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["PACKAGE_LEVEL"].Text);//包装 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["PROC_DEC_RST"].Text);//切边 al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_NO"].Text); al.Add(this.ultraGrid18.ActiveRow.Cells["ORD_SEQ"].Text);*/ //this.dataSet1.Tables[1].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doContinuousQluery"; ccp.ServerParams = new object[] { list }; CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal); if (ccpList.ReturnInfo.Length == 0) { ArrayList aList = ccpList.ReturnObject as ArrayList; if (aList[0] != null) { this.dataSet18.Tables["ingr"].Clear(); System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet18.Tables["ingr"]); tab0.TableName = "ingr"; this.dataSet18.Tables["ingr"].Merge(tab0); } if (aList[1] != null) { this.dataSet18.Tables["qlty"].Clear(); System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet18.Tables["qlty"]); tab0.TableName = "qlty"; this.dataSet18.Tables["qlty"].Merge(tab0); } /*if (aList[2] != null) { this.dataSet18.Tables["other"].Clear(); System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[2] as System.Collections.ArrayList, this.dataSet18.Tables["other"]); tab0.TableName = "other"; this.dataSet18.Tables["other"].Merge(tab0); }*/ }//end else if this.dataSet18.Tables["other"].Clear(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "getToleranceInfoLZOther"; ccp.ServerParams = new object[] { ugr1.Cells["SIC_ID"].Text, ugr1.Cells["COIL_THK"].Text, ugr1.Cells["COIL_WTH"].Text, ugr1.Cells["COIL_INDIA"].Text,ugr1.Cells["SFU_ID"].Text, this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(0,this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3), this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Substring(this.ultraGrid18.ActiveRow.Cells["DESIGN_KEY"].Text.Length - 3), ugr1.Cells["PACKAGE_LEVEL"].Text,ugr1.Cells["ACT_WGT"].Text,ugr1.Cells["PROC_DEC_RST"].Text, ugr1.Cells["CR_DK1"].Text ,ugr1.Cells["EXTSHAPE_QUALITY"].Text}; ccp.SourceDataTable = this.dataSet18.Tables["other"]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //成分判断 foreach (UltraGridRow ugr in this.ultraGrid6.Rows) { double min = Convert.ToDouble(ugr.Cells["CHEM_MIN"].Text == "" ? "0" : ugr.Cells["CHEM_MIN"].Text); double max = Convert.ToDouble(ugr.Cells["CHEM_MAX"].Text == "" ? "9999" : ugr.Cells["CHEM_MAX"].Text); double value = Convert.ToDouble(ugr.Cells["CHEM_VAL"].Text == "" ? "-1" : ugr.Cells["CHEM_VAL"].Text); if (value < min || value > max) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == -1)//缺少实际值 { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } //材质判断 foreach (UltraGridRow ugr in this.ultraGrid9.Rows) { if ((IsNumberal(ugr.Cells["QLTY_MIN"].Text) == true) || (IsNumberal(ugr.Cells["QLTY_MAX"].Text) == true)) { double min = Convert.ToDouble(ugr.Cells["QLTY_MIN"].Text == "" ? "0" : ugr.Cells["QLTY_MIN"].Text); double max = Convert.ToDouble(ugr.Cells["QLTY_MAX"].Text == "" ? "9999" : ugr.Cells["QLTY_MAX"].Text); double value = Convert.ToDouble(ugr.Cells["QLTY_VAL_WK"].Text == "" ? "-1" : ugr.Cells["QLTY_VAL_WK"].Text); if (value < min || value > max) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == -1)//缺少实际值 { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } else { string min = ugr.Cells["QLTY_MIN"].Text.ToString(); string value = ugr.Cells["QLTY_VAL_WK"].Text.ToString(); if (!value.Equals(min)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == "") { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } } //其它判断 foreach (UltraGridRow ugr in this.ultraGrid8.Rows) { string name = ugr.Cells["T_NAME"].Text.Trim(); if ("外观" == name) { //不相等显示红色 string waiguan = ugr.Cells["T_MIN"].Text; if (waiguan != null && waiguan != "" && !waiguan.Equals("0") && String.Compare(waiguan, ugr.Cells["T_VALUE"].Text) > 0) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } continue; } else if ("内径" == name) { //不相等显示红色 string india = ugr.Cells["T_MIN"].Text; if (india != null && india != "" && !india.Equals("0") && !india.Equals(ugr.Cells["T_VALUE"].Text)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } continue; } else if ("包装" == name) { if ("不包装".Equals(ugr.Cells["T_MIN"].Text) && "XX".Equals(ugr.Cells["T_VALUE"].Text)) { } else { //不相等显示红色 if (!ugr.Cells["T_MIN"].Text.Equals(ugr.Cells["T_VALUE"].Text)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } continue; } else if ("切边" == name) { if ("Y".Equals(ugr.Cells["T_MIN"].Text) && "2".Equals(ugr.Cells["T_VALUE"].Text)) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } continue; } if ((IsNumberal(ugr.Cells["T_MIN"].Text) == true) || (IsNumberal(ugr.Cells["T_MAX"].Text) == true)) { double min = Convert.ToDouble(ugr.Cells["T_MIN"].Text == "" ? "0" : ugr.Cells["T_MIN"].Text); double max = Convert.ToDouble(ugr.Cells["T_MAX"].Text == "" ? "9999" : ugr.Cells["T_MAX"].Text); double value = Convert.ToDouble(ugr.Cells["T_VALUE"].Text == "" ? "-1" : ugr.Cells["T_VALUE"].Text); if (value < min || value > max) { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } if (value == -1)//缺少实际值 { ugr.Appearance.ForeColor = Color.Red;//字体显示红色 } } } } } }