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 System.Diagnostics; using Infragistics.Win.UltraWinGrid; namespace Core.LZMes.Client.UIB { public partial class UIB030110LT_1 : FrmBase { public UIB030110LT_1() { InitializeComponent(); } 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 "Export": this.DoExport(); break; } } public void DoQuery() { try { ArrayList al = new ArrayList(); if (textBox1.Text == "" && !this.checkBox1.Checked) { MessageBox.Show("请选择查询条件!", "提示"); return; } //al.Add("UIB030110_01_LIAN_QC.SELECT");//UIB030110_01_CJ.SELECT al.Add("UIB030110_01_CJ.SELECT"); //查询条件 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.textBox1.Text.Trim());//钢卷号 OperateConditionRecode.WriteCondition("UIB030110", this.textBox1.Text.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); 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) { System.Diagnostics.Debug.WriteLine(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, "连退"); 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, "连退"); 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, "连退"); 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["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 UIB030110LT_1_Load(object sender, EventArgs e) { try { this.comboBox2.SelectedIndex = 0; this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked; this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked; this.textBox1.Text = OperateConditionRecode.ReadCondition("UIB030110"); initCoilDefect(); } catch (Exception ex) { MessageBox.Show("初始化异常"); } } private void checkBox1_Click(object sender, EventArgs e) { this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked; this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked; } 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 ultraGrid1_KeyDown(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, "连退"); 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_DoubleClick(object sender, EventArgs e) { } 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 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