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; namespace Core.LZMes.Client.UIK { public partial class UIK040050 : FrmBase { public UIK040050() { InitializeComponent(); } #region "ToolBar Event" public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.Save(); this.DoQuery(); break; case "Export": this.DoExport(); break; } } private void DoQuery() { try { string area = Convert.ToString(Common.FixDBManager.CheckNullStr(this.textArea.Text)); string mcno = Convert.ToString(Common.FixDBManager.CheckNullStr(this.textMcNO.Text)); string DelToDateFrom = Convert.ToString(Common.FixDBManager.CheckNullStr(this.DelToDateFrom.DateTime.ToString("yyyyMMdd"))); string DelToDateTo = Convert.ToString(Common.FixDBManager.CheckNullStr(this.DelToDateTo.DateTime.ToString("yyyyMMdd"))); string reType = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ComboMatType.Value)); string DelToDateFromJh ; string DelToDateToJh ; string DelToDateFromZy ; string DelToDateToZy ; if (reType.Equals("JH")){ DelToDateFromJh = DelToDateFrom; DelToDateToJh = DelToDateTo; DelToDateFromZy = "10000101"; DelToDateToZy = "99991231"; }else if(reType.Equals("ZY")){ DelToDateFromJh = "10000101"; DelToDateToJh = "99991231"; DelToDateFromZy = DelToDateFrom; DelToDateToZy = DelToDateTo; }else{ System.Windows.Forms.MessageBox.Show("操作类型不能为空!"); return; } this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ArrayList paramArray = new ArrayList(); paramArray.Add("UIK040050_01.Select"); paramArray.Add(area); paramArray.Add(mcno); paramArray.Add(DelToDateFromJh); paramArray.Add(DelToDateToJh); paramArray.Add(DelToDateFromJh); paramArray.Add(DelToDateToJh); paramArray.Add(DelToDateFromZy); paramArray.Add(DelToDateToZy); paramArray.Add(DelToDateFromZy); paramArray.Add(DelToDateToZy); ccp.ServerParams = new object[] { paramArray }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); System.Diagnostics.Debug.WriteLine(this.dataSet1.Tables[0].ToString()); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } public void Save() { this.ultraGrid1.UpdateData(); DataRow[] selectedRows = dataSet1.Tables[0].Select("CHK ='True'"); string reType = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ComboRegType.Value)); string regDate = Convert.ToString(Common.FixDBManager.CheckNullStr(this.regDtime.DateTime.ToString("yyyyMMdd"))); string GH; string JX; if (reType.Equals("GH")) { JX = "N"; GH = "Y"; } else if (reType.Equals("JX")) { JX = "Y"; GH = "N"; } else { System.Windows.Forms.MessageBox.Show("操作类型不能为空!"); return; } for (int i = 0; i < selectedRows.Length; i++) { try { string regid = this.UserInfo.GetUserID(); string regshift = this.UserInfo.GetUserOrder(); string reggroup = this.UserInfo.GetUserGroup(); string MC_ID = Convert.ToString(Common.FixDBManager.CheckNullStr(selectedRows[i]["MC_ID"])); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBSave"; ccp.MethodName = "doXmlSave"; ArrayList paramArray = new ArrayList(); paramArray.Add("UIK040050_01.Update"); paramArray.Add(JX); paramArray.Add(regid); paramArray.Add(JX); paramArray.Add(regDate); paramArray.Add(JX); paramArray.Add(regDate); paramArray.Add(GH); paramArray.Add(regid); paramArray.Add(GH); paramArray.Add(regDate); paramArray.Add(GH); paramArray.Add(regDate); paramArray.Add(MC_ID); ccp.ServerParams = new object[] { paramArray }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } } private void DoExport() { try { if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fileName = this.saveFileDialog1.FileName; ultraGridExcelExporter1.Export(ultraGrid1, fileName); //System.Diagnostics.Process.Start(fileName); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } #endregion #region "Init" public void init() { string commCodeCd = "K04001,K04005"; DataTable dt = new DataTable(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ArrayList paramArray = new ArrayList(); paramArray.Add("UIECOMM00_SELECT.COMM_CODE"); paramArray.Add(commCodeCd); ccp.ServerParams = new object[] { paramArray }; ccp.SourceDataTable = dt; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboMatType, ref dt, "K04001"); Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboRegType, ref dt, "K04005"); ComboMatType.Value = "JH"; ComboRegType.Value = "JX"; } private void UIK040020_Load(object sender, EventArgs e) { init(); } #endregion } }