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.Diagnostics; namespace Core.LZMes.Client.UIK { public partial class UIK010030 : FrmBase { public UIK010030() { InitializeComponent(); } private void UIK010030_Load(object sender, EventArgs e) { this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query"://查询 this.DoQuery(); break; case "Export": this.DoExport(); break; } } private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e) { if (this.ultraCheckEditor1.Checked) { this.ultraCalendarENDTIME.Enabled = true; this.ultraCalendarSTRATTIME.Enabled = true; this.ultraCheckAll.Checked = false; } if (!this.ultraCheckEditor1.Checked) { this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; } } private void ultraCheckAll_CheckedChanged(object sender, EventArgs e) { try { if (this.ultraCheckAll.Checked) { this.ultraCheckEditor1.Checked = false; this.ultraCalendarSTRATTIME.Enabled = false; this.ultraCalendarENDTIME.Enabled = false; } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } public void DoExport() { try { if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName); System.Diagnostics.Process.Start(fName); // Process.Start(fName); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void DoQuery() { if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false) { this.ultraCalendarENDTIME.Text = ""; this.ultraCalendarSTRATTIME.Text = ""; } try { string starttiem = this.ultraCalendarSTRATTIME.Text.ToString(); string endtime = this.ultraCalendarENDTIME.Text.ToString(); bool flag = false; // DataTable dt = new DataTable(); if (this.ultraCheckEditor1.Checked == false && this.ultraCheckAll.Checked == false) { MessageBox.Show("请选择查询条件!"); } else { if (this.ultraCheckAll.Checked) { this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); this.ultraCheckAll.Checked = false; ccp.ServerName = "UIK.UIK01.UIK010030"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { starttiem, endtime, flag }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); DataRowCollection drc1 = dataSet1.Tables[0].Rows; if (drc1.Count <= 0) { MessageBox.Show("暂无乳化液记录!"); } this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } if (this.ultraCheckEditor1.Checked) { this.dataSet1.Tables[0].Clear(); flag = true; CoreClientParam ccp2 = new CoreClientParam(); ccp2.ServerName = "UIK.UIK01.UIK010030"; ccp2.MethodName = "DoQuery"; ccp2.ServerParams = new object[] { starttiem, endtime, flag }; ccp2.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); DataRowCollection drc2 = dataSet1.Tables[0].Rows; if (drc2.Count <= 0) { MessageBox.Show("暂无乳化液记录!"); } this.ultraCheckAll.Checked = false; this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } } }