| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- 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 QCM030712 : FrmBase
- {
- public QCM030712()
- {
- InitializeComponent();
- }
- public string material_no = "";
- public string prod_name = "";
- public string prodline = "";
- 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 = "GetSteelChemInfo";
- ccp.ServerParams = new object[] { material_no,prod_name,prodline,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("系统出错,请联系管理人员", "警告");
- }
- }
- }
- }
|