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 UIB030210 : FrmBase { public UIB030210() { 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.comboBox1.Text == "酸轧") { al.Add("UIB030210_01.SELECT"); } else if (this.comboBox1.Text == "连退") { al.Add("UIB030210_02.SELECT"); } else if (this.comboBox1.Text == "酸洗") { al.Add("UIB030210_03.SELECT"); } if (al.Count == 0) return; 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() { if ((this.comboBox1.Text == "酸轧")||(this.comboBox1.Text == "酸洗")) { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Text))//注意,这里ugr.Cells["CHK"].Text,而不能够使ugr.Cells["CHK"].Value,因为grid还没有接受改变(AcceptChanges) { CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", ugr.Cells["COIL_NO"].Text); ht.Add("i2", this.UserInfo.GetUserName()); ht.Add("o3", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030210_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } else if (this.comboBox1.Text == "连退") { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Text))//注意,这里ugr.Cells["CHK"].Text,而不能够使ugr.Cells["CHK"].Value,因为grid还没有接受改变(AcceptChanges) { CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", ugr.Cells["COIL_NO"].Text); ht.Add("i2", this.UserInfo.GetUserName()); ht.Add("o3", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030210_02.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } this.DoQuery(); } private void UIB030210_Load(object sender, EventArgs e) { this.comboBox1.SelectedIndex = 1; this.DoQuery(); } private void checkBox1_CheckedChanged(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { ugr.Cells["CHK"].Value = this.checkBox1.Checked; ugr.Update(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void comboBox1_SelectedValueChanged(object sender, EventArgs e) { this.DoQuery(); } } }