| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- 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;
- using System.Diagnostics;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM030807 : FrmBase
- {
- public QCM030807()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case"Query":
- this.DoQuery();
- break;
- case "Affirm":
- this.affirm();
- break;
- case "Add":
- this.Declare();
- break;
- case "UnAdd":
- this.UnDeclare();
- break;
- case "Export":
- this.DoExport();
- break;
- case "Examine":
- this.Examine();
- break;
- case "Input":
- this.Input();
- break;
- }
- }
- private void affirm()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid2.ActiveRow;
- if (ugr == null)
- return;
- string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
- string assay_no = ugr.Cells["ASSAY_NO"].Value.ToString();
- string pline_code = ugr.Cells["pline_code"].Value.ToString();
- ArrayList list1 = new ArrayList();
- list1.Add(heat_no);
- list1.Add(assay_no);
- list1.Add(pline_code);
- list1.Add(this.UserInfo.GetUserName());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "UpdateChemeInfo";
- ccp.ServerParams = new object[] { list1 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- DoQuery();
- MessageBox.Show("修改成功!");
- }
- catch(Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void Declare()
- {
- try
- {
- string prod_type = "";
- string tslx = "";
- string prod_line1 = "";
- QCM030608 frm = new QCM030608();
- frm.ob = this.ob;
- if (frm.ShowDialog() == DialogResult.OK)
- {
- prod_type = frm.prod_type;
- prod_line1 = frm.prod_line;
- tslx = frm.tslx;
- }
- string optman;
- string slab_no;
- string opttype = "1";
- string prod_line = "";
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToString() == "True")
- {
- //string opttype = "1";
- /*string prod_type = this.comboBox1.Text.ToString();
- string tslx = this.comboBox2.Text.ToString();*/
- //string prod_line = "";
- if (comboBox3.Text.ToString() == "一炼钢")
- {
- prod_line = "4001LG0";
- }
- else if (comboBox3.Text.ToString() == "二炼钢")
- {
- prod_line = "4001LGX";
- }
- else
- {
- prod_line = "";
- }
- optman = this.UserInfo.GetUserName().ToString();
- slab_no = ugr.Cells["BILLETNO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "doApplyJudge";
- ccp.ServerParams = new object[] { opttype, prod_type, tslx, prod_line, slab_no, optman };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊放行申报成功");
- }
- //UltraGridRow ugr = this.ultraGrid1.ActiveRow;
-
-
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void UnDeclare()
- {
- try
- {
- string prod_type = "";
- string tslx = "";
- string prod_line1 = "";
- QCM030608 frm = new QCM030608();
- frm.ob = this.ob;
- if (frm.ShowDialog() == DialogResult.OK)
- {
- prod_type = frm.prod_type;
- prod_line1 = frm.prod_line;
- tslx = frm.tslx;
- }
- if (prod_type == "" || prod_line1 == "" || tslx == "")
- {
- return;
- }
- string optman;
- string slab_no;
- string opttype = "2";
- string prod_line = "";
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToString() == "True")
- {
- //UltraGridRow ugr = this.ultraGrid1.ActiveRow;
-
- /*string prod_type = this.comboBox1.Text.ToString();
- string tslx = this.comboBox2.Text.ToString();*/
- if (comboBox3.Text.ToString() == "一炼钢")
- {
- prod_line = "4001LG0";
- }
- else if (comboBox3.Text.ToString() == "二炼钢")
- {
- prod_line = "4001LGX";
- }
- else
- {
- prod_line = "";
- }
- optman = this.UserInfo.GetUserName().ToString();
- slab_no = ugr.Cells["BILLETNO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "doApplyJudge";
- ccp.ServerParams = new object[] { opttype, prod_type, tslx, prod_line, slab_no, optman };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊放行撤销申报成功");
- }
-
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void Examine()
- {
- try{
- string flag1 = "";
- QCM030609 frm = new QCM030609();
- frm.ob = this.ob;
- if (frm.ShowDialog() == DialogResult.OK)
- {
- flag1 = frm.flag;
-
- }
- if (flag1=="")
- {
- return;
- }
- string optman;
- string slab_no;
- string flag ="";
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToString() == "True")
- {
- if (flag1 == "通过")
- {
- flag = "Y";
- }
- else if (flag1 == "不通过")
- {
- flag = "N";
- }
-
- optman = this.UserInfo.GetUserName().ToString();
- slab_no = ugr.Cells["BILLETNO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "ApplyJudgeCheck";//doApplyJudge
- ccp.ServerParams = new object[] { slab_no, flag, optman };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊放行审核成功");
- }
-
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void DoQuery()
- {
- DoQueryMe();
- }
- //查询待判信息
- private void DoQueryMe()
- {
- try
- {
- this.dataSet1.Clear();
- string heatno = this.textBox1.Text.Trim();
- string prod_line = "";
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "GetApplyJudgeInfo";
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- if (comboBox3.Text.ToString() == "一炼钢")
- {
- prod_line = "4001LG0";
- }
- else if (comboBox3.Text.ToString() == "二炼钢")
- {
- prod_line = "4001LGX";
- }
- else
- {
- prod_line = "";
- }
- ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno, prod_line };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void QCM030803_Load(object sender, EventArgs e)
- {
- this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
- }
- private void DoExport()
- {
- try
- {
- if (this.ultraGrid2.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的数据", "提示");
- return;
- }
- 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 ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- this.textBox2.Text = ugr.Cells["JRYQ"].Value.ToString();
- this.textBox3.Text = ugr.Cells["ZJYQ"].Value.ToString();
- this.textBox4.Text = ugr.Cells["QYYQ"].Value.ToString();
- this.textBox5.Text = ugr.Cells["RCLYQ"].Value.ToString();
- this.textBox6.Text = ugr.Cells["BILLETNO"].Value.ToString();
- this.textBox7.Text = ugr.Cells["LGJUDGEYQ"].Value.ToString();
- this.textBox8.Text = ugr.Cells["CFPDYQ"].Value.ToString();
- this.dataSet2.Clear();
- string design_key = ugr.Cells["ORDERNO"].Value.ToString();
- string smp_no = ugr.Cells["HEATNO"].Value.ToString();
- string grade_name = ugr.Cells["LGPH"].Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "GetLgRChemeInfo";
- ccp.ServerParams = new object[] { design_key, smp_no, grade_name };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- UltraGridRow judge_row = null;
- int count1 = 0;
- List<string> s = new List<string>();
- foreach (UltraGridRow ugst in this.ultraGrid3.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.ultraGrid3.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++;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- if (count1 > 0)
- {
- //this.label12.BackColor = Color.Red;
- //this.label12.Text = "" + smp_no + "有" + count1 + "条元素成分不合格!";
- //MessageBox.Show("" + smp_no + "有" + count1 + "条元素成分不合格!");
- }
- else
- {
- this.label12.Text = "";
- }
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
-
- }
- private void Input()
- {
- try
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToString() == "True")
- {
- string jryq = this.textBox2.Text.ToString();
- string zjyq = this.textBox3.Text.ToString();
- string qyyq = this.textBox4.Text.ToString();
- string rclyq = this.textBox5.Text.ToString();
- string slab_no = ugr.Cells["BILLETNO"].Value.ToString();
- string lgjudgeyq = this.textBox7.Text.ToString();
- string cfpdyq = this.textBox8.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "ApplyJudgeInput";
- ccp.ServerParams = new object[] { slab_no, jryq, zjyq, qyyq, rclyq, lgjudgeyq, cfpdyq };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊要求工艺录入成功");
- }
-
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void splitContainer2_Panel2_Paint(object sender, PaintEventArgs e)
- {
- }
- private void panel2_Paint(object sender, PaintEventArgs e)
- {
- }
- }
- }
|