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 System.Text.RegularExpressions;//正则表达式所在空间 using Infragistics.Win.UltraWinGrid; using Microsoft.Office.Interop.Excel; using System.Diagnostics; namespace Core.LZMes.Client.UIB { public partial class UIB100207 : FrmBase { public UIB100207() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { try { switch (ToolbarKey.ToString()) { case "Query": this.DoQuery(); break; case "Export": this.DoExport(); break; } } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } public void DoQuery() { try { ArrayList al = new ArrayList(); al.Add("UIB100207_01.SELECT"); string strLine = ""; if (this.comboBox1.SelectedIndex == 0) { strLine = "R"; } else { strLine = "L"; } al.Add(strLine); al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000"); al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999"); al.Add(this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd") + "000000"); al.Add(this.ultraDateTimeEditor4.DateTime.ToString("yyyyMMdd") + "999999"); al.Add(this.textBox1.Text.ToString()); al.Add(this.textBox2.Text.ToString()); this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIB.JHY.JHYComQuery"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { } } //导出 public void DoExport() { try { if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName); Process.Start(fName); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void UIB100207_Load(object sender, EventArgs e) { try { this.comboBox1.SelectedIndex = 0; } catch (Exception ex) { } } } }