UIK050100.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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 UIK050100 : FrmBase
  14. {
  15. public UIK050100()
  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. case "Export":
  27. this.DoExport();
  28. break;
  29. }
  30. }
  31. private void DoExport()
  32. {
  33. try
  34. {
  35. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  36. {
  37. string fileName = this.saveFileDialog1.FileName;
  38. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  39. System.Diagnostics.Process.Start(fileName);
  40. }
  41. }
  42. catch (Exception EX)
  43. {
  44. MessageBox.Show(EX.ToString());
  45. }
  46. }
  47. private void DoQuery()
  48. {
  49. try
  50. {
  51. string in_start_time = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  52. string in_end_time = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  53. string C_SPEC_STL_GRD = "";
  54. string C_OUT_YARD = "";//出库类型
  55. string I_C_OUT_YARD = "";
  56. int queryType = 8;
  57. try
  58. {
  59. queryType = int.Parse(this.ultraComboEditor5.Value.ToString());
  60. }
  61. catch(Exception e)
  62. {
  63. MessageBox.Show("请选择查询类型!");
  64. return;
  65. }
  66. if (this.checkBox1.Checked == false && this.checkBox2.Checked == false)
  67. {
  68. MessageBox.Show("请选择查询条件!");
  69. return;
  70. }
  71. else
  72. {
  73. this.dataSet1.Tables[0].Clear();
  74. if (this.checkBox1.Checked )
  75. {
  76. C_OUT_YARD = this.ultraComboEditor3.Text.ToString().Trim();
  77. if (C_OUT_YARD == "上料出库")
  78. {
  79. I_C_OUT_YARD = "1";
  80. }
  81. if(C_OUT_YARD =="热退")
  82. {
  83. I_C_OUT_YARD = "2";
  84. }
  85. }
  86. else
  87. {
  88. I_C_OUT_YARD = "";
  89. }
  90. if(this.checkBox2.Checked)
  91. {
  92. C_SPEC_STL_GRD = this.ultraComboEditor1.Text.ToString().Trim();
  93. }
  94. else
  95. {
  96. C_SPEC_STL_GRD = "";
  97. }
  98. CoreClientParam ccp = new CoreClientParam();
  99. ccp.ServerName = "UIK.UIK05.UIK050100";
  100. ccp.MethodName = "DoQuery";
  101. ccp.ServerParams = new object[] { in_start_time, in_end_time, C_SPEC_STL_GRD, I_C_OUT_YARD, queryType };
  102. ccp.SourceDataTable = this.dataSet1.Tables[0];
  103. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  104. DataRowCollection drc = this.dataSet1.Tables[0].Rows;
  105. if(drc.Count <= 0)
  106. {
  107. MessageBox.Show("该时间内无出库钢卷!");
  108. return;
  109. }
  110. return;
  111. }
  112. }
  113. catch (Exception ex)
  114. {
  115. MessageBox.Show("系统更新,请重启客户端!");
  116. return;
  117. }
  118. }
  119. private void UIK050100_Load(object sender, EventArgs e)
  120. {
  121. this.checkBox1.Checked = false;
  122. this.checkBox2.Checked = false;
  123. this.ultraComboEditor1.Enabled = false;
  124. this.ultraComboEditor3.Enabled = false;
  125. }
  126. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  127. {
  128. if (this.checkBox1.Checked == true)
  129. {
  130. this.ultraComboEditor3.Enabled = true;
  131. }
  132. else
  133. {
  134. this.ultraComboEditor3.Enabled = false;
  135. }
  136. }
  137. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  138. {
  139. if (this.checkBox2.Checked == true)
  140. {
  141. this.ultraComboEditor1.Enabled = true;
  142. }
  143. else
  144. {
  145. this.ultraComboEditor1.Enabled = false;
  146. }
  147. }
  148. //private void DoExport()
  149. //{
  150. // try
  151. // {
  152. // if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  153. // {
  154. // string fileName = this.saveFileDialog1.FileName;
  155. // ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  156. // System.Diagnostics.Process.Start(fileName);
  157. // }
  158. // }
  159. // catch (Exception EX)
  160. // {
  161. // MessageBox.Show(EX.ToString());
  162. // }
  163. //}
  164. }
  165. }