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; namespace Core.LZMes.Client.UIM.UIM03 { public partial class UIM030070 : FrmBase { public UIM030070() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Export": this.DoExport(); break; case "Exit": this.Close(); break; } } private void DoQuery() { try { this.dataSet1.Tables[0].Clear(); string beginDate = this.ultraDateTimeEditor1.Value == null ? "00000000" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"); string endDate = this.ultraDateTimeEditor2.Value == null ? "00000000" : this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"); string coilNo = textBox9.Text.Trim(); CoreClientParam ccp = new CoreClientParam(); System.Collections.ArrayList arrayParam = new System.Collections.ArrayList(); arrayParam.Add("UIM030070_01.SELECT"); arrayParam.Add(beginDate); arrayParam.Add(endDate); arrayParam.Add(coilNo); ccp.ServerName = "UIB.COM.ComDBQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { arrayParam }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(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()); } } } }