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.UltraWinGrid; using System.Diagnostics; using System.Collections; using Core.LZMes.Client.QCM; namespace Core.LZMes.Client.QCM { public partial class QCM030603 : FrmBase { public QCM030603() { 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 "Ex_warehouse": this.Ex_warehouse(); break; case "Cancel_Ex_warehouse": this.Cancel_Ex_warehouse(); break; case "Exit": this.Close(); break; case "Export": this.DoExport(); break; } } private void Ex_warehouse() { ArrayList material_no = new ArrayList(); foreach (UltraGridRow ugr in this.ultraGrid2.Rows) { if (ugr.Cells["checked"].Text.ToString() == "True") { //if (ugr.Cells["ISFX"].Text.ToString() == "是") //{ // MessageBox.Show("物料号" + ugr.Cells["MATERIAL_NO"].Value.ToString() + "已经出库!"); // return; //} material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString()); } } string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "ex_warehouse"; ccp.ServerParams = new object[] { username, material_no, "4001LG0", "J" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { MessageBox.Show("出库放行失败!"); return; } MessageBox.Show("出库放行成功!"); DoQuery(); } private void Cancel_Ex_warehouse() { ArrayList material_no = new ArrayList(); foreach (UltraGridRow ugr in this.ultraGrid2.Rows) { if (ugr.Cells["checked"].Text.ToString() == "True") { if (ugr.Cells["ISFX"].Text.ToString() != "是") { MessageBox.Show("物料号" + ugr.Cells["MATERIAL_NO"].Value.ToString() + "未出库!"); return; } material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString()); } } string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "cancel_ex_warehouse"; ccp.ServerParams = new object[] { username, material_no, "4001LG0", "J" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { MessageBox.Show("撤销出库放行失败!"); return; } MessageBox.Show("撤销出库放行成功!"); DoQuery(); } private void Judge() { try { ArrayList material_no = new ArrayList(); string username = this.UserInfo.GetUserName(); ArrayList prod_name = new ArrayList(); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["checked"].Text.ToString() == "True") { material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString()); prod_name.Add(ugr.Cells["PROD_NAME"].Value.ToString()); } } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "LgultimateJudgeAuto"; ccp.ServerParams = new object[] { material_no, username, "4001LG0", prod_name }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("综合判定成功!"); DoQuery(); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void canceljudge() { try { ArrayList material_no = new ArrayList(); string username = this.UserInfo.GetUserName(); string again_judge_type = ""; foreach (UltraGridRow ugr in this.ultraGrid2.Rows) { if (ugr.Cells["checked"].Text.ToString() == "True") { material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString()); } } if (material_no.Count == 0) { MessageBox.Show("请在判定记录中选择需要撤销判定的产品!"); return; } QCM030605 frm = new QCM030605(); if (frm.ShowDialog() == DialogResult.OK) { again_judge_type = frm.Results; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl"; ccp.MethodName = "cancelLgUltimateJudge"; ccp.ServerParams = new object[] { username, material_no, again_judge_type }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); DoQuery(); } } 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 bbatchno = textBox1.Text.Trim(); string prod_name = this.comboBox2.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "getLgZRejudgeInfo"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), bbatchno, "4001LG0", prod_name, "J" }; 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.dataSet14.Clear(); string bbatchno = textBox1.Text.Trim(); //string prod_name = this.comboBox2.Text.ToString(); //string isvalid = "0"; //if (checkBox1.Checked) //{ // isvalid = "1"; //} CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetHeatProcessInfo"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), bbatchno, "4001LG0"}; ccp.SourceDataTable = this.dataSet14.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) //{ // foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows) // { // if (ugr2.Cells["UTM_RESULT_DESC"].Value.ToString() == "合格") // { // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(185, 235, 204); // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black; // } // else // { // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(249, 198, 186); // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black; // } // } //} } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { DoQueryR(); DoQueryS();//表面信息 } 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 DoQueryR() { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet9.Clear(); 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 = "GetLgRChemeResult"; 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); //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_code_s"].ToString()].Appearance.BackColor = Color.Red; // } // } //} 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() == "交付标准(熔炼)" || 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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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 (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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 (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } } } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM030603_Load(object sender, EventArgs e) { this.comboBox2.SelectedIndex = 0; this.checkBox1.Checked = true; this.checkBox1.Visible = false; this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3); this.DoQuery(); } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { DoQueryR1(); DoQueryS1();//表面信息 } private void DoQueryS1() { try { UltraGridRow ugr = this.ultraGrid2.ActiveRow; if (ugr == null) return; this.dataSet12.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.dataSet12.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } 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.dataSet13.Clear(); 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 = "GetLgRChemeResult"; 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.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_code_s"].ToString()].Appearance.BackColor = Color.Red; // } // } //} UltraGridRow judge_row = null; foreach (UltraGridRow ugst in this.ultraGrid4.Rows) { if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString())) { 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.ultraGrid4.Rows) { if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || 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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.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; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } } } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraTabControl1_Click(object sender, EventArgs e) { if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { this.label4.Text = "判定时间"; this.checkBox1.Visible = true; this.dateTimePicker1.Value = System.DateTime.Now; } if (this.ultraTabControl1.Tabs[0].Selected) //判定记录 { this.label4.Text = "生产时间"; this.checkBox1.Visible = false; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3); } } private void DoExport() { try { //if (this.ultraGrid2.Rows.Count == 0) //{ // MessageBox.Show("没有可以导出的数据", "提示"); // return; //} this.dataSet2.Clear(); string prod_name = this.comboBox2.Text.ToString(); string isvalid = "0"; if (checkBox1.Checked) { isvalid = "1"; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "getLgZjudgeInfo"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), "", "4001LG0", prod_name, "J", isvalid }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); 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 ultraGrid5_AfterRowActivate(object sender, EventArgs e) { try { UltraGridRow ugr = this.ultraGrid5.ActiveRow; this.dataSet2.Clear(); string bbatchno = ugr.Cells["HEAT_NO"].Value.ToString(); string prod_name = ugr.Cells["PLATE_TYPE"].Value.ToString(); string isvalid = "0"; if (checkBox1.Checked) { isvalid = "1"; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "getLgZjudgeInfo"; ccp.ServerParams = new object[] { "", "", bbatchno, "4001LG0", prod_name, "J", isvalid }; 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.ultraGrid2.Rows) // { // if (ugr2.Cells["UTM_RESULT_DESC"].Value.ToString() == "合格") // { // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(185, 235, 204); // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black; // } // else // { // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(249, 198, 186); // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black; // } // } //} } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } } }