UIK010030.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. using System.Diagnostics;
  12. namespace Core.LZMes.Client.UIK
  13. {
  14. public partial class UIK010030 : FrmBase
  15. {
  16. public UIK010030()
  17. {
  18. InitializeComponent();
  19. }
  20. private void UIK010030_Load(object sender, EventArgs e)
  21. {
  22. this.ultraCalendarENDTIME.Enabled = false;
  23. this.ultraCalendarSTRATTIME.Enabled = false;
  24. }
  25. public override void ToolBar_Click(object sender, string ToolbarKey)
  26. {
  27. switch (ToolbarKey)
  28. {
  29. case "Query"://查询
  30. this.DoQuery();
  31. break;
  32. case "Export":
  33. this.DoExport();
  34. break;
  35. }
  36. }
  37. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  38. {
  39. if (this.ultraCheckEditor1.Checked)
  40. {
  41. this.ultraCalendarENDTIME.Enabled = true;
  42. this.ultraCalendarSTRATTIME.Enabled = true;
  43. this.ultraCheckAll.Checked = false;
  44. }
  45. if (!this.ultraCheckEditor1.Checked)
  46. {
  47. this.ultraCalendarENDTIME.Enabled = false;
  48. this.ultraCalendarSTRATTIME.Enabled = false;
  49. }
  50. }
  51. private void ultraCheckAll_CheckedChanged(object sender, EventArgs e)
  52. {
  53. try
  54. {
  55. if (this.ultraCheckAll.Checked)
  56. {
  57. this.ultraCheckEditor1.Checked = false;
  58. this.ultraCalendarSTRATTIME.Enabled = false;
  59. this.ultraCalendarENDTIME.Enabled = false;
  60. }
  61. }
  62. catch (Exception Ex)
  63. {
  64. MessageBox.Show(Ex.ToString());
  65. }
  66. }
  67. public void DoExport()
  68. {
  69. try
  70. {
  71. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  72. {
  73. string fName = this.saveFileDialog1.FileName;
  74. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  75. System.Diagnostics.Process.Start(fName);
  76. // Process.Start(fName);
  77. }
  78. }
  79. catch (Exception ex)
  80. {
  81. System.Diagnostics.Debug.WriteLine(ex.ToString());
  82. }
  83. }
  84. private void DoQuery()
  85. {
  86. if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false)
  87. {
  88. this.ultraCalendarENDTIME.Text = "";
  89. this.ultraCalendarSTRATTIME.Text = "";
  90. }
  91. try
  92. {
  93. string starttiem = this.ultraCalendarSTRATTIME.Text.ToString();
  94. string endtime = this.ultraCalendarENDTIME.Text.ToString();
  95. bool flag = false;
  96. // DataTable dt = new DataTable();
  97. if (this.ultraCheckEditor1.Checked == false && this.ultraCheckAll.Checked == false)
  98. {
  99. MessageBox.Show("请选择查询条件!");
  100. }
  101. else
  102. {
  103. if (this.ultraCheckAll.Checked)
  104. {
  105. this.dataSet1.Tables[0].Clear();
  106. CoreClientParam ccp = new CoreClientParam();
  107. this.ultraCheckAll.Checked = false;
  108. ccp.ServerName = "UIK.UIK01.UIK010030";
  109. ccp.MethodName = "DoQuery";
  110. ccp.ServerParams = new object[] { starttiem, endtime, flag };
  111. ccp.SourceDataTable = this.dataSet1.Tables[0];
  112. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  113. DataRowCollection drc1 = dataSet1.Tables[0].Rows;
  114. if (drc1.Count <= 0)
  115. {
  116. MessageBox.Show("暂无乳化液记录!");
  117. }
  118. this.ultraCalendarENDTIME.Enabled = false;
  119. this.ultraCalendarSTRATTIME.Enabled = false;
  120. return;
  121. }
  122. if (this.ultraCheckEditor1.Checked)
  123. {
  124. this.dataSet1.Tables[0].Clear();
  125. flag = true;
  126. CoreClientParam ccp2 = new CoreClientParam();
  127. ccp2.ServerName = "UIK.UIK01.UIK010030";
  128. ccp2.MethodName = "DoQuery";
  129. ccp2.ServerParams = new object[] { starttiem, endtime, flag };
  130. ccp2.SourceDataTable = this.dataSet1.Tables[0];
  131. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  132. DataRowCollection drc2 = dataSet1.Tables[0].Rows;
  133. if (drc2.Count <= 0)
  134. {
  135. MessageBox.Show("暂无乳化液记录!");
  136. }
  137. this.ultraCheckAll.Checked = false;
  138. this.ultraCalendarENDTIME.Enabled = false;
  139. this.ultraCalendarSTRATTIME.Enabled = false;
  140. return;
  141. }
  142. }
  143. }
  144. catch (Exception Ex)
  145. {
  146. MessageBox.Show(Ex.ToString());
  147. }
  148. }
  149. }
  150. }