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.UIK { public partial class UIK040040 : FrmBase { public UIK040040() { InitializeComponent(); } string mcID = null; string mcIDName = null; public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save"://保存(上) this.DoSave(); break; case "Save1"://保存(下) this.DoSave_1(); break; case "Delete"://上 this.DoDelete("S"); break; case "Delete1"://删除下 this.DoDelete("X"); break; } } public void DoQuery() { try { if (this.ultraTabControl1.SelectedTab.Index == 0) { this.dataSet1.Tables[0].Clear(); ArrayList al = new ArrayList(); al.Add("UIK040040_01.SELECT"); al.Add(this.textBox1.Text.ToString().Trim()); al.Add(this.textBox2.Text.ToString().Trim()); // al.Add(this.comboBox1.SelectedValue.ToString()); 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); } else if (this.ultraTabControl1.SelectedTab.Index == 1) { this.dataSet1.Tables[3].Clear(); ArrayList al = new ArrayList(); al.Add("UIK040040_04.SELECT"); al.Add(this.textBox1.Text.ToString().Trim()); al.Add(this.textBox2.Text.ToString().Trim()); // al.Add(this.comboBox1.SelectedValue.ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet1.Tables[3]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } else if (this.ultraTabControl1.SelectedTab.Index == 2) { this.dataSet1.Tables[2].Clear(); ArrayList al = new ArrayList(); al.Add("UIK040040_03.SELECT"); al.Add(this.textBox1.Text.ToString().Trim()); al.Add(this.textBox2.Text.ToString().Trim()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet1.Tables[2]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } } catch (Exception ex) { } } public void DoSave() { try { ArrayList list = null; if (this.ultraTabControl1.SelectedTab.Index == 0) { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Value)) { if (ugr.Cells["MC_ID_FLAG"].Text == "")//insert { list = new ArrayList(); list.Add("UIK040040_01.INSERT"); list.Add(ugr.Cells["MC_ID"].Text); list.Add(ugr.Cells["MC_NAME"].Text); list.Add(ugr.Cells["MC_MODEL"].Text); list.Add(ugr.Cells["MC_SPEC"].Text); list.Add(ugr.Cells["MC_STARTTIME"].Text); list.Add(ugr.Cells["MC_CHANGTIME"].Text); list.Add(ugr.Cells["MC_CHECKTIME"].Text); list.Add(ugr.Cells["AREA"].Text); list.Add(ugr.Cells["MC_UNIT"].Text); list.Add(ugr.Cells["MC_STAT"].Text); list.Add(this.UserInfo.GetUserName()); list.Add(ugr.Cells["MC_CHECKCYCLE"].Text); list.Add(ugr.Cells["MC_CHANGCYCLE"].Text); list.Add(ugr.Cells["NX_MC_CHECKTIME"].Text); list.Add(ugr.Cells["NX_MC_CHANGTIME"].Text); list.Add(ugr.Cells["SU_MC_ID"].Text); list.Add(ugr.Cells["MAIN_MC_NAME"].Text); // list.Add(ugr.Cells["DDDD"].Text); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBSave"; ccp.ServerParams = new object[] { list }; ccp.MethodName = "doXmlSave"; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } else if (ugr.Cells["MC_ID_FLAG"].Text != "")//update { list = new ArrayList(); list.Add("UIK040040_01.UPDATE"); // list.Add(ugr.Cells["MC_ID"].Text); list.Add(ugr.Cells["MC_NAME"].Text); list.Add(ugr.Cells["MC_MODEL"].Text); list.Add(ugr.Cells["MC_SPEC"].Text); list.Add(ugr.Cells["MC_STARTTIME"].Text); list.Add(ugr.Cells["MC_CHANGTIME"].Text); list.Add(ugr.Cells["MC_CHECKTIME"].Text); list.Add(ugr.Cells["AREA"].Text); //list.Add(ugr.Cells["MC_NOM_CAP"].Text); list.Add(ugr.Cells["MC_UNIT"].Text); list.Add(ugr.Cells["MC_STAT"].Text); list.Add(this.UserInfo.GetUserName()); list.Add(ugr.Cells["MC_CHECKCYCLE"].Text); list.Add(ugr.Cells["MC_CHANGCYCLE"].Text); list.Add(ugr.Cells["NX_MC_CHECKTIME"].Text); list.Add(ugr.Cells["NX_MC_CHANGTIME"].Text); list.Add(ugr.Cells["SU_MC_ID"].Text); list.Add(ugr.Cells["MAIN_MC_NAME"].Text); list.Add(ugr.Cells["MC_ID_FLAG"].Text); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBSave"; ccp.ServerParams = new object[] { list }; ccp.MethodName = "doXmlSave"; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } } else if (this.ultraTabControl1.SelectedTab.Index == 1) { Hashtable ht = null; foreach (UltraGridRow ugr in this.ultraGrid4.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["MC_ID_FLAG"].Text == "")//insert { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["MC_NAME"].Text); ht.Add("i3", ""); ht.Add("i4", ""); ht.Add("i5", ""); ht.Add("i6", ""); ht.Add("i7", ""); ht.Add("i8", ""); ht.Add("i9", ""); ht.Add("i10", ""); ht.Add("i11", ""); ht.Add("i12", ""); ht.Add("i13", ""); ht.Add("i14", ""); ht.Add("i15", ""); ht.Add("i16", ""); ht.Add("i17", ""); ht.Add("i18", ""); ht.Add("i19", ""); ht.Add("i20", ugr.Cells["AREA"].Text); ht.Add("i21", ugr.Cells["MC_ID_FLAG"].Text); ht.Add("i22", ""); ht.Add("i23", "AI"); ht.Add("i24", ugr.Cells["ZJ_RH_DS1"].Text); ht.Add("i25", ugr.Cells["ZJ_RH_DS2"].Text); ht.Add("i26", ugr.Cells["ZJ_RH_DS3"].Text); ht.Add("i27", ugr.Cells["ND_HYL1"].Text); ht.Add("i28", ugr.Cells["ND_HYL2"].Text); ht.Add("i29", ugr.Cells["ND_HYL3"].Text); ht.Add("o30", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } else//update { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["MC_NAME"].Text); ht.Add("i3", ""); ht.Add("i4", ""); ht.Add("i5", ""); ht.Add("i6", ""); ht.Add("i7", ""); ht.Add("i8", ""); ht.Add("i9", ""); ht.Add("i10", ""); ht.Add("i11", ""); ht.Add("i12", ""); ht.Add("i13", ""); ht.Add("i14", ""); ht.Add("i15", ""); ht.Add("i16", ""); ht.Add("i17", ""); ht.Add("i18", ""); ht.Add("i19", ""); ht.Add("i20", ugr.Cells["AREA"].Text); ht.Add("i21", ugr.Cells["MC_ID_FLAG"].Text); ht.Add("i22", ""); ht.Add("i23", "AU"); ht.Add("i24", ugr.Cells["ZJ_RH_DS1"].Text); ht.Add("i25", ugr.Cells["ZJ_RH_DS2"].Text); ht.Add("i26", ugr.Cells["ZJ_RH_DS3"].Text); ht.Add("i27", ugr.Cells["ND_HYL1"].Text); ht.Add("i28", ugr.Cells["ND_HYL2"].Text); ht.Add("i29", ugr.Cells["ND_HYL3"].Text); ht.Add("o30", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } } else if (this.ultraTabControl1.SelectedTab.Index == 2) { Hashtable ht = null; foreach (UltraGridRow ugr in this.ultraGrid3.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["MC_ID_FLAG"].Text == "")//insert { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["MC_NAME"].Text); ht.Add("i3", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i4", ugr.Cells["SUB_MC_NAME"].Text); ht.Add("i5", ugr.Cells["WH_BW"].Text); ht.Add("i6", ugr.Cells["WH_NR"].Text); ht.Add("i7", ugr.Cells["BZ"].Text); ht.Add("i8", ugr.Cells["WH_SJ"].Text); ht.Add("i9", ugr.Cells["XC_WH_SJ"].Text); ht.Add("i10", ugr.Cells["WH_REN"].Text); ht.Add("i11", ugr.Cells["WH_ZQ"].Text); ht.Add("i12", ugr.Cells["MC_ID"].Text); ht.Add("i13", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i14", "A"); ht.Add("i15", ugr.Cells["AREA"].Text); ht.Add("o16", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_02.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } else//update { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["MC_NAME"].Text); ht.Add("i3", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i4", ugr.Cells["SUB_MC_NAME"].Text); ht.Add("i5", ugr.Cells["WH_BW"].Text); ht.Add("i6", ugr.Cells["WH_NR"].Text); ht.Add("i7", ugr.Cells["BZ"].Text); ht.Add("i8", ugr.Cells["WH_SJ"].Text); ht.Add("i9", ugr.Cells["XC_WH_SJ"].Text); ht.Add("i10", ugr.Cells["WH_REN"].Text); ht.Add("i11", ugr.Cells["WH_ZQ"].Text); ht.Add("i12", ugr.Cells["MC_ID"].Text); ht.Add("i13", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i14", "B"); ht.Add("i15", ugr.Cells["AREA"].Text); ht.Add("o16", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_02.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } } this.DoQuery(); }catch(Exception ex) { MessageBox.Show(ex.ToString()); } } public void DoDelete(string str) { try { if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; Hashtable ht = null; if (this.ultraTabControl1.SelectedTab.Index == 0) { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ""); ht.Add("i3", "AX"); ht.Add("o4", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_03.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } else if (this.ultraTabControl1.SelectedTab.Index == 1) { if (str == "S") { foreach (UltraGridRow ugr in this.ultraGrid4.Rows)//删除(上) { if (ugr.Cells["CHK"].Text.ToString() == "True") { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ""); ht.Add("i3", "AS"); ht.Add("o4", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_03.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } else if(str == "X") { foreach (UltraGridRow ugr in this.ultraGrid2.Rows)//删除(下) { if (ugr.Cells["CHK"].Text.ToString() == "True") { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i3", "AX"); ht.Add("o4", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_03.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } } else if (this.ultraTabControl1.SelectedTab.Index == 2) { foreach (UltraGridRow ugr in this.ultraGrid3.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i3", "B"); ht.Add("o4", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_03.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } this.DoQuery(); } catch (Exception ex) { } } private void ultraGrid1_DoubleClick(object sender, EventArgs e) { //try //{ //} //catch (Exception ex) //{ //} } private void label1_Click(object sender, EventArgs e) { } public void DoSave_1() { try { Hashtable ht = null; foreach (UltraGridRow ugr in this.ultraGrid2.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["MC_ID_FLAG"].Text == "")//insert { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", this.mcID); ht.Add("i2", this.mcIDName); ht.Add("i3", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i4", ugr.Cells["SUB_MC_NAME"].Text); ht.Add("i5", ugr.Cells["RH_BW"].Text); ht.Add("i6", ugr.Cells["RH_DS"].Text); ht.Add("i7", ugr.Cells["RH_HF"].Text); ht.Add("i8", ugr.Cells["RH_YP_TYPE"].Text); ht.Add("i9", ugr.Cells["RH_YP_VALUE"].Text); ht.Add("i10", ugr.Cells["BY_ZQ"].Text); ht.Add("i11", ugr.Cells["BYL"].Text); ht.Add("i12", ugr.Cells["HDY_ZQ"].Text); ht.Add("i13", ugr.Cells["HDYL"].Text); ht.Add("i14", ugr.Cells["HDY_FZR"].Text); ht.Add("i15", ugr.Cells["HDY_SJ"].Text); ht.Add("i16", ugr.Cells["HDY_XC_SJ"].Text); ht.Add("i17", ugr.Cells["BJY_FZR"].Text); ht.Add("i18", ugr.Cells["BJY_SJ"].Text); ht.Add("i19", ugr.Cells["BJY_XC_SJ"].Text); ht.Add("i20", ugr.Cells["AREA"].Text); ht.Add("i21", this.mcID); ht.Add("i22", ugr.Cells["SUB_MC_ID_FLAG"].Text); ht.Add("i23", "B"); ht.Add("i24", ""); ht.Add("i25", ""); ht.Add("i26", ""); ht.Add("i27", ""); ht.Add("i28", ""); ht.Add("i29", ""); ht.Add("o30", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } else { CoreClientParam ccp = new CoreClientParam(); ht = new Hashtable(); ht.Add("i1", ugr.Cells["MC_ID"].Text); ht.Add("i2", ugr.Cells["MC_NAME"].Text); ht.Add("i3", ugr.Cells["SUB_MC_ID"].Text); ht.Add("i4", ugr.Cells["SUB_MC_NAME"].Text); ht.Add("i5", ugr.Cells["RH_BW"].Text); ht.Add("i6", ugr.Cells["RH_DS"].Text); ht.Add("i7", ugr.Cells["RH_HF"].Text); ht.Add("i8", ugr.Cells["RH_YP_TYPE"].Text); ht.Add("i9", ugr.Cells["RH_YP_VALUE"].Text); ht.Add("i10", ugr.Cells["BY_ZQ"].Text); ht.Add("i11", ugr.Cells["BYL"].Text); ht.Add("i12", ugr.Cells["HDY_ZQ"].Text); ht.Add("i13", ugr.Cells["HDYL"].Text); ht.Add("i14", ugr.Cells["HDY_FZR"].Text); ht.Add("i15", ugr.Cells["HDY_SJ"].Text); ht.Add("i16", ugr.Cells["HDY_XC_SJ"].Text); ht.Add("i17", ugr.Cells["BJY_FZR"].Text); ht.Add("i18", ugr.Cells["BJY_SJ"].Text); ht.Add("i19", ugr.Cells["BJY_XC_SJ"].Text); ht.Add("i20", ugr.Cells["AREA"].Text); ht.Add("i21", this.mcID); ht.Add("i22", ugr.Cells["SUB_MC_ID_FLAG"].Text); ht.Add("i23", "C"); ht.Add("i24", ""); ht.Add("i25", ""); ht.Add("i26", ""); ht.Add("i27", ""); ht.Add("i28", ""); ht.Add("i29", ""); ht.Add("o30", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIK040040_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } } } } catch (Exception ex) { } } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { } private void ultraGrid4_AfterRowActivate(object sender, EventArgs e) { try { this.dataSet1.Tables[1].Clear(); ArrayList al = new ArrayList(); al.Add("UIK040040_02.SELECT"); al.Add(this.ultraGrid4.ActiveRow.Cells["MC_ID"].Text.ToString()); // al.Add(this.comboBox1.SelectedValue.ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet1.Tables[1]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.mcID = this.ultraGrid4.ActiveRow.Cells["MC_ID"].Text.ToString(); this.mcIDName = this.ultraGrid4.ActiveRow.Cells["MC_NAME"].Text.ToString(); } catch (Exception ex) { } } } }