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 UIB100301 : FrmBase { public UIB100301() { InitializeComponent(); } string msQltyCD = null; string msDataCD = null; public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.DoSave(); break; case "Delete": this.DoDelete(); break; } } public void DoQuery() { try { this.dataSet1.Tables[0].Clear(); ArrayList al = new ArrayList(); al.Add("UIB100301_01.SELECT"); al.Add(this.comboBox1.SelectedValue.ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.JHY.JHYComQuery"; 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.UserInfo.GetUserID() != "1" // && this.UserInfo.GetUserID() != "zw" // && this.UserInfo.GetUserID() != "lyb" // && this.UserInfo.GetUserID() != "jc190") { MessageBox.Show("无修改权限!禁止修改!", "提示"); return; } if (MessageBox.Show("确定保存?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; ArrayList list = null; ArrayList al = new ArrayList(); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text == "True") { list = new ArrayList(); list.Add("UIB100301_01.UPDATE"); list.Add(ugr.Cells["QLTY_CD"].Text.Trim()); // list.Add(ugr.Cells["QLTY_CD"].Value.ToString()); list.Add(ugr.Cells["PHY_ITEM_KEY"].Text.Trim()); al.Add(list); if (al.Count == 0) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.JHY.JHYComSave"; ccp.MethodName = "doSimpleSave"; ccp.ServerParams = new object[] { al }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } this.DoQuery(); } catch (Exception ex) { MessageBox.Show("操作异常" , "提示"); } ; } public void DoDelete() { //if (this.UserInfo.GetUserID() != "1" // && this.UserInfo.GetUserID() != "zw" // && this.UserInfo.GetUserID() != "lyb" // && this.UserInfo.GetUserID() != "jc190") { MessageBox.Show("无修改权限!禁止修改!", "提示"); return; } try { if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; ArrayList al = new ArrayList(); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text == "True") { ArrayList list = new ArrayList(); list.Add("UIB100101_01.DELETE"); list.Add(ugr.Cells["QLTY_CD_2"].Value.ToString()); list.Add(ugr.Cells["QLTY_OPE_CD"].Text.Trim()); al.Add(list); } } if (al.Count == 0) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.JHY.JHYComSave"; ccp.MethodName = "doSimpleSave"; ccp.ServerParams = new object[] { al }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); this.DoQuery(); } catch (Exception ex) { MessageBox.Show("操作异常" , "提示"); } } public void PageInit() { try { ArrayList alt = new ArrayList(); ArrayList alt2 = new ArrayList(); alt.Add("UIB100301_01.INITSELECT"); this.dataSet1.Tables[1].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.JHY.JHYComQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { alt }; ccp.SourceDataTable = this.dataSet1.Tables[1]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); alt2.Add("UIB100301_02.INITSELECT"); CoreClientParam ccp1 = new CoreClientParam(); this.dataSet1.Tables[2].Clear(); // CoreClientParam ccp = new CoreClientParam(); ccp1.ServerName = "UIB.JHY.JHYComQuery"; ccp1.MethodName = "doSimpleQuery"; ccp1.ServerParams = new object[] { alt2 }; ccp1.SourceDataTable = this.dataSet1.Tables[2]; this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } public void Init() { try { ArrayList alt2 = new ArrayList(); alt2.Add("UIB100301_02.INITSELECT"); CoreClientParam ccp1 = new CoreClientParam(); this.dataSet1.Tables[2].Clear(); // CoreClientParam ccp = new CoreClientParam(); ccp1.ServerName = "UIB.JHY.JHYComQuery"; ccp1.MethodName = "doSimpleQuery"; ccp1.ServerParams = new object[] { alt2 }; ccp1.SourceDataTable = this.dataSet1.Tables[2]; this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void ultraGrid1_MouseDown(object sender, MouseEventArgs e) { } private void UIB100301_Load(object sender, EventArgs e) { PageInit(); Init(); this.ultraCombo1.Text = "ALL"; } } }