UIC010001.cs 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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.UIC
  13. {
  14. public partial class UIC010001 : FrmBase
  15. {
  16. public UIC010001()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query":
  25. this.DoQuery();
  26. break;
  27. case "Export":
  28. this.DoExport();
  29. break;
  30. case "Close":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. UIK.UIK020030 s = new UIK.UIK020030();
  40. //s.DoQuery1(); //实绩刷新
  41. s.ob = this.ob;
  42. s.DoQuery1();
  43. CoreClientParam ccp = null;
  44. if (this.checkBox1.Checked)
  45. {
  46. ccp = new CoreClientParam();
  47. Hashtable ht = new Hashtable();
  48. ht.Add("i1", this.ultraComboEditor1.Text);
  49. ht.Add("i2", this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd")+ "-"+this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  50. ht.Add("o3", "");
  51. ccp.ServerName = "UIB.COM.ComDBProcedure";
  52. ccp.MethodName = "doXmlProcedure";
  53. ccp.ServerParams = new object[] { "UIC010001_01.CALL", ht };
  54. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  55. }
  56. //查询
  57. this.dataSet1.Clear();
  58. ArrayList al = new ArrayList();
  59. al.Add("UIC010001_01.SELECT");
  60. al.Add(this.ultraComboEditor1.Text);
  61. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "-" + this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") );
  62. ccp = new CoreClientParam();
  63. ccp.ServerName = "UIB.COM.ComDBQuery";
  64. ccp.MethodName = "doSimpleQuery";
  65. ccp.ServerParams = new object[] { al };
  66. ccp.IfShowErrMsg = false;
  67. ccp.SourceDataTable = this.dataSet1.Tables[0];
  68. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  69. }
  70. catch (Exception ex)
  71. {
  72. System.Diagnostics.Debug.WriteLine(ex.ToString());
  73. }
  74. }
  75. private void DoExport()
  76. {
  77. try
  78. {
  79. if (this.ultraGrid1.Rows.Count == 0)
  80. {
  81. MessageBox.Show("没有可以导出的数据", "提示");
  82. return;
  83. }
  84. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  85. {
  86. string fName = this.saveFileDialog1.FileName;
  87. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  88. Process.Start(fName);
  89. }
  90. }
  91. catch (Exception ex)
  92. {
  93. System.Diagnostics.Debug.WriteLine(ex.ToString());
  94. }
  95. }
  96. private void UIC010001_Load(object sender, EventArgs e)
  97. {
  98. this.ultraComboEditor1.SelectedIndex = 0;
  99. }
  100. private void ultraGrid1_DoubleClick(object sender, EventArgs e)
  101. {
  102. try
  103. {
  104. if (this.ultraGrid1.ActiveCell == null)
  105. return;
  106. //string gridValue = this.ultraGrid1.ActiveCell.Column.Key;//== "ZHIBIAO";
  107. string s1 = this.ultraComboEditor1.Text;
  108. string s2 = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
  109. if (s1 == "酸轧")
  110. {
  111. CUIC030110 CWindow = new CUIC030110();
  112. CWindow.ob = this.ob;
  113. CWindow.pLine = this.ultraComboEditor1.Text;
  114. CWindow.sTime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  115. CWindow.eTime = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  116. CWindow.flag = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
  117. if (s2 == "酸轧非计划总量(t)" || s2 == "酸轧卷一次命中率(%)" || s2 == "酸轧表面缺陷量(t)" || s2 == "1.原料类(t)" || s2 == "待判(未判定)(t)" || s2 == "2.酸轧类(t)" || s2 == "3.钢质类(t)" || s2 == "2.1酸轧辊印(t)" || s2 == "2.2酸轧擦划伤(t)" || s2 == "2.3酸轧振动纹(t)" || s2 == "2.4酸轧其它(t)")
  118. {
  119. CWindow.StartPosition = FormStartPosition.CenterScreen;
  120. if (CWindow.ShowDialog() == DialogResult.OK)
  121. {
  122. //null;
  123. }
  124. CWindow.Dispose();
  125. }
  126. }
  127. else if (s1 == "连退")
  128. {
  129. CUIC030130 CWindow = new CUIC030130();
  130. CWindow.ob = this.ob;
  131. CWindow.Flag_1 = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
  132. CWindow.PLine_1 = this.ultraComboEditor1.Text;
  133. CWindow.STime_1 = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  134. CWindow.ETime_1 = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  135. if (s2 == "连退非计划总量(t)" || s2 == "连退卷一次命中率(%)" || s2 == "待判(未判定)(t)" || s2 == "1.原料类(t)" || s2 == "连退表面缺陷量(t)"
  136. || s2 == "2.酸轧类(t)" || s2 == "3.连退类(t)" || s2 == "4.钢质类(t)" || s2 == "3.1连退平整花(t)" || s2 == "3.2连退擦划伤(t)" || s2 == "3.3连退辊印/压印(痕)(t)" || s2 == "3.4连退其它(t)")
  137. {
  138. CWindow.StartPosition = FormStartPosition.CenterScreen;
  139. if (CWindow.ShowDialog() == DialogResult.OK)
  140. {
  141. //null;
  142. }
  143. CWindow.Dispose();
  144. }
  145. }
  146. else if (s1 == "重卷")
  147. {
  148. CUIC030140 CWindow = new CUIC030140();
  149. CWindow.ob = this.ob;
  150. CWindow.Flag_1 = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
  151. CWindow.PLine_1 = this.ultraComboEditor1.Text;
  152. CWindow.STime_1 = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  153. CWindow.ETime_1 = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  154. if (s2 == "重卷非计划总量(t)" || s2 == "重卷一次命中率(%)" || s2 == "待判(未判定)(t)" || s2 == "1.原料类缺陷(t)" || s2 == "重卷表面缺陷量(t)"
  155. || s2 == "2.酸轧类(t)" || s2 == "3.重卷类(t)" || s2 == "3.1重卷平整花(t)" || s2 == "3.2重卷擦划伤(t)" || s2 == "3.3重卷辊印/压印(痕)(t)" || s2 == "3.4重卷其它(t)")
  156. {
  157. CWindow.StartPosition = FormStartPosition.CenterScreen;
  158. if (CWindow.ShowDialog() == DialogResult.OK)
  159. {
  160. //null;
  161. }
  162. CWindow.Dispose();
  163. }
  164. }
  165. else if (s1 == "连退重卷")
  166. {
  167. CUIC030140 CWindow = new CUIC030140();
  168. CWindow.ob = this.ob;
  169. CWindow.Flag_1 = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
  170. CWindow.PLine_1 = this.ultraComboEditor1.Text;
  171. CWindow.STime_1 = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  172. CWindow.ETime_1 = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  173. if (s2 == "非计划品量(t)")
  174. {
  175. CWindow.StartPosition = FormStartPosition.CenterScreen;
  176. if (CWindow.ShowDialog() == DialogResult.OK)
  177. {
  178. //null;
  179. }
  180. CWindow.Dispose();
  181. }
  182. }
  183. }
  184. catch (Exception ex)
  185. {
  186. System.Diagnostics.Debug.WriteLine(ex.ToString());
  187. }
  188. }
  189. private void button1_Click(object sender, EventArgs e)
  190. {
  191. try
  192. {
  193. CUIC030120 CWindow = new CUIC030120();
  194. CWindow.ob = this.ob;
  195. if (CWindow.ShowDialog() == DialogResult.OK)
  196. {
  197. //null;
  198. }
  199. CWindow.Dispose();
  200. }
  201. catch (Exception ex)
  202. {
  203. System.Diagnostics.Debug.WriteLine(ex.ToString());
  204. }
  205. }
  206. }
  207. }