| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- 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());
- }
- }
-
- }
- }
|