using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using CoreFS.CA06; using System.Collections; using Infragistics.Win.UltraWinGrid; namespace Core.LZMes.Client.UIB { public partial class UIB030160 : FrmBase { private string pickCoilNo = "";//取样卷 public UIB030160() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.DoSave(); break; } } public void DoQuery() { try { ArrayList al = new ArrayList(); if (this.comboBox3.Text == "酸洗") { al.Add("UIB030160_02.SELECT"); } else { al.Add("UIB030160_01.SELECT"); } al.Add(this.textBox1.Text.Trim()); 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); } catch (Exception ex) { } } public void DoSave() { try { // if (this.comboBox1.Text != "N") return; if (MessageBox.Show("确定不进行进行复样?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; ArrayList list = new ArrayList(); ArrayList al = null; foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { // if (ugr.Selected == true) if(ugr.Cells["CHK"].Text == "True") { al = new ArrayList(); al.Add("UIB030160_01.UPDATE"); al.Add(ugr.Cells["SMP_NO"].Text); al.Add(ugr.Cells["SMP_CUT_LOC"].Text); list.Add(al); } } if (list.Count == 0) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBSave"; ccp.MethodName = "doXmlSave"; ccp.ServerParams = new object[] { list }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); this.DoQuery(); } catch (Exception ex) { } } private void ultraGrid1_MouseDown(object sender, MouseEventArgs e) { try { if (this.ultraGrid1.ActiveRow == null) return; if (this.ultraGrid1.ActiveCell.Column.Key != "COIL_NO") return; if (MessageBox.Show("确定以该卷作为取样卷进行复样?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; pickCoilNo = this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", pickCoilNo);//取样卷 ht.Add("i2", ""); ht.Add("o3", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; if (this.comboBox3.Text == "酸洗") { ccp.ServerParams = new object[] { "UIB030160_02.CALL", ht }; } else { ccp.ServerParams = new object[] { "UIB030160_01.CALL", ht }; } this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点 } catch (Exception ex) { } this.DoQuery(); } private void UIB030160_Load(object sender, EventArgs e) { this.comboBox3.SelectedIndex = 0; } } }