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 CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; using System.Text.RegularExpressions; using System.Collections; namespace Core.LZMes.Client.QCM { public partial class QCM030602 : FrmBase { public QCM030602() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Judge": this.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 canceljudge() { try { QCM030607 frm = new QCM030607(); if (frm.ShowDialog() == DialogResult.OK) { string remark = frm._memo; if (remark == "") { MessageBox.Show("请录入备注信息!"); return; } if (this.ultraGrid2.Selected.Rows.Count == 0) this.ultraGrid2.ActiveRow.Selected = true; foreach (UltraGridRow ugr in this.ultraGrid2.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()); } DoQuery(); } 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 prodline = comboBox3.Text.ToString(); string cert_inst_name = this.comboBox1.Text.ToString(); string heat_no = this.textBox5.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "GetUnjudgeInfoX"; 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 prodline = comboBox3.Text.ToString(); string cert_inst_name = this.comboBox1.Text.ToString(); string heat_no = this.textBox5.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "GetjudgeInfoX"; 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 ugr18 in this.ultraGrid2.Rows) // { // if (ugr18.Cells["ISVALID"].Value.ToString() == "是 ") // { // ugr18.Cells["ISVALID"].Appearance.BackColor = Color.FromArgb(185, 235, 204); // ugr18.Cells["ISVALID"].Appearance.ForeColor = Color.Black; // } // else // { // ugr18.Cells["ISVALID"].Appearance.BackColor = Color.FromArgb(249, 198, 186); // ugr18.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) { UltraGridRow ugr = this.ultraGrid1.ActiveRow; this.textBox6.Text = ugr.Cells["ORDER_REMARK"].Text.ToString(); DoQueryC();//成分信息 DoQueryR(); DoQueryP();//材质信息 DoQueryM();//公差信息 DoQueryS();//表面信息 //DoQueryD();//探伤信息 } private void DoQueryM() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet10.Clear(); if (ugr.Cells["SIZEID"].Text.ToString() == "") { return; } string sic = ugr.Cells["SIZEID"].Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "getToleranceInfoNew"; ccp.ServerParams = new object[] { sic }; ccp.SourceDataTable = this.dataSet10.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryS() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet7.Clear(); if (ugr.Cells["SURFACEID"].Text.ToString() == "") { return; } string surface_id = ugr.Cells["SURFACEID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findNameByMN"; ccp.ServerParams = new object[] { surface_id }; ccp.SourceDataTable = this.dataSet7.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } 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); this.ultraGrid4.Rows.ExpandAll(true); 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 DoQueryC() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet3.Clear(); if (ugr.Cells["CHEMID"].Text.ToString() == "") { return; } string cic_id = ugr.Cells["CHEMID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetChemeResult"; ccp.ServerParams = new object[] { cic_id }; ccp.SourceDataTable = this.dataSet3.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetCheme"; ccp.ServerParams = new object[] { cic_id }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { foreach (UltraGridRow ugr5 in this.ultraGrid8.Rows) { 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())) { ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_name_s"].ToString()].Appearance.BackColor = Color.Red; } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryR() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet9.Clear(); //电弧炉熔炼成分 //if (ugr.Cells["HEAT_NO"].Text.ToString().StartsWith("E") && !"".Equals(ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString())) //{ // DoQueryRDHL(); // return; //} if (ugr.Cells["R_CHEMID"].Text.ToString() == "") { return; } string cic_id = ugr.Cells["R_CHEMID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetRChemeResult"; ccp.ServerParams = new object[] { cic_id }; ccp.SourceDataTable = this.dataSet9.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetCheme"; ccp.ServerParams = new object[] { cic_id }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); UltraGridRow judge_row = null; foreach (UltraGridRow ugst in this.ultraGrid10.Rows) { if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()) && ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString().Trim() != "") { ugst.Appearance.BackColor = Color.Green; } if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求")) { judge_row = ugst; } if (judge_row != null) { foreach (UltraGridRow ugs in this.ultraGrid10.Rows) { if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")) { for (int i = 0; i < ugs.Cells.Count; i++) { if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" ")) { string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#'); if (str_arr.Length == 1) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr.Length == 2) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } } } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryRDHL() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); string STEEL_NAME = ugr.Cells["STEEL_NAME"].Value.ToString(); if (string.IsNullOrEmpty(DESIGN_KEY) || string.IsNullOrEmpty(HEAT_NO)) { return; } Hashtable ht = new Hashtable(); ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ht.Add("STEEL_NAME", STEEL_NAME); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetRChemeResultDHL"; ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet9.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); UltraGridRow judge_row = null; foreach (UltraGridRow ugst in this.ultraGrid10.Rows) { if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()) && ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString().Trim() != "") { ugst.Appearance.BackColor = Color.Green; } if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求")) { judge_row = ugst; } if (judge_row != null) { foreach (UltraGridRow ugs in this.ultraGrid10.Rows) { if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")) { for (int i = 0; i < ugs.Cells.Count; i++) { if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" ")) { string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#'); if (str_arr.Length == 1) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr.Length == 2) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } } } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM030602_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.ultraGrid21.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7); //DoQuery(); } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { DoQueryC1();//成分信息 DoQueryR1(); DoQueryP1();//材质信息 DoQueryM1();//公差信息 DoQueryS1();//表面信息 } private void DoQueryM1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; this.dataSet15.Clear(); if (ugr.Cells["SIC_ID"].Text.ToString() == "") { return; } string sic = ugr.Cells["SIC_ID"].Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "getToleranceInfoNew"; ccp.ServerParams = new object[] { sic }; ccp.SourceDataTable = this.dataSet15.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryS1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; this.dataSet17.Clear(); if (ugr.Cells["SFU_ID"].Text.ToString() == "") { return; } string surface_id = ugr.Cells["SFU_ID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findNameByMN"; ccp.ServerParams = new object[] { surface_id }; ccp.SourceDataTable = this.dataSet17.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryP1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; this.dataSet14.Clear(); if (ugr.Cells["PIC_ID"].Text.ToString() == "") { return; } string pic_id = ugr.Cells["PIC_ID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "querryJudgeResult"; ccp.ServerParams = new object[] { pic_id }; ccp.SourceDataTable = this.dataSet14.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.dataSet14.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraGrid21.Rows.ExpandAll(true); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryC1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; this.dataSet13.Clear(); if (ugr.Cells["CIC_ID"].Text.ToString() == "") { return; } string cic_id = ugr.Cells["CIC_ID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetChemeResult"; ccp.ServerParams = new object[] { cic_id }; ccp.SourceDataTable = this.dataSet13.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetCheme"; ccp.ServerParams = new object[] { cic_id }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { foreach (UltraGridRow ugr5 in this.ultraGrid8.Rows) { 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())) { ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_name_s"].ToString()].Appearance.BackColor = Color.Red; } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryR1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; this.dataSet12.Clear(); //电弧炉熔炼成分 //if (ugr.Cells["HEAT_NO"].Text.ToString().StartsWith("E")) //{ // DoQueryRDHL1(); // return; //} if (ugr.Cells["R_CIC_ID"].Text.ToString() == "") { return; } string cic_id = ugr.Cells["R_CIC_ID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetRChemeResult"; ccp.ServerParams = new object[] { cic_id }; ccp.SourceDataTable = this.dataSet12.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetCheme"; ccp.ServerParams = new object[] { cic_id }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { foreach (UltraGridRow ugr5 in this.ultraGrid10.Rows) { 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())) { ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_name_s"].ToString()].Appearance.BackColor = Color.Red; } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryRDHL1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); string STEEL_NAME = ugr.Cells["STEEL_NAME"].Value.ToString(); if (string.IsNullOrEmpty(DESIGN_KEY) || string.IsNullOrEmpty(HEAT_NO)) { return; } Hashtable ht = new Hashtable(); ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ht.Add("STEEL_NAME", STEEL_NAME); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetRChemeResultDHL"; ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet12.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { foreach (UltraGridRow ugr5 in this.ultraGrid10.Rows) { 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())) { ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_name_s"].ToString()].Appearance.BackColor = Color.Red; } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid10, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid8, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid4, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid5, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid6, this.checkBox1.Checked); SetFilterUIType(this.ultraGrid20, 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.ultraGrid2.Rows.Count == 0) { MessageBox.Show("没有可以导出的数据", "提示"); return; } if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid2, 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.ultraGrid2.Rows.Where(p => p.IsFilteredOut == false).ToList()) { if (checkBox2.Checked) { ugr.Cells["CHECK"].Value = "True"; } else { ugr.Cells["CHECK"].Value = "False"; } } } } } }