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.Collections; using System.Text.RegularExpressions; namespace Core.LZMes.Client.QCM { public partial class QCM030618 :FrmBase { public QCM030618() { 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; case "JD": this.JD(); 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 JD() { try { string pline_code = ""; 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(); string ord_no = ""; if (ugr.Cells["DESIGN_KEY"].Value.ToString() != "") { ord_no = ugr.Cells["DESIGN_KEY"].Value.ToString().Substring(0,2); } else { MessageBox.Show("已脱单,不可以再解单"); return; } if (!("39".Equals(ord_no) || "49".Equals(ord_no)||"59".Equals(ord_no))) { MessageBox.Show("不是改判订单,不可以解单"); return; } if (ord_no == "39") { pline_code = "R"; } else if (ord_no == "49") { pline_code = "S"; } else if (ord_no == "59") { pline_code = "L"; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "jd"; ccp.ServerParams = new object[] { material_no, pline_code, 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 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 material_no = textBox4.Text.ToString(); 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 processes = this.comboBox5.Text.ToString(); string heat_no = this.textBox5.Text.ToString(); string yl = this.textBox2.Text.ToString(); if (processes == "") { MessageBox.Show("请选择工序!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "GetUnjudgeInfoY"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), material_no, design_key, psc, prodline, cert_inst_name, heat_no, processes,yl }; 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 material_no = textBox4.Text.ToString(); 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 processes = this.comboBox5.Text.ToString(); string heat_no = this.textBox5.Text.ToString(); string yl = textBox2.Text.ToString(); if (processes == "") { MessageBox.Show("请选择工序!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "GetjudgeInfoY"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), material_no, design_key, psc, prodline, cert_inst_name, heat_no, processes,yl }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } 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(); DoYTR(); DoYTP(); DoYTX(); } private void DoYTR() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet20.Clear(); if (ugr.Cells["R_CHEMID"].Text.ToString() == "") { return; } string CIC_ID = ugr.Cells["R_CHEMID"].Value.ToString(); string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetRChemeResultYT"; Hashtable ht = new Hashtable(); ht.Add("CIC_ID", CIC_ID); ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet20.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoYTP() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet21.Clear(); if (ugr.Cells["PHYSID"].Text.ToString() == "") { return; } string PHYSID = ugr.Cells["PHYSID"].Value.ToString(); string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetPChemeResultYT"; Hashtable ht = new Hashtable(); ht.Add("PHYSID", PHYSID); ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ht.Add("MATERIAL_NO", MATERIAL_NO); ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet21.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoYTX() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet22.Clear(); String SIZEID = "1"; if (ugr.Cells["SIZEID"].Text.ToString() != "") { SIZEID = ugr.Cells["SIZEID"].Value.ToString(); } String SURFACEID = "1"; if (ugr.Cells["SURFACEID"].Text.ToString() != "") { SURFACEID = ugr.Cells["SURFACEID"].Value.ToString(); } string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetXChemeResultYT"; Hashtable ht = new Hashtable(); ht.Add("SIZEID", SIZEID);//公差 ht.Add("SURFACEID", SURFACEID);//表面 ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ht.Add("MATERIAL_NO", MATERIAL_NO); ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet22.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM0306_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); string userid = this.UserInfo.GetUserID(); 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")) { for (int i = 0; comboBox5.Items.Count > 0; ) { comboBox5.Items.RemoveAt(0); } comboBox5.Items.Add("酸洗机组"); } else if (userid.Equals("X15724") || userid.Equals("X15833") || userid.Equals("X15816") || userid.Equals("X15734") || userid.Equals("X15827") || userid.Equals("X15830")) { for (int i = 0; comboBox5.Items.Count > 0; ) { comboBox5.Items.RemoveAt(0); } comboBox5.Items.Add("轧机机组"); } else if (userid.Equals("X15824") || userid.Equals("X15818") || userid.Equals("X15825") || userid.Equals("X15826") || userid.Equals("X15817")) { for (int i = 0; comboBox5.Items.Count > 0; ) { comboBox5.Items.RemoveAt(0); } comboBox5.Items.Add("退火炉宝信"); comboBox5.Items.Add("退火炉南方D"); comboBox5.Items.Add("退火炉艾伯纳"); comboBox5.Items.Add("退火炉南方G"); } else if (userid.Equals("X15763") || userid.Equals("X15764") || userid.Equals("X15760") || userid.Equals("X15736")) { for (int i = 0; comboBox5.Items.Count > 0; ) { comboBox5.Items.RemoveAt(0); } comboBox5.Items.Add("平整机组"); } else if (userid.Equals("X15720") || userid.Equals("X15719") || userid.Equals("X15726") || userid.Equals("X15743")) { for (int i = 0; comboBox5.Items.Count > 0; ) { comboBox5.Items.RemoveAt(0); } comboBox5.Items.Add("4mm分条机组"); comboBox5.Items.Add("12mm分条机组"); comboBox5.Items.Add("3mm横剪机组"); } //this.DoQuery(); //ValueList v = new ValueList(); //v.ValueListItems.Add("0", "否"); //v.ValueListItems.Add("1", "是"); //this.ultraGrid26.DisplayLayout.Bands[0].Columns["IS_SIDE_CUTE"].ValueList = v.Clone(); } private void ultraGrid18_AfterRowActivate(object sender, EventArgs e) { DoYTR1(); DoYTP1(); DoYTX1(); } private void DoYTR1() { try { UltraGridRow ugr = this.ultraGrid18.ActiveRow; if (ugr == null) return; this.dataSet23.Clear(); if (ugr.Cells["R_CIC_ID"].Text.ToString() == "") { return; } string CIC_ID = ugr.Cells["R_CIC_ID"].Value.ToString(); string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetRChemeResultYT"; Hashtable ht = new Hashtable(); ht.Add("CIC_ID", CIC_ID); ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet23.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoYTP1() { try { UltraGridRow ugr = this.ultraGrid18.ActiveRow; if (ugr == null) return; this.dataSet24.Clear(); if (ugr.Cells["PIC_ID"].Text.ToString() == "") { return; } string PHYSID = ugr.Cells["PIC_ID"].Value.ToString(); string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetPChemeResultYT"; Hashtable ht = new Hashtable(); ht.Add("PHYSID", PHYSID); ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ht.Add("MATERIAL_NO", MATERIAL_NO); ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet24.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoYTX1() { try { UltraGridRow ugr = this.ultraGrid18.ActiveRow; if (ugr == null) return; this.dataSet25.Clear(); String SIZEID = "1"; if (ugr.Cells["SIC_ID"].Text.ToString() != "") { SIZEID = ugr.Cells["SIC_ID"].Value.ToString(); } String SURFACEID = "1"; if (ugr.Cells["SFU_ID"].Text.ToString() != "") { SURFACEID = ugr.Cells["SFU_ID"].Value.ToString(); } string DESIGN_KEY = ugr.Cells["DESIGN_KEY"].Value.ToString(); string HEAT_NO = ugr.Cells["HEAT_NO"].Value.ToString(); string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetXChemeResultYT"; Hashtable ht = new Hashtable(); ht.Add("SIZEID", SIZEID);//公差 ht.Add("SURFACEID", SURFACEID);//表面 ht.Add("DESIGN_KEY", DESIGN_KEY); ht.Add("HEAT_NO", HEAT_NO); ht.Add("MATERIAL_NO", MATERIAL_NO); ccp.ServerParams = new object[] { ht }; ccp.SourceDataTable = this.dataSet25.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } 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.ultraGrid18, 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.ultraGrid9, this.checkBox1.Checked); //SetFilterUIType(this.ultraGrid6, 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"; } } } } } }