| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- 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<string> s = new List<string>();
- 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";
- }
- }
- }
- }
|