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= 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; // } //} } }