| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056 |
- 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;
- using System.Collections;
- using System.Diagnostics;
- namespace Core.LZMes.Client.UIB
- {
- public partial class UIB030110 : FrmBase
- {
- public UIB030110()
- {
- InitializeComponent();
- }
- // public DataSet ds = new DataSet();
- private string SLSelected = null;
- int jx = 1;
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.DoSave();
- break;
- //case "FanXiu":
- // this.FanXiu();
- //break;
- case "Export":
- this.DoExport();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- ArrayList al = new ArrayList();
- SLSelected = this.comboBox3.Text;
-
- if (textBox1.Text == "" && !this.checkBox1.Checked && this.textBox3.Text == "")
- {
- MessageBox.Show("请选择查询条件!", "提示");
- return;
- }
- //SQL
- if (this.comboBox3.Text == "酸轧")
- {
- al.Add("UIB030110_01.SELECT");
- al.Add(textBox1.Text.ToString());//轧制单元
- }
- else if (this.comboBox3.Text == "酸洗")
- {
- al.Add("UIB030110_11.SELECT");
- al.Add(textBox1.Text.ToString());//轧制单元
- }
- else if (this.comboBox3.Text == "连退")
- //al.Add("UIB030110_01_LIAN.SELECT");
- //20151103修改查询sql语句去掉重复的卷
- al.Add("UIB030110_01_LIAN_QC.SELECT");
- else if (this.comboBox3.Text == "重卷")//重卷
- {
-
- //20151103修改查询sql语句去掉重复的卷
- //al.Add("UIB030110_01_CJ_QC.SELECT");
- if (this.checkBox1.Checked)
- {
- al.Add("UIB030110_01_CJ.SELECT");
- al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));//日期
- al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));//日期
- }
- else
- {
- al.Add("UIB030110_03_CJ.SELECT");
- }
- }
- //查询条件
- if (this.comboBox3.Text == "连退" || this.comboBox3.Text == "酸轧" || this.comboBox3.Text == "酸洗")
- {
- if (this.checkBox1.Checked)
- {
- al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");//日期
- al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");//日期
- }
- else
- {
- al.Add("");
- al.Add("");
- }
- }
- al.Add(this.textBox3.Text.Trim());//钢卷号
- if (!this.checkBox1.Checked && this.textBox3.Text.Trim() == "")
- return;
- OperateConditionRecode.WriteCondition("UIB030110", this.textBox1.Text.ToString());
- OperateConditionRecode.WriteCondition("UIB030110_1", this.comboBox3.SelectedIndex.ToString());
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //MessageBox.Show(ccp.ReturnInfo, "调试信息");
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["SMP_DIR_PIC_YN"].Text == "Y"
- && ugr.Cells["SMP_PICK_YN"].Text == "")
- {
- ugr.Appearance.ForeColor = Color.Red;//字体显示红色
- //ugr.Delete();
- //ugr.Hidden = true;
- }
- //判断人工录入宽度判定值与机器测量宽度实际值之差,若≥10则显示红色
- string COILWTH = ugr.Cells["COIL_WTH"].Text;
- string DCSWTH = ugr.Cells["DCS_WTH"].Text;
- if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "" && DCSWTH != "0")
- {
- double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH);
- if (System.Math.Abs(chazhi) >= 10)
- {
- ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.Red;
- ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.Red;
- }
- else
- {
- ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
- ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- }
- else
- {
- ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
- ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色
- string COILTHK = ugr.Cells["COIL_THK"].Text;
- string DCSTHK = ugr.Cells["DCS_THK"].Text;
- if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "" && DCSTHK != "0")
- {
- double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK);
- if (System.Math.Abs(chazhi) >= 0.01)
- {
- ugr.Cells["COIL_THK"].Appearance.BackColor = Color.Red;
- ugr.Cells["DCS_THK"].Appearance.BackColor = Color.Red;
- }
- else
- {
- ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White;
- ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- }
- else
- {
- ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White;
- ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- private void DoSave()
- {
- try
- {
- //this.ultraGrid1.UpdateData();//选择以后,这里必须要updatedata。
- ArrayList list = new ArrayList();
-
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
- {
- if (ugr.Cells["SMPPICK_TP"].Text == "Y")
- {
- // smpList = new ArrayList();
- //取样操作
- jx = 1;
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i" + jx, SLSelected); jx++;//产线
- ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
- ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
- ht.Add("i" + jx, ""); jx++;//去向
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//外观等级
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
- ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
- ht.Add("i" + jx, ""); jx++;//外观缺陷1
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;//外观缺陷5
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
- ht.Add("i" + jx, "取样登记"); jx++;//操作标志
- ht.Add("o" + jx, ""); jx = 1;
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ugr.Cells["SMPPICK_TP"].Value = "";
- ArrayList all = ccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- }
- if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷
- {
- jx = 1;
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i" + jx, SLSelected); jx++;//产线
- ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
- ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
- ht.Add("i" + jx, ""); jx++;//去向
- ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
- ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
- ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
- ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
- ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
- ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
- ht.Add("i" + jx, "外观缺陷录入"); jx++;//操作标志
- ht.Add("o" + jx, ""); jx = 1;
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ugr.Cells["CRK_TP"].Value = "";
- ArrayList all = ccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- }
- if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级
- {
- jx = 1;
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i" + jx, SLSelected); jx++;//产线
- ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
- ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
- // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向
- ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向
- ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
- ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
- ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
- ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
- ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
- ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
- ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
- ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
- ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志
- ht.Add("o" + jx, ""); jx = 1;
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ugr.Cells["EXSHAPE_TP"].Value = "";
- ArrayList all = ccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- }
- }
- }
- this.ultraGrid1.UpdateData();
- this.DoQuery();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- //导出
- public void DoExport()
- {
- try
- {
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
- Process.Start(fName);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- //页面初始化时加载钢卷缺陷
- public void initCoilDefect()
- {
- try
- {
- //缺陷
- ArrayList alt = new ArrayList();
- alt.Add("UIB030110_02.SELECT");
- this.ultraCombo1Dataset.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { alt };
- ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //进程
- alt = new ArrayList();
- alt.Add("UIB030110_01.INIT_SELECT");
- this.ultraCombo1Dataset.Tables[1].Clear();
- ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { alt };
- ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["SMP_DIR_PIC_YN"].Text.Equals("Y") && ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
- {
- ugr.Cells["SMP_PICK_YN"].Value = this.comboBox1.SelectedItem.ToString();//执行取样操作,或者去除取样标记
- ugr.Cells["SMPPICK_TP"].Value = "Y";
- }
- }
- this.ultraGrid1.UpdateData();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- //取样后,重新去掉取样标记,便于下次取样操作
- this.comboBox1.SelectedIndex = 0;
- }
- private void UIB020310_Load(object sender, EventArgs e)
- {
- try
- {
- this.comboBox1.SelectedIndex = 0;
- this.comboBox2.SelectedIndex = 0;
- // this.comboBox3.SelectedIndex = 0;
- this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked;
- this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked;
- this.textBox1.Text = OperateConditionRecode.ReadCondition("UIB030110");
- //this.comboBox3.Text = OperateConditionRecode.ReadCondition("UIB030110_1");
- this.comboBox3.SelectedIndex = Convert.ToInt32(OperateConditionRecode.ReadCondition("UIB030110_1"));
- initCoilDefect();
- }
- catch (Exception ex)
- {
- MessageBox.Show("初始化异常");
- }
- }
- private void label5_Click(object sender, EventArgs e)
- {
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- try
- {
- CUIB030110 CWindow = new CUIB030110();
- CWindow.ob = this.ob;
- //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托
- if (CWindow.ShowDialog() == DialogResult.OK)
- {
- int arrayCount = CWindow.al.Count;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToLower() == "true")
- { //有选中项时,先进行清空。因为有初始选N个,第二次选M个。不清除,当M<N是,会残留N-M个。
- ugr.Cells["CRK_CD1"].Value = "";
- ugr.Cells["CRK_CD1_TYPE"].Value = "";
- ugr.Cells["CRK_CD2"].Value = "";
- ugr.Cells["CRK_CD2_TYPE"].Value = "";
- ugr.Cells["CRK_CD3"].Value = "";
- ugr.Cells["CRK_CD3_TYPE"].Value = "";
- ugr.Cells["CRK_CD4"].Value = "";
- ugr.Cells["CRK_CD4_TYPE"].Value = "";
- ugr.Cells["CRK_CD5"].Value = "";
- ugr.Cells["CRK_CD5_TYPE"].Value = "";
- for (int i = 0; i < arrayCount; i++)
- {
- // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
- ugr.Cells["CRK_CD" + Convert.ToString((i + 1))].Value = CWindow.al.GetByIndex(i).ToString().Substring(0, 2);
- ugr.Cells["CRK_CD" + Convert.ToString((i + 1)) + "_TYPE"].Value = CWindow.al.GetByIndex(i).ToString().Substring(2);
-
- }
- ugr.Cells["CRK_TP"].Value = "Y";
- }
- }
- }
- CWindow.Dispose();
- this.ultraGrid1.UpdateData();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- //委托,暂未使用
- void CWindow_frmdoquery()
- {
- try
- {
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- private void ultraCombo1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- CUIB030110SP childCib02 = new CUIB030110SP();
- childCib02.ob = this.ob;
- if (childCib02.ShowDialog() == DialogResult.OK)
- {
- }
- childCib02.Close();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- //回车保存返修温度、粗糙度、判定厚度、判定宽度
- private void ultraGrid1_KeyDown_1(object sender, KeyEventArgs e)
- {
- try
- {
- //if (SLSelected == "酸轧")
- // return;
- if (e.KeyCode != Keys.Enter)
- return; //只对回车事件操作
- if (this.ultraGrid1.ActiveCell.Column.Key != "DCS_THK"//只对判定厚度、返修温度、判定宽度操作
- && this.ultraGrid1.ActiveCell.Column.Key != "DCS_WTH"
- && this.ultraGrid1.ActiveCell.Column.Key != "CAL_TYPE_TEMP"
- && this.ultraGrid1.ActiveCell.Column.Key != "CU_CAO_DU"
- && this.ultraGrid1.ActiveCell.Column.Key != "YUAN_COIL_THK"
- && this.ultraGrid1.ActiveCell.Column.Key != "YUAN_COIL_WTH"
- )
- return;
- if (this.ultraGrid1.ActiveCell.DataChanged == false) return;//无数据变更时不做修改操作
-
-
- jx = 1;
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
-
- ht.Add("i" + jx, SLSelected); jx++;//产线
- ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text); jx++;//钢卷号
- ht.Add("i" + jx, ""); jx++;//试样号
- ht.Add("i" + jx, ""); jx++;//位置
- ht.Add("i" + jx, ""); jx++;//去向
- ht.Add("i" + jx, ""); jx++;//外观等级
- ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text); jx++;//录入厚度
- ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text); jx++;//录入宽度
- ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["CAL_TYPE_TEMP"].Text); jx++;//温度
- ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["CU_CAO_DU"].Text); jx++;//粗糙度
- ht.Add("i" + jx, ""); jx++;//是否取样
- ht.Add("i" + jx, ""); jx++;//外观缺陷1
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, ""); jx++;//外观缺陷5
- ht.Add("i" + jx, ""); jx++;
- ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
- ht.Add("i" + jx, "判定规格录入"); jx++;//操作标志
- ht.Add("o" + jx, ""); jx = 1;
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ArrayList all = ccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index;//换行前获取当前列的列序号
- //取消录入判定宽度值覆盖原来的机器测量宽度实绩值
- //this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Value = this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text;////////
- //判断人工录入判定值与机器测量实际值之差,若≥10则显示红色
- string COILWTH = this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Text;
- string DCSWTH = this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text;
- if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "")
- {
- double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH);
- if (System.Math.Abs(chazhi) >= 10)
- {
- this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.Red;
- this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.Red;
- }
- else
- {
- this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
- this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); //黄色
- }
- }
- else
- {
- this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
- this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色
- string COILTHK = this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Text;
- string DCSTHK = this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text;
- if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "")
- {
- double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK);
- if (System.Math.Abs(chazhi) >= 0.01)
- {
- this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.Red;
- this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.Red;
- }
- else
- {
- this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White;
- this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- }
- else
- {
- this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White;
- this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- }
- //换行并使其可编辑
- this.ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
- this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
- this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
-
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ultraGrid1_MouseDown(object sender, MouseEventArgs e)
- {
- try
- {
- if (this.ultraGrid1.ActiveCell.Column.Key == "ORD_NO")//链接到品质设计结果查询
- {
- UIB010301 frm = new UIB010301();
- frm.ob = this.ob;
- frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text;
- frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text;
- frm.ShowDialog();
- this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
- }
- else if (this.ultraGrid1.ActiveCell.Column.Key == "COIL_NO")
- {
- this.dataSet2.Tables[0].Clear();
- if (this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text != "")
- {
- ArrayList al = new ArrayList();
- al.Add("UIB030110_03.SELECT");
- al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
- al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- //this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void textBox1_KeyDown(object sender, KeyEventArgs e)
- {
- try
- {
- if (e.KeyCode != Keys.Enter)
- return; //只对回车事件操作
- this.DoQuery();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void checkBox1_Click(object sender, EventArgs e)
- {
- this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked;
- this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked;
- }
- private void ultraComboEditor1_SelectionChanged_1(object sender, EventArgs e)
- {
- try
- {
- object chk_ex = ultraComboEditor1.Value;
- if (this.ultraGrid1.ActiveRow == null || chk_ex == null) return;
- string chek_exs = chk_ex.ToString();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToLower() == "true")
- {
- string sz_exp = ugr.Cells["EXTSHAPE_QUALITY_S"].Text;
- if (this.comboBox3.Text == "连退")
- {
- //与酸轧的外观等级进行比较是否一致,不一致则弹出提示
- if (!sz_exp.Equals(chek_exs))
- {
- if (MessageBox.Show("所选外观等级与酸轧的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
- ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
- }
- }
- else
- {
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
- ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
- }
- }
- else if (this.comboBox3.Text == "重卷")
- {
- string lt_exp = ugr.Cells["EXTSHAPE_QUALITY_L"].Text;
- if (sz_exp.Equals(chek_exs) && lt_exp.Equals(chek_exs))
- {
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
- ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
- }
- else
- {
- if (MessageBox.Show("所选外观等级与酸轧或连退的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
- ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
- }
- }
- }
- else
- {
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
- ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
- }
- }
- }
- this.ultraGrid1.UpdateData();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ultraGrid1_Click(object sender, EventArgs e)
- {
- }
-
- //返修或降级处理
- private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- string MES = "";
- if (this.comboBox4.Text == "返修" || this.comboBox4.Text == "过渡")
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
- {
- MES += string.Format(ugr.Cells["COIL_NO"].Value.ToString()+":");
- if (ugr.Cells["COIL_THK"].Value.ToString() == "0")
- MES += string.Format("厚度为0");
- if (ugr.Cells["COIL_WTH"].Value.ToString() == "0")
- MES += string.Format("宽度为0");
- if (ugr.Cells["WGT_DEC_RST"].Value.ToString() == "")
- MES += string.Format("重量未判");
- if (ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() == "")
- MES += string.Format("外观未判");
- if (ugr.Cells["COIL_THK"].Value.ToString() != "0" && ugr.Cells["COIL_WTH"].Value.ToString() != "0"
- && ugr.Cells["WGT_DEC_RST"].Value.ToString() != "" && ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() != "")
- MES += string.Format("可以判过渡/返修");
- MES += string.Format("\r\n");
- }
- }
- if (MessageBox.Show(MES, "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
-
- }
-
-
- if (MessageBox.Show("确定执行该操作?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- if ((SLSelected == "酸轧")||(SLSelected == "酸洗"))//连退才有返修操作
- {
- if (this.comboBox4.Text == "封闭" || this.comboBox4.Text == "取消封闭"
- || this.comboBox4.Text == "返修" || this.comboBox4.Text == "取消返修"
- || this.comboBox4.Text == "过渡" || this.comboBox4.Text == "取消过渡" || this.comboBox4.Text == "处置")
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
- {
- if (this.comboBox4.Text == "封闭")
- {
- object prog_cd = ugr.Cells["CUR_PROG_CD"].Value;
- if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB"
- || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF"))
- {
- MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示");
- return;
- }
- }
- ugr.Cells["FB_YN"].Value = this.comboBox4.Text;
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i1", ugr.Cells["COIL_NO"].Text);
- ht.Add("i2", this.comboBox4.Text);
- ht.Add("i3", this.textBox4.Text);
- ht.Add("i4", this.UserInfo.GetUserName().ToString());
- ht.Add("o5", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030110_01_SUAN.CALL", ht };
- CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ArrayList all = rccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- }
- }
- }
- return;
- }
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
- {
- if (this.comboBox4.Text == "封闭")
- {
- object prog_cd = ugr.Cells["CUR_PROG_CD"].Value;
- if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB"
- || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF"))
- {
- MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示");
- return;
- }
- }
- if (this.comboBox4.Text == "" || this.comboBox4.Text == "返修")
- {
- ugr.Cells["FAN_XIU"].Value = this.comboBox4.Text;
- }
- else
- {
- ugr.Cells["RCAL_CNT"].Value = this.comboBox4.Text;
- }
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i1", ugr.Cells["COIL_NO"].Text);
- ht.Add("i2", this.comboBox4.Text);
- ht.Add("i3", this.textBox4.Text);
- ht.Add("i4", this.UserInfo.GetUserName().ToString());
- ht.Add("o5", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030110_01_LIAN.CALL", ht };
- CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ArrayList all = rccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- }
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- MessageBox.Show("系统发生错误", "提示");
- }
- }
- private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- //foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- //{
- // if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
- // {
- // ugr.Cells["COIL_RT"].Value = this.comboBox5.SelectedItem.ToString();//执行取样操作,或者去除取样标记
- // ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
- // }
- //}
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
- {
- ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
- }
- }
- this.ultraGrid1.UpdateData();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
- {
-
- UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
-
- if (comboBox2.SelectedItem.ToString() == "全部"){
- band.ColumnFilters["FB_YN"].ClearFilterConditions();
- band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
- band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
- band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
- }
- else if (comboBox2.SelectedItem.ToString() == "封闭卷")
- {
- band.ColumnFilters["FB_YN"].ClearFilterConditions();
- band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
- band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
- band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
- band.ColumnFilters["FB_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y");
- }
- else if (comboBox2.SelectedItem.ToString() == "待判卷")
- {
- band.ColumnFilters["FB_YN"].ClearFilterConditions();
- band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
- band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
- band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
- band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals,1);
- band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals, 2);
- }
- else if (comboBox2.SelectedItem.ToString() == "未取样卷")
- {
- band.ColumnFilters["FB_YN"].ClearFilterConditions();
- band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
- band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
- band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
- band.ColumnFilters["SMP_DIR_PIC_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y");
- band.ColumnFilters["SMP_PICK_YN"].FilterConditions.Add(FilterComparisionOperator.NotEquals, "Y");
-
- }
- }
- private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
- {
- ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记
- ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
- }
- }
- this.ultraGrid1.UpdateData();
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
-
- //private void ultraGrid1_KeyUp(object sender, KeyEventArgs e)
- //{
- // int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index;
- // switch (e.KeyCode)
- // {
-
- // case Keys.Up:
- // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
- // this.ultraGrid1.PerformAction(UltraGridAction.AboveRow);
- // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
- // e.Handled = true;
- // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
- // break;
- // case Keys.Down:
- // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
- // this.ultraGrid1.PerformAction(UltraGridAction.NextRow);
- // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
- // e.Handled = true;
- // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
- // break;
- // case Keys.Right:
- // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
- // this.ultraGrid1.PerformAction(UltraGridAction.NextCell);
-
- // e.Handled = true;
- // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
- // break;
- // case Keys.Left:
- // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
- // this.ultraGrid1.PerformAction(UltraGridAction.PrevCell);
-
- // e.Handled = true;
- // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
- // break;
- // }
- //}
-
-
- }
- }
|