UIK030030.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. namespace Core.LZMes.Client.UIK
  12. {
  13. public partial class UIK030030 : FrmBase
  14. {
  15. public UIK030030()
  16. {
  17. InitializeComponent();
  18. }
  19. public override void ToolBar_Click(object sender, string ToolbarKey)
  20. {
  21. switch (ToolbarKey)
  22. {
  23. case "Query":
  24. this.DoQuery();
  25. break;
  26. }
  27. }
  28. private void DoQuery()
  29. {
  30. if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false)
  31. {
  32. this.ultraCalendarENDTIME.Text = "";
  33. this.ultraCalendarSTRATTIME.Text = "";
  34. }
  35. try
  36. {
  37. string mc_id = this.ultraTextMC_ID.Text.ToString();
  38. string starttiem = this.ultraCalendarSTRATTIME.Text.ToString();
  39. string endtime = this.ultraCalendarENDTIME.Text.ToString();
  40. bool flag = false;
  41. CoreClientParam ccp = new CoreClientParam();
  42. DataTable dt = new DataTable();
  43. if (mc_id == "" && starttiem == "" && endtime == "" && this.ultraCheckAll.Checked == false)
  44. {
  45. MessageBox.Show("请选择查询条件!");
  46. }
  47. else
  48. {
  49. if (this.ultraCheckAll.Checked)
  50. {
  51. this.ultraCheckAll.Checked = false;
  52. ccp.ServerName = "UIK.UIK03.UIK030030";
  53. ccp.MethodName = "DoQuery";
  54. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  55. ccp.SourceDataTable = dt;
  56. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  57. this.ultraGrid1.DataSource = dt;
  58. if (dt.Rows.Count <= 0)
  59. {
  60. MessageBox.Show("暂无记录!");
  61. }
  62. this.ultraCalendarENDTIME.Enabled = false;
  63. this.ultraCalendarSTRATTIME.Enabled = false;
  64. return;
  65. }
  66. else
  67. {
  68. flag = true;
  69. if (this.ultraTextMC_ID.Text != "" || this.ultraCheckEditor1.Checked == true)
  70. {
  71. if (this.ultraTextMC_ID.Text == "")
  72. {
  73. this.ultraTextMC_ID.Clear();
  74. this.ultraCheckEditor1.Checked = false;
  75. this.ultraCheckAll.Checked = false;
  76. ccp.ServerName = "UIK.UIK03.UIK030030";
  77. ccp.MethodName = "DoQuery";
  78. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  79. ccp.SourceDataTable = dt;
  80. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  81. this.ultraGrid1.DataSource = dt;
  82. if (dt.Rows.Count <= 0)
  83. {
  84. MessageBox.Show("该时间内没有在线设备信息!");
  85. }
  86. this.ultraCalendarENDTIME.Enabled = false;
  87. this.ultraCalendarSTRATTIME.Enabled = false;
  88. return;
  89. }
  90. if (this.ultraCheckEditor1.Checked == false)
  91. {
  92. this.ultraTextMC_ID.Clear();
  93. this.ultraCheckAll.Checked = false;
  94. ccp.ServerName = "UIK.UIK03.UIK030030";
  95. ccp.MethodName = "DoQuery";
  96. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  97. ccp.SourceDataTable = dt;
  98. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  99. this.ultraGrid1.DataSource = dt;
  100. if (dt.Rows.Count <= 0)
  101. {
  102. MessageBox.Show("该设备编号不存在!");
  103. }
  104. this.ultraCalendarENDTIME.Enabled = false;
  105. this.ultraCalendarSTRATTIME.Enabled = false;
  106. return;
  107. }
  108. if (this.ultraTextMC_ID.Text != "" && this.ultraCheckEditor1.Checked == true)
  109. {
  110. this.ultraTextMC_ID.Clear();
  111. this.ultraCheckEditor1.Checked = false;
  112. this.ultraCheckAll.Checked = false;
  113. ccp.ServerName = "UIK.UIK03.UIK030030";
  114. ccp.MethodName = "DoQuery";
  115. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  116. ccp.SourceDataTable = dt;
  117. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  118. this.ultraGrid1.DataSource = dt;
  119. if (dt.Rows.Count <= 0)
  120. {
  121. MessageBox.Show("记录不存在,请查证后查询!");
  122. }
  123. this.ultraCalendarENDTIME.Enabled = false;
  124. this.ultraCalendarSTRATTIME.Enabled = false;
  125. return;
  126. }
  127. }
  128. }
  129. }
  130. }
  131. catch (Exception Ex)
  132. {
  133. MessageBox.Show(Ex.ToString());
  134. }
  135. }
  136. private void ultraCheckAll_CheckedChanged(object sender, EventArgs e)
  137. {
  138. try
  139. {
  140. if (this.ultraCheckAll.Checked)
  141. {
  142. this.ultraTextMC_ID.Enabled = false;
  143. this.ultraCalendarSTRATTIME.Enabled = false;
  144. this.ultraCalendarENDTIME.Enabled = false;
  145. }
  146. if (!this.ultraCheckAll.Checked)
  147. {
  148. this.ultraTextMC_ID.Enabled = true;
  149. this.ultraCalendarSTRATTIME.Enabled = false;
  150. this.ultraCalendarENDTIME.Enabled = false;
  151. }
  152. }
  153. catch (Exception Ex)
  154. {
  155. MessageBox.Show(Ex.ToString());
  156. }
  157. }
  158. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  159. {
  160. if (this.ultraCheckEditor1.Checked)
  161. {
  162. this.ultraCalendarENDTIME.Enabled = true;
  163. this.ultraCalendarSTRATTIME.Enabled = true;
  164. }
  165. if (!this.ultraCheckEditor1.Checked)
  166. {
  167. this.ultraCalendarENDTIME.Enabled = false;
  168. this.ultraCalendarSTRATTIME.Enabled = false;
  169. this.ultraCalendarSTRATTIME.Text = "";
  170. this.ultraCalendarENDTIME.Text = "";
  171. }
  172. }
  173. private void UIK030030_Load(object sender, EventArgs e)
  174. {
  175. this.ultraCalendarENDTIME.Enabled = false;
  176. this.ultraCalendarSTRATTIME.Enabled = false;
  177. }
  178. }
  179. }