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 UIB030340 : FrmBase { public UIB030340() { InitializeComponent(); } private void UIB030340_Load(object sender, EventArgs e) { this.ultraComboEditor1.Text = ""; try { ArrayList alt = new ArrayList(); alt.Add("UIB030340_01.INITSELECT"); this.dataSet3.Tables[1].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { alt }; ccp.SourceDataTable = this.dataSet3.Tables[1]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } 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 { ArrayList al = new ArrayList(); DataTable dt = null; if (this.ultraTabControl1.Tabs[0].Selected)//订单信息管理 { if (this.textBoxORD.Text.Trim() == "" && this.textBoxSTLGRD.Text == "") { MessageBox.Show("请输入查询条件!", "提示"); return; } al.Add("UIB030340_03.SELECT"); al.Add(this.textBoxORD.Text.Trim()); al.Add(this.textBoxSTLGRD.Text.Trim()); al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyy")); //al.Add(this.textBoxORD.Text.Trim()); //al.Add(this.textBoxSTLGRD.Text.Trim()); //al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyy")); this.dataSet3.Tables[0].Clear(); dt = this.dataSet3.Tables[0]; } else if (this.ultraTabControl1.Tabs[1].Selected)//图片、模板号管理 { al.Add("UIB030340_02.SELECT"); this.dataSet2.Tables[0].Clear(); dt = this.dataSet2.Tables[0]; } else if (this.ultraTabControl1.Tabs[2].Selected)//编码管理 { al.Add("UIB030340_01.SELECT"); this.dataSet1.Tables[0].Clear(); dt = this.dataSet1.Tables[0]; } else if (this.ultraTabControl1.Tabs[3].Selected)//备注管理 { al.Add("UIB030340_04.SELECT"); this.dataSet4.Tables[0].Clear(); dt = this.dataSet4.Tables[0]; } else { return; } // this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.SourceDataTable = dt; ccp.ServerParams = new object[] { al }; // ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.Write(ex.ToString()); } } public void DoSave() { try { if (MessageBox.Show("确定保存?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; ArrayList al = new ArrayList(); if (this.ultraTabControl1.Tabs[0].Selected) { foreach (UltraGridRow ugr in this.ultraGrid3.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Text)) { CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", ugr.Cells["ORD_NO"].Text); ht.Add("i2", ugr.Cells["ORD_SEQ"].Text); ht.Add("i3", this.textBoxTNO.Text); ht.Add("i4", this.textBoxRMK.Text); if (this.ultraComboEditor1.Text == "") { ht.Add("i5", ""); } else { ht.Add("i5", this.ultraComboEditor1.Value.ToString()); } ht.Add("i6", this.UserInfo.GetUserName()); ht.Add("o7", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030340_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); //if (ugr.Cells["ORD_TP"].Text == "热冷轧")//热轧及冷轧 //{ // al = new ArrayList(); // al.Add("UIB030340_03.UPDATE"); // al.Add(this.textBoxRMK.Text); // al.Add(this.textBoxTNO.Text); // al.Add(ugr.Cells["ORD_NO"].Text); // al.Add(ugr.Cells["ORD_SEQ"].Text); //} //else if (ugr.Cells["ORD_TP"].Text == "板加")//板加 //{ // al = new ArrayList(); // al.Add("UIB030340_04.UPDATE"); // al.Add(this.textBoxRMK.Text); // al.Add(this.textBoxTNO.Text); // al.Add(ugr.Cells["ORD_NO"].Text); // al.Add(ugr.Cells["ORD_SEQ"].Text); //} //CoreClientParam ccpp = new CoreClientParam(); //ccpp.ServerName = "UIB.COM.ComDBSave"; //ccpp.MethodName = "doXmlSave"; //ccpp.ServerParams = new object[] { al }; //this.ExecuteNonQuery(ccpp, CoreInvokeType.Internal); ////品质设计结果修改 //al = new ArrayList(); //al.Add("UIB030340_05.UPDATE"); //al.Add(this.textBoxTNO.Text); //al.Add(ugr.Cells["ORD_NO"].Text); //al.Add(ugr.Cells["ORD_SEQ"].Text); //ccpp = new CoreClientParam(); //ccpp.ServerName = "UIB.COM.ComDBSave"; //ccpp.MethodName = "doXmlSave"; //ccpp.ServerParams = new object[] { al }; //this.ExecuteNonQuery(ccpp, CoreInvokeType.Internal); } } return; } else if (this.ultraTabControl1.Tabs[1].Selected) { if (this.ultraGrid2.ActiveRow.Cells["EXIT_YN"].Text == "N") { al = new ArrayList(); al.Add("UIB030340_01.INSERT"); al.Add(this.ultraGrid2.ActiveRow.Cells["PRDNM_CD"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["SPEC_ABBSYM"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["SPEC_STL_GRD"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["ORD_USE_TP_HIDEN"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["THK_MIN"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["THK_MAX"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["WTH_MIN"].Text); al.Add(this.ultraGrid2.ActiveRow.Cells["WTH_MAX"].Text); al.Add(this.textBoxPic1.Text); al.Add(this.textBoxPic2.Text); al.Add(this.textBoxPic3.Text); al.Add(this.textBoxtemplno.Text); al.Add(this.textBoxLICENSE.Text); } else { if ((this.textBoxPic3.Text.Length > 0) && (!this.textBoxPic3.Text.Equals("qr.png"))) { MessageBox.Show("二维码图片名称输入有误", "提示"); return; } CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", this.textBoxPic1.Text); ht.Add("i2", this.textBoxPic2.Text); ht.Add("i3", this.textBoxPic3.Text); ht.Add("i4", this.textBoxtemplno.Text); ht.Add("i5", this.textBoxLICENSE.Text); ht.Add("i6", this.ultraGrid2.ActiveRow.Cells["PRDNM_CD"].Text); ht.Add("i7", this.ultraGrid2.ActiveRow.Cells["SPEC_ABBSYM"].Text); ht.Add("i8", this.ultraGrid2.ActiveRow.Cells["SPEC_STL_GRD"].Text); ht.Add("i9", this.ultraGrid2.ActiveRow.Cells["ORD_USE_TP_HIDEN"].Text); ht.Add("o10", ""); ccp.ServerName = "UIB.COM.ComDBProcedure"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030340_02.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); return; } } else if (this.ultraTabControl1.Tabs[2].Selected)//编码管理 { al = new ArrayList(); al.Add("UIB030340_01.UPDATE"); al.Add(this.textSEQ.Text); al.Add(this.textDIR.Text); al.Add(this.textSIZE.Text); al.Add(this.textTEMP.Text); al.Add(this.textBigC.Text); al.Add(this.textBigE.Text); al.Add(this.textSmallC.Text); al.Add(this.textSmallE.Text); al.Add(this.textEXT.Text); al.Add(this.UserInfo.GetUserID());//操作人 al.Add(this.textCD.Text); } else if (this.ultraTabControl1.Tabs[3].Selected) { ArrayList list = null; foreach (UltraGridRow ugr in this.ultraGrid4.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Text)) { list = new ArrayList(); if (ugr.Cells["MS_SEQ_1"].Text == "")//增加 { list.Add("UIB030340_02.INSERT"); list.Add(ugr.Cells["MS_SEQ"].Text); list.Add(ugr.Cells["MS_DESC"].Text); list.Add(ugr.Cells["DIS_SEQ"].Text); list.Add(ugr.Cells["FIXED_PRO"].Text); list.Add(this.UserInfo.GetUserName()); } else//修改 { list.Add("UIB030340_03.UPDATE"); list.Add(ugr.Cells["MS_SEQ"].Text); list.Add(ugr.Cells["MS_DESC"].Text); list.Add(ugr.Cells["DIS_SEQ"].Text); list.Add(ugr.Cells["FIXED_PRO"].Text); list.Add(this.UserInfo.GetUserName()); list.Add(ugr.Cells["MS_SEQ_1"].Text); } al.Add(list); }//if end }//for end } if (al.Count == 0) return; CoreClientParam cp = new CoreClientParam(); cp.ServerName = "UIB.COM.ComDBSave"; cp.MethodName = "doXmlSave"; cp.ServerParams = new object[] { al }; this.ExecuteNonQuery(cp, CoreInvokeType.Internal); this.DoQuery(); } catch (Exception ex) { System.Diagnostics.Debug.Write(ex.ToString()); } } public void DoDelete() { try { if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; ArrayList al = new ArrayList(); ArrayList list = null; foreach (UltraGridRow ugr in this.ultraGrid4.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Text)) { list = new ArrayList(); list.Add("UIB030340_01.DELETE"); list.Add(ugr.Cells["MS_SEQ"].Text); al.Add(list); } } if (al.Count == 0) return; CoreClientParam cp = new CoreClientParam(); cp.ServerName = "UIB.COM.ComDBSave"; cp.MethodName = "doXmlSave"; cp.ServerParams = new object[] { al }; this.ExecuteNonQuery(cp, CoreInvokeType.Internal); this.DoQuery(); } catch (Exception ex) { } } private void ultraExpandableGroupBoxPanel2_Paint(object sender, PaintEventArgs e) { } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { try { this.textBoxPic1.Text = this.ultraGrid2.ActiveRow.Cells["PIC1"].Text; this.textBoxPic2.Text = this.ultraGrid2.ActiveRow.Cells["PIC2"].Text; this.textBoxPic3.Text = this.ultraGrid2.ActiveRow.Cells["PIC3"].Text; this.textBoxtemplno.Text = this.ultraGrid2.ActiveRow.Cells["TMPL_NO"].Text; this.textBoxLICENSE.Text = this.ultraGrid2.ActiveRow.Cells["LICENSE_NO"].Text; } catch (Exception ex) { System.Diagnostics.Debug.Write(ex.ToString()); } } private void textBox3_TextChanged(object sender, EventArgs e) { } private void ultraGrid3_AfterRowActivate(object sender, EventArgs e) { this.textBoxRMK.Text = this.ultraGrid3.ActiveRow.Cells["CRET_NO_RMK"].Text; this.textBoxTNO.Text = this.ultraGrid3.ActiveRow.Cells["TMPL_NO"].Text; } private void ultraGrid1_AfterRowActivate_1(object sender, EventArgs e) { if (this.ultraGrid1.ActiveRow == null) return; this.textCD.Text = this.ultraGrid1.ActiveRow.Cells["QLTY_CD"].Text; this.textSEQ.Text = this.ultraGrid1.ActiveRow.Cells["DISPLAY_SEQ"].Text; this.textDIR.Text = this.ultraGrid1.ActiveRow.Cells["MS_QLTY_DIR"].Text; this.textSIZE.Text = this.ultraGrid1.ActiveRow.Cells["MS_QLTY_SIZ"].Text; this.textTEMP.Text = this.ultraGrid1.ActiveRow.Cells["MS_QLTY_TEM"].Text; this.textBigC.Text = this.ultraGrid1.ActiveRow.Cells["MS_BIG_CFNM"].Text; this.textBigE.Text = this.ultraGrid1.ActiveRow.Cells["MS_BIG_EFNM"].Text; this.textSmallC.Text = this.ultraGrid1.ActiveRow.Cells["MS_SMALL_CFNM"].Text; this.textSmallE.Text = this.ultraGrid1.ActiveRow.Cells["MS_SMALL_EFNM"].Text; this.textEXT.Text = this.ultraGrid1.ActiveRow.Cells["MS_EXT_CODE"].Text; } private void checkBox1_Click(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in this.ultraGrid3.Rows) { ugr.Cells["CHK"].Value = this.checkBox1.Checked; ugr.Update(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } } }