| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- 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 UIM030300 : FrmBase
- {
- public UIM030300()
- {
- 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 queryDate1 = this.ultraDateTimeEditor2.Value == null ? "" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- if (queryDate1.Substring(0, 6) != queryDate.Substring(0, 6))
- {
- MessageBox.Show("请确保两个查询日期在同一月份", "错误");
- return;
- }
- string queryDate2 = "";//月累统计截止日期
- if (queryDate.Substring(0, 6) == DateTime.Today.ToString("yyyyMM"))//查询日期为当月
- queryDate2 = DateTime.Today.ToString("yyyyMMdd");
- else
- {
- DateTime date = ultraDateTimeEditor2.DateTime;
- queryDate2 = date.AddDays(1 - date.Day).AddMonths(1).AddDays(-1).ToString("yyyyMMdd");
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM02.UIM020010";
- ccp.MethodName = "queryCalCoilOfDay";
- ccp.ServerParams = new object[] { queryDate, queryDate1, queryDate2};
- 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 ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
- {
- }
- }
- }
|