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; namespace Core.LZMes.Client.QCM.QCM03 { public partial class QCM030718 : FrmBase { public QCM030718() { InitializeComponent(); } public string design_key = ""; public string heat_no = ""; public string grade_name = ""; private void QCM030701_Load(object sender, EventArgs e) { try { this.dataSet4.Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetLgRChemeInfo"; ccp.ServerParams = new object[] { design_key, heat_no, grade_name }; 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; foreach (UltraGridRow ugs in this.ultraGrid5.Rows) { if (ugs.Cells["STD_TYPE"].Text.ToString().StartsWith("J")) { judge_row = ugs; } } 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())) { ugs.Cells[i].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())) { ugs.Cells[i].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())) { ugs.Cells[i].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())) { ugs.Cells[i].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())) { ugs.Cells[i].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())) { ugs.Cells[i].Appearance.BackColor = Color.Red; } } } } } } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void btnOK_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; this.Close(); } private void btnCancel_Click(object sender, EventArgs e) { this.Close(); } } }