a991c23badc7b4feadbda6345dd5ec75a6646857.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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 UIK050020 : FrmBase
  14. {
  15. public UIK050020()
  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. try
  31. {
  32. string zgNum = "";
  33. string zgAr = "";
  34. string beginTime = "";
  35. string endTime = "";
  36. bool flag = false;
  37. CoreClientParam ccp = new CoreClientParam();
  38. CoreClientParam ccp2 = new CoreClientParam();
  39. //if (this.zgNumber.Text == "" && this.zgArea.Text == "" && this.ultraCheckEditor1.Checked == false)
  40. //{
  41. // MessageBox.Show("请选择查询条件!");
  42. //}
  43. //else
  44. //{
  45. if (this.ultraCheckEditor1.Checked)
  46. {
  47. this.dataSet1.Tables[0].Clear();
  48. this.dataSet2.Tables[0].Clear();
  49. this.zgArea.Clear();
  50. this.zgNumber.Clear();
  51. this.ultraCheckEditor1.Checked = false;
  52. ccp.ServerName = "UIK.UIK05.UIK050020";
  53. ccp.MethodName = "DoQueryShang";
  54. ccp.ServerParams = new object[] { zgNum, zgAr, flag ,beginTime,endTime};
  55. ccp.SourceDataTable = this.dataSet1.Tables[0];
  56. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  57. DataRowCollection drc1 = this.dataSet1.Tables[0].Rows;
  58. ccp2.ServerName = "UIK.UIK05.UIK050020";
  59. ccp2.MethodName = "DoQueryXia";
  60. ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  61. ccp2.SourceDataTable = this.dataSet2.Tables[0];
  62. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  63. DataRowCollection drc2 = this.dataSet2.Tables[0].Rows;
  64. if (drc1.Count <= 0)
  65. {
  66. MessageBox.Show("暂无记录!");
  67. }
  68. return;
  69. }
  70. else
  71. {
  72. flag = true;
  73. if (this.zgArea.Text == "" || this.zgNumber.Text == "")
  74. {
  75. if (this.zgNumber.Text == "")
  76. {
  77. this.dataSet1.Tables[0].Clear();
  78. this.dataSet2.Tables[0].Clear();
  79. zgAr = this.zgArea.Text;
  80. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : "";
  81. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : "";
  82. this.zgArea.Clear();
  83. this.zgNumber.Clear();
  84. this.ultraCheckEditor1.Checked = false;
  85. ccp.ServerName = "UIK.UIK05.UIK050020";
  86. ccp.MethodName = "DoQueryShang";
  87. ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  88. ccp.SourceDataTable = this.dataSet1.Tables[0];
  89. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  90. DataRowCollection drc1 = this.dataSet1.Tables[0].Rows;
  91. ccp2.ServerName = "UIK.UIK05.UIK050020";
  92. ccp2.MethodName = "DoQueryXia";
  93. ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  94. ccp2.SourceDataTable = this.dataSet2.Tables[0];
  95. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  96. DataRowCollection drc2 = this.dataSet2.Tables[0].Rows;
  97. if (drc1.Count <= 0)
  98. {
  99. MessageBox.Show("该区域的记录不存在!");
  100. }
  101. return;
  102. }
  103. if (this.zgArea.Text == "")
  104. {
  105. this.dataSet1.Tables[0].Clear();
  106. this.dataSet2.Tables[0].Clear();
  107. zgNum = this.zgNumber.Text;
  108. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : "";
  109. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : "";
  110. this.zgArea.Clear();
  111. this.zgNumber.Clear();
  112. this.ultraCheckEditor1.Checked = false;
  113. ccp.ServerName = "UIK.UIK05.UIK050020";
  114. ccp.MethodName = "DoQueryShang";
  115. ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  116. ccp.SourceDataTable = this.dataSet1.Tables[0];
  117. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  118. DataRowCollection drc1 = this.dataSet1.Tables[0].Rows;
  119. ccp2.ServerName = "UIK.UIK05.UIK050020";
  120. ccp2.MethodName = "DoQueryXia";
  121. ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  122. ccp2.SourceDataTable = this.dataSet2.Tables[0];
  123. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  124. DataRowCollection drc2 = this.dataSet2.Tables[0].Rows;
  125. if (drc1.Count <= 0)
  126. {
  127. MessageBox.Show("该轧辊顺序号记录不存在,请查证后查询!");
  128. }
  129. return;
  130. }
  131. }
  132. if (this.zgArea.Text == "" && this.zgNumber.Text == "")
  133. {
  134. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : "";
  135. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : "";
  136. this.zgArea.Clear();
  137. this.zgNumber.Clear();
  138. this.ultraCheckEditor1.Checked = false;
  139. ccp.ServerName = "UIK.UIK05.UIK050020";
  140. ccp.MethodName = "DoQueryShang";
  141. ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  142. ccp.SourceDataTable = this.dataSet1.Tables[0];
  143. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  144. DataRowCollection drc1 = this.dataSet1.Tables[0].Rows;
  145. ccp2.ServerName = "UIK.UIK05.UIK050020";
  146. ccp2.MethodName = "DoQueryXia";
  147. ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  148. ccp2.SourceDataTable = this.dataSet2.Tables[0];
  149. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  150. DataRowCollection drc2 = this.dataSet1.Tables[0].Rows;
  151. if (drc1.Count <= 0)
  152. {
  153. MessageBox.Show("记录不存在,请查证后查询!");
  154. }
  155. return;
  156. }
  157. else
  158. {
  159. this.dataSet1.Tables[0].Clear();
  160. this.dataSet2.Tables[0].Clear();
  161. zgNum = this.zgNumber.Text;
  162. zgAr = this.zgArea.Text;
  163. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd000000") : "";
  164. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd999999") : "";
  165. this.zgArea.Clear();
  166. this.zgNumber.Clear();
  167. this.ultraCheckEditor1.Checked = false;
  168. ccp.ServerName = "UIK.UIK05.UIK050020";
  169. ccp.MethodName = "DoQueryShang";
  170. ccp.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  171. ccp.SourceDataTable = this.dataSet1.Tables[0];
  172. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  173. DataRowCollection drc1 = this.dataSet1.Tables[0].Rows;
  174. ccp2.ServerName = "UIK.UIK05.UIK050020";
  175. ccp2.MethodName = "DoQueryXia";
  176. ccp2.ServerParams = new object[] { zgNum, zgAr, flag, beginTime, endTime };
  177. ccp2.SourceDataTable = this.dataSet2.Tables[0];
  178. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  179. DataRowCollection drc2 = this.dataSet2.Tables[0].Rows;
  180. if (drc1.Count <= 0)
  181. {
  182. MessageBox.Show("记录不存在,请查证后查询!");
  183. }
  184. return;
  185. }
  186. }
  187. }
  188. // }
  189. catch(Exception Ex)
  190. {
  191. MessageBox.Show(Ex.ToString());
  192. }
  193. }
  194. //if (this.ultraCheckEditor1.Checked)
  195. //{
  196. // ccp.ServerName = "UIK.UIK05.UIK050020";
  197. // ccp.MethodName = "DoQueryShang";
  198. // ccp.ServerParams = new object[] { zgNum, zgAr, flag };
  199. // ccp.SourceDataTable = dt;
  200. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  201. // this.ultraGrid1.DataSource = dt;
  202. //}
  203. //else
  204. //{
  205. // flag = "1";
  206. // if()
  207. //}
  208. //
  209. // string zgNum = this.zgNumber.Text;
  210. // string zgAr = this.zgArea.Text;
  211. // DataTable dt = new DataTable();
  212. // DataTable dt2 = new DataTable();
  213. // CoreClientParam ccp = new CoreClientParam();
  214. // ccp.ServerName = "UIK.UIK05.UIK050020";
  215. // ccp.MethodName = "DoQueryShang";
  216. // ccp.ServerParams = new object[] { zgNum, zgAr, startTime ,endTime};
  217. // ccp.SourceDataTable = dt;
  218. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  219. // this.ultraGrid1.DataSource = dt;
  220. //
  221. private void UIK050020_Load(object sender, EventArgs e)
  222. {
  223. }
  224. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  225. {
  226. try
  227. {
  228. if (this.ultraCheckEditor1.Checked)
  229. {
  230. this.zgNumber.Enabled = false;
  231. this.zgArea.Enabled = false;
  232. }
  233. if (!this.ultraCheckEditor1.Checked)
  234. {
  235. this.zgNumber.Enabled = true;
  236. this.zgArea.Enabled = true;
  237. }
  238. }
  239. catch (Exception Ex)
  240. {
  241. MessageBox.Show(Ex.ToString());
  242. }
  243. }
  244. //private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  245. //{
  246. // Infragistics.Win.UltraWinGrid.UltraGridRow row = this.ultraGrid2.ActiveRow;
  247. // if (this.ultraGrid1.ActiveRow.Cells["SPEC_NO"].Text == row.Cells["SPEC_NO"].Text)
  248. // {
  249. // ////int i = this.ultraGrid1.ActiveRow.Index;
  250. // //row.Cells["SPEC_NO"].Text
  251. // //this.ultraGrid2.cell2
  252. // }
  253. //}
  254. }
  255. }