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 Infragistics.Win.UltraWinGrid; using Infragistics.Win; using System.Collections; using CoreFS.CA06; using System.Diagnostics; namespace Core.LZMes.Client.QCM { public partial class QCM030501 : FrmBase { public QCM030501() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Judge": Operate(); break; case "Exit": this.Close(); break; case "Add": this.FJHAdd(); break; case "Export": this.DoExport(); break; } } private void DoQuery() { if (this.ultraTabControl1.Tabs[0].Selected) //待判信息 { DoQueryMe(); } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { DoQueryRe(); } } private void DoQueryMe() { //查询探伤待检信息(轧批号、计划号) try { this.dataSet3.Clear(); dataSet6.Clear(); string starttime = ""; string endtime = ""; if (checkBox2.Checked) { starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd"); endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd"); } string sbatchno = ""; string ebatchno = ""; if (checkBox3.Checked) { sbatchno = this.textBox2.Text.Trim(); } //if (checkBox3.Checked) //{ // sbatchno = this.textBox2.Text.Trim(); // if (textBox1.Text.ToString() == "") // { // ebatchno = this.textBox2.Text.Trim(); // } // else // { // ebatchno = this.textBox1.Text.Trim(); // } //} if (!checkBox2.Checked && !checkBox3.Checked) { MessageBox.Show("时间与轧批号必须选择其中一个条件!"); return; } string orderno = this.textBox4.Text.Trim();// 订单号 string psc = textBox3.Text.Trim(); //产品描述 string prodline = comboBox3.Text.ToString(); string isjudge = this.comboBox4.Text.ToString(); string surface_type = this.comboBox5.Text.ToString(); if (surface_type.Equals("全部")) { surface_type = ""; } if (checkBox4.Checked) { orderno = "19"; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "doQueryMaterialDetailsBS2"; ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "B", prodline, isjudge, surface_type }; ccp.SourceDataTable = this.dataSet3.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawDataB"; ccp.ServerParams = new object[] { prodline }; ccp.SourceDataTable = this.dataSet6.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); ultraCombo1.DataSource = ccp.SourceDataTable; //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = uc; this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = ultraCombo1; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQueryRe() { //查询判定记录 try { this.dataSet2.Clear(); string starttime = ""; string endtime = ""; if (checkBox2.Checked) { starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd"); endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd"); } string sbatchno = ""; string ebatchno = ""; if (checkBox3.Checked) { sbatchno = this.textBox2.Text.Trim(); } //if (checkBox3.Checked) //{ // sbatchno = this.textBox2.Text.Trim(); // if (textBox1.Text.ToString() == "") // { // ebatchno = this.textBox2.Text.Trim(); // } // else // { // ebatchno = this.textBox1.Text.Trim(); // } //} if (!checkBox2.Checked && !checkBox3.Checked) { MessageBox.Show("时间与轧批号必须选择其中一个条件!"); return; } string orderno = textBox4.Text.Trim(); string psc = textBox3.Text.Trim(); string prodline = comboBox3.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "GetSurfaceInfoB"; ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc,prodline }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void FJHAdd() { //新增非计划子板 try { QCM030611 frm = new QCM030611(); if (frm.ShowDialog() == DialogResult.OK) { string billetid = frm._memo; List lists = new List(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "AddFJHZHB"; ccp.ServerParams = new object[] { billetid }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("新增成功!"); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void Operate() { string material_no = ""; try { UltraGridRow ugr = this.ultraGrid3.ActiveRow; if (ugr == null) return; CoreClientParam ccp = new CoreClientParam(); foreach (UltraGridRow ugrs in this.ultraGrid4.Rows) { if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True") { string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString(); string username = this.UserInfo.GetUserName(); string userorder = this.UserInfo.GetUserOrderText(); string usergroup = this.UserInfo.GetUserGroupText(); string flag = ""; if(ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是")) { flag = "1"; } else { flag = "0"; } ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "repairFlaw"; ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } } this.dataSet4.Clear(); string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findNameByMN"; ccp.ServerParams = new object[] { surface_id }; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void label9_Click(object sender, EventArgs e) { try { int num1 = 0; foreach (UltraGridRow ugr in ultraGrid3.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { num1++; } } //判断是否都有勾选 if (num1 == 0) { MessageBox.Show("请勾选待检信息!"); return; } foreach (UltraGridRow ugrs in this.ultraGrid4.Rows) { if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True") { if (ugrs.Cells["IS_REPAIR"].Text.ToString().Trim() == "") { MessageBox.Show("请录入缺陷信息并选择!"); return; } } } if (comboBox1.Text.ToString().Trim() == "合格") { foreach (UltraGridRow ugr in ultraGrid3.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString(); if (surface_id != "") { String spNoSel = ""; string fh1 = ""; int fnum = 0; foreach (UltraGridRow ugrs in this.ultraGrid4.Rows) { if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True") { String flawDesc = ugrs.Cells["FLAW_DESC"].Text.ToString(); if (flawDesc == "") { MessageBox.Show("已选择的请录入缺陷信息!"); return; } fnum = fnum + 1; if (fnum <= 1) { spNoSel = flawDesc; fh1 = ","; } else { spNoSel = spNoSel + fh1 + flawDesc; } } } CoreClientParam ccpSel = new CoreClientParam(); ccpSel.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccpSel.MethodName = "ZHflawDesc"; ccpSel.ServerParams = new object[] { spNoSel, surface_id }; ccpSel = this.ExecuteNonQuery(ccpSel, CoreInvokeType.Internal); if (ccpSel.ReturnCode == -1) { return; } } } } } List lists = new List(); foreach (UltraGridRow ugr in ultraGrid3.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { ArrayList list1 = new ArrayList(); List list2 = new List(); if (comboBox1.Text.Trim() == "") { MessageBox.Show("请输入检验结果!"); return; } if (comboBox2.Text.Trim() == "") { MessageBox.Show("请输入质量等级!"); return; } string is_pass = ""; string is_zl = ""; if (comboBox1.Text.ToString() == "合格") { is_pass = "1"; } else if (comboBox1.Text.ToString() == "不合格") { is_pass = "2"; } else { is_pass = "0"; } if (comboBox2.Text.ToString() == "正品") { is_zl = "512601"; } else if (comboBox2.Text.ToString() == "次品") { is_zl = "512602"; } else if (comboBox2.Text.ToString() == "废品") { is_zl = "512603"; } else if (comboBox2.Text.ToString() == "协议品") { is_zl = "512604"; } else if (comboBox2.Text.ToString() == "订单外") { is_zl = "512605"; } else if (comboBox2.Text.ToString() == "待处理") { is_zl = "512606"; } if (ugr.Cells["DESIGN_KEY"].Text.ToString() == "") { if (MessageBox.Show(this, "非计划订单,是否继续?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString()); list1.Add(is_pass);//检验结果代码 list1.Add(comboBox1.Text.Trim().ToString());//检验结果 list1.Add(is_zl);//质量等级代码 list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称 list1.Add(textBox5.Text.ToString().Trim()); list1.Add(this.UserInfo.GetUserName());//操作人 list1.Add(this.UserInfo.GetUserOrderText());//班次 list1.Add(this.UserInfo.GetUserGroupText());//班组 list1.Add(ugr.Cells["SURFACE_TYPE"].Text.ToString().Trim()); int count = 0; int j = 1; foreach (UltraGridRow ugrs in this.ultraGrid4.Rows) { if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True") { ArrayList list = new ArrayList(); list.Add("1"); list.Add(j); if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "") { list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString()); } else { list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString()); } list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString()); if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "") { MessageBox.Show("已选择的请录入缺陷信息!"); return; } if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面") { list.Add("U"); } else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面") { list.Add("D"); } else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部") { list.Add("E"); } else { list.Add(""); //MessageBox.Show("请输入检验位置!"); //return; } //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString()); //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString()); if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "") { list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString()); } else { list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString()); } list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString()); if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "") { list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString()); } else { list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString()); } list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString()); if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "") { list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString()); } else { list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString()); } list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString()); if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "") { list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString()); } else { list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString()); } list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString()); //if (ugrs.Cells["FLAW_QUANTITY"].Text == "") //{ // MessageBox.Show("请输入数量!"); // return; //} list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString()); list.Add(ugrs.Cells["MEMO"].Text.ToString()); if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "") { list.Add("0"); } else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("待修复")) { list.Add("0"); } else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("已修复")) { list.Add("1"); } else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("未冷矫")) { list.Add("2"); } else if (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("已冷矫")) { list.Add("3"); } if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "4#飘曲" && (ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("待修复") || ugrs.Cells["IS_REPAIR"].Text.ToString().StartsWith("已修复"))) { MessageBox.Show("4#飘曲缺陷不能录入待修复或已修复!"); return; } list.Add(ugrs.Cells["FIXED_NAME"].Text.ToString()); count++; j++; list2.Add(list); } } if (count == 0 && comboBox1.Text.ToString() == "不合格") { MessageBox.Show("请录入缺陷信息并选择!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "doAddFlaw2"; ccp.ServerParams = new object[] { list2, list1 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { MessageBox.Show(ccp.ReturnInfo); return; } lists.Add(ugr); } } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } MessageBox.Show("登记成功!"); //DoQuery(); }catch(Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM0305_Load(object sender, EventArgs e) { string prodline = comboBox3.Text.ToString(); this.comboBox4.SelectedIndex = 0; this.comboBox3.SelectedIndex = 0; this.comboBox5.SelectedIndex = 0; this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7); this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue; this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue; this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue; ValueList vis_repair = new ValueList(); vis_repair.ValueListItems.Add("0", "待修复"); vis_repair.ValueListItems.Add("1", "已修复"); vis_repair.ValueListItems.Add("2", "未冷矫"); vis_repair.ValueListItems.Add("3", "已冷矫"); this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair; ValueList vprimary_flag = new ValueList(); vprimary_flag.ValueListItems.Add("1", "是"); vprimary_flag.ValueListItems.Add("0", "否"); this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag; ValueList vfixed_name = new ValueList(); vfixed_name.ValueListItems.Add("丰达凯莱工贸", "丰达凯莱工贸"); vfixed_name.ValueListItems.Add("成品修磨队", "成品修磨队"); vfixed_name.ValueListItems.Add("中板轧钢", "中板轧钢"); vfixed_name.ValueListItems.Add("中板精整", "中板精整"); vfixed_name.ValueListItems.Add("厚板轧钢", "厚板轧钢"); vfixed_name.ValueListItems.Add("厚板精整", "厚板精整"); this.ultraGrid4.DisplayLayout.Bands[0].Columns["FIXED_NAME"].ValueList = vfixed_name; ValueList vFLAW_DESC = new ValueList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawArea"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC; ValueList vflaw_pos_desc = new ValueList(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawPosDesc"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc; ValueList VFLAW_SIZE_DESC = new ValueList(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawSizeDesc"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC; ValueList vsflv = new ValueList(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findSfLv"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.comboBox2.DataSource = vsflv.ValueListItems; ValueList VFLAW_LV_DESC = new ValueList(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawLvDesc"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC; ValueList VFLAW_DIR_DESC = new ValueList(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawDirDesc"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC; ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawDataB"; ccp.ServerParams = new object[] { prodline }; ccp.SourceDataTable = this.dataSet6.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //ValueList VDEFECT_DESC = new ValueList(); //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) //{ // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString()); //} //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC; ultraCombo1.DataSource = ccp.SourceDataTable; this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = ultraCombo1; //DoQuery(); } private void ultraGrid3_AfterRowActivate(object sender, EventArgs e) { try { UltraGridRow ugr = this.ultraGrid3.ActiveRow; this.dataSet4.Clear(); string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString(); if (surface_id != "") { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findNameByMN"; ccp.ServerParams = new object[] { surface_id }; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString(); if (design_key != "") { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "GetMemo"; ccp.ServerParams = new object[] { design_key }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); if (ccp.SourceDataTable.Rows.Count == 0) { this.textBox6.Text = ""; } else { this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString(); } } this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1; foreach (UltraGridRow ugrs in this.ultraGrid4.Rows) { if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复")) { ugrs.Appearance.BackColor = Color.Pink; } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet5.Clear(); string surface_id = ugr.Cells["SURFACE_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.dataSet5.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); foreach (UltraGridRow ugrs in this.ultraGrid5.Rows) { if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复")) { ugrs.Appearance.BackColor = Color.Pink; } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList()) { if (checkBox1.Checked) { ugr.Cells["CHECK"].Value = "True"; } else { ugr.Cells["CHECK"].Value = "False"; } } } private void ultraTabControl1_Click(object sender, EventArgs e) { if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { this.label11.Visible = false; this.comboBox4.Visible = false; this.label12.Text = "判定时间"; } if (this.ultraTabControl1.Tabs[0].Selected) //判定记录 { this.label11.Visible = true; this.comboBox4.Visible = true; this.label12.Text = "生产时间"; } } private void DoExport() { try { 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); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void comboBox1_SelectedValueChanged(object sender, EventArgs e) { if (this.comboBox1.SelectedIndex == 0) { ValueList vsflv = new ValueList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findSfLv1"; ccp.ServerParams = new object[] {"2"}; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.comboBox2.DataSource = vsflv.ValueListItems; } else if (this.comboBox1.SelectedIndex == 1) { ValueList vsflv = new ValueList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findSfLv1"; ccp.ServerParams = new object[] { "0" }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.comboBox2.DataSource = vsflv.ValueListItems; } else if (this.comboBox1.SelectedIndex == 2) { ValueList vsflv = new ValueList(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findSfLv1"; ccp.ServerParams = new object[] { "1" }; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.comboBox2.DataSource = vsflv.ValueListItems; } } private void ultraGrid4_CellChange(object sender, CellEventArgs e) { if (e.Cell.Column.ToString() == "FLAW_DESC") { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findFlawDataB1"; ccp.ServerParams = new object[] { comboBox3.Text.ToString(),e.Cell.Text.ToString()}; dataSet6.Clear(); ccp.SourceDataTable = this.dataSet6.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //ValueList VDEFECT_DESC = new ValueList(); //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) //{ // VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString()); //} //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC; ultraCombo1.DataSource = ccp.SourceDataTable; this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = ultraCombo1; } } } }