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 System.Collections; using Infragistics.Win.UltraWinGrid; namespace Core.LZMes.Client.QCM { public partial class QCM030710 : FrmBase { public QCM030710() { InitializeComponent(); } public string prodline = ""; public string steelname = ""; public string steel = ""; public string material_no = ""; public string prod_name = ""; private void QCM0307_Load(object sender, EventArgs e) { try { this.dataSet7.Clear(); string surface_id = ""; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "GetGpSteel"; ccp.ServerParams = new object[] {prodline,steel }; ccp.SourceDataTable = this.dataSet7.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void button2_Click(object sender, EventArgs e) { try { this.Close(); } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void button1_Click(object sender, EventArgs e) { foreach(UltraGridRow ugr in this.ultraGrid6.Rows) { if(ugr.Cells["CHECK"].Text.ToString() == "True") { this.steelname = ugr.Cells["STEELNAME"].Value.ToString(); } } if (this.steelname == "") { MessageBox.Show("请选择改判订单!"); return; } this.Close(); } private void button3_Click(object sender, EventArgs e) { try { this.dataSet7.Clear(); string steelname = this.textBox1.Text.ToString(); string prodline = ""; //if(prod_line == "") //{ // MessageBox.Show("请选择产线!"); // return; //} //if (prod_line == "一炼钢") //{ // prodline = "4001LG0"; //} //else //{ // prodline = "4001LGX"; //} CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "GetGpSteel"; ccp.ServerParams = new object[] { prodline, steelname }; ccp.SourceDataTable = this.dataSet7.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void textBox1_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode != Keys.Enter) return;//回车时 this.dataSet7.Clear(); string steelname = this.textBox1.Text.ToString(); string prod_line = ""; //if(prod_line == "") //{ // MessageBox.Show("请选择产线!"); // return; //} //if (prod_line == "一炼钢") //{ // prodline = "4001LG0"; //} //else //{ // prodline = "4001LGX"; //} CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl"; ccp.MethodName = "GetGpSteel"; ccp.ServerParams = new object[] { prodline, steelname }; ccp.SourceDataTable = this.dataSet7.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid6_CellChange(object sender, CellEventArgs e) { this.dataSet4.Clear(); if (e.Cell.Column.Key.ToString() == "CHECK" && e.Cell.Row.Cells["CHECK"].Text.ToString() == "True") { try { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetSteelChemInfo"; ccp.ServerParams = new object[] { material_no, prod_name, prodline, e.Cell.Row.Cells["STEELNAME"].Value.ToString() }; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); if (this.ultraGrid5.DisplayLayout.Bands[0].Columns.Contains("CHECKBOXS")) { ultraGrid5.DisplayLayout.Bands[0].Columns["CHECKBOXS"].Hidden = true; } UltraGridRow judge_row = null; int count1 = 0; List s = new List(); foreach (UltraGridRow ugst in this.ultraGrid5.Rows) { 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.ultraGrid5.Rows) { if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && 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 (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } } } 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 (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } } } } 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 (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } } } 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 (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } } } 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 (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } } } 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 (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } } } } } } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } } private void ultraGrid6_BeforeCellActivate(object sender, CancelableCellEventArgs e) { foreach (UltraGridRow ugr in this.ultraGrid6.Rows.Where(p => p.IsFilteredOut == false).ToList()) { ugr.Cells["CHECK"].Value = "False"; } } } }