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.UIM04 { public partial class UIM040020 : FrmBase { public UIM040020() { InitializeComponent(); } private void checkBox1_CheckedChanged(object sender, EventArgs e) { button1.Enabled = !checkBox1.Checked; } private void UIM040020_Load(object sender, EventArgs e) { checkBox1.Checked = true; timer1.Start(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": if (!checkBox1.Checked) { DoQuery(); } break; case "Exit": this.Close(); break; } } public void DoQuery() { try { foreach (DataTable dt in dataSet1.Tables) { dt.Clear(); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "UIM.UIM04.UIM040020"; ccp.MethodName = "queryCoilList"; ccp.ServerParams = new object[] { tabControl1.SelectedIndex + 1 }; ccp.SourceDataTable = this.dataSet1.Tables[tabControl1.SelectedIndex]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { } } private void timer1_Tick(object sender, EventArgs e) { if (checkBox1.Checked) { DoQuery(); } } private void button1_Click(object sender, EventArgs e) { if (!checkBox1.Checked) { DoQuery(); } } private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (checkBox1.Checked) { DoQuery(); } } } }