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; namespace Core.LZMes.Client.UIK { public partial class UIK030030 : FrmBase { public UIK030030() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; } } private void DoQuery() { if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false) { this.ultraCalendarENDTIME.Text = ""; this.ultraCalendarSTRATTIME.Text = ""; } try { string mc_id = this.ultraTextMC_ID.Text.ToString(); string starttiem = this.ultraCalendarSTRATTIME.Text.ToString(); string endtime = this.ultraCalendarENDTIME.Text.ToString(); bool flag = false; CoreClientParam ccp = new CoreClientParam(); DataTable dt = new DataTable(); if (mc_id == "" && starttiem == "" && endtime == "" && this.ultraCheckAll.Checked == false) { MessageBox.Show("请选择查询条件!"); } else { if (this.ultraCheckAll.Checked) { this.ultraCheckAll.Checked = false; ccp.ServerName = "UIK.UIK03.UIK030030"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag }; ccp.SourceDataTable = dt; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraGrid1.DataSource = dt; if (dt.Rows.Count <= 0) { MessageBox.Show("暂无记录!"); } this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } else { flag = true; if (this.ultraTextMC_ID.Text != "" || this.ultraCheckEditor1.Checked == true) { if (this.ultraTextMC_ID.Text == "") { this.ultraTextMC_ID.Clear(); this.ultraCheckEditor1.Checked = false; this.ultraCheckAll.Checked = false; ccp.ServerName = "UIK.UIK03.UIK030030"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag }; ccp.SourceDataTable = dt; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraGrid1.DataSource = dt; if (dt.Rows.Count <= 0) { MessageBox.Show("该时间内没有在线设备信息!"); } this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } if (this.ultraCheckEditor1.Checked == false) { this.ultraTextMC_ID.Clear(); this.ultraCheckAll.Checked = false; ccp.ServerName = "UIK.UIK03.UIK030030"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag }; ccp.SourceDataTable = dt; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraGrid1.DataSource = dt; if (dt.Rows.Count <= 0) { MessageBox.Show("该设备编号不存在!"); } this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } if (this.ultraTextMC_ID.Text != "" && this.ultraCheckEditor1.Checked == true) { this.ultraTextMC_ID.Clear(); this.ultraCheckEditor1.Checked = false; this.ultraCheckAll.Checked = false; ccp.ServerName = "UIK.UIK03.UIK030030"; ccp.MethodName = "DoQuery"; ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag }; ccp.SourceDataTable = dt; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); this.ultraGrid1.DataSource = dt; if (dt.Rows.Count <= 0) { MessageBox.Show("记录不存在,请查证后查询!"); } this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; return; } } } } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } private void ultraCheckAll_CheckedChanged(object sender, EventArgs e) { try { if (this.ultraCheckAll.Checked) { this.ultraTextMC_ID.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; this.ultraCalendarENDTIME.Enabled = false; } if (!this.ultraCheckAll.Checked) { this.ultraTextMC_ID.Enabled = true; this.ultraCalendarSTRATTIME.Enabled = false; this.ultraCalendarENDTIME.Enabled = false; } } catch (Exception Ex) { MessageBox.Show(Ex.ToString()); } } private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e) { if (this.ultraCheckEditor1.Checked) { this.ultraCalendarENDTIME.Enabled = true; this.ultraCalendarSTRATTIME.Enabled = true; } if (!this.ultraCheckEditor1.Checked) { this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; this.ultraCalendarSTRATTIME.Text = ""; this.ultraCalendarENDTIME.Text = ""; } } private void UIK030030_Load(object sender, EventArgs e) { this.ultraCalendarENDTIME.Enabled = false; this.ultraCalendarSTRATTIME.Enabled = false; } } }