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 UIM030600 : FrmBase { public UIM030600() { 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 queryDate = this.ultraDateTimeEditor1.Value == null ? "" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"); string fr_wth = this.ultraTextEditor1.Text.Trim(); string to_wth = this.ultraTextEditor2.Text.Trim(); this.ultraGrid1.DisplayLayout.Bands[0].Columns["UnboundColumn2"].Header.Caption ="厚度"+"["+fr_wth+","+to_wth+"]"; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIM.UIM02.UIM020010"; switch (CustomInfo) { case "1": ccp.MethodName = "queryPltcmSizeDetailA"; break; case "2": ccp.MethodName = "queryCalSizeDetailB"; break; case "3": ccp.MethodName = "queryRclSizeDetailC"; break; } ccp.ServerParams = new object[] { fr_wth, to_wth,queryDate }; 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()); } } private void ultraButton1_Click(object sender, EventArgs e) { try { this.dataSet2.Tables[0].Clear(); string fr_Date = this.ultraDateTimeEditor2.Value == null ? "" : this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"); string to_Date = this.ultraDateTimeEditor3.Value == null ? "" : this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd"); string stl = this.ultraTextEditor3.Text.Trim(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIM.UIM02.UIM020010"; switch (CustomInfo) { case "1": ccp.MethodName = "queryPltcmSizeDetailE"; break; case "2": ccp.MethodName = "queryCalSizeDetailF"; break; case "3": ccp.MethodName = "queryRclSizeDetailG"; break; } ccp.ServerParams = new object[] { fr_Date, to_Date, stl }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception o) { MessageBox.Show(o.ToString()); } } private void button1_Click(object sender, EventArgs e) { try { if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fileName = this.saveFileDialog1.FileName; ultraGridExcelExporter1.Export(ultraGrid2, fileName); System.Diagnostics.Process.Start(fileName); } } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } } }