UIC030001.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 UIC030001 : FrmBase
  15. {
  16. public UIC030001()
  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 "Export1":
  31. this.DoExport1();
  32. break;
  33. case "Close":
  34. this.Close();
  35. break;
  36. }
  37. }
  38. private void DoQuery()
  39. {
  40. try
  41. {
  42. //UIK.UIK020030 s = new UIK.UIK020030();
  43. //s.DoQuery1(); //实绩刷新
  44. //s.ob = this.ob;
  45. //s.DoQuery1();
  46. CoreClientParam ccp = null;
  47. //查询
  48. this.dataSet1.Clear();
  49. ArrayList al = new ArrayList();
  50. al.Add("UIC030001_01.SELECT");
  51. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd")+"000000");
  52. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd")+"999999");
  53. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  54. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  55. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  56. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  57. al.Add(this.ultraDateTimeEditor2.DateTime.AddDays(1).ToString("yyyy/MM/dd"));
  58. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyy/MM/dd"));
  59. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  60. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  61. ccp = new CoreClientParam();
  62. ccp.ServerName = "UIB.COM.ComDBQuery";
  63. ccp.MethodName = "doSimpleQuery";
  64. ccp.ServerParams = new object[] { al };
  65. ccp.IfShowErrMsg = false;
  66. ccp.SourceDataTable = this.dataSet1.Tables[0];
  67. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  68. ArrayList a2 = new ArrayList();
  69. a2.Add("UIC030001_02.SELECT");
  70. a2.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  71. a2.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  72. a2.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  73. a2.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  74. a2.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  75. a2.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  76. a2.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  77. a2.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  78. ccp = new CoreClientParam();
  79. ccp.ServerName = "UIB.COM.ComDBQuery";
  80. ccp.MethodName = "doSimpleQuery";
  81. ccp.ServerParams = new object[] { a2 };
  82. ccp.IfShowErrMsg = false;
  83. ccp.SourceDataTable = this.dataSet1.Tables[1];
  84. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  85. }
  86. catch (Exception ex)
  87. {
  88. System.Diagnostics.Debug.WriteLine(ex.ToString());
  89. }
  90. }
  91. private void DoExport()
  92. {
  93. try
  94. {
  95. if (this.ultraGrid1.Rows.Count == 0)
  96. {
  97. MessageBox.Show("没有可以导出的数据", "提示");
  98. return;
  99. }
  100. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  101. {
  102. string fName = this.saveFileDialog1.FileName;
  103. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  104. Process.Start(fName);
  105. }
  106. }
  107. catch (Exception ex)
  108. {
  109. System.Diagnostics.Debug.WriteLine(ex.ToString());
  110. }
  111. }
  112. private void DoExport1()
  113. {
  114. try
  115. {
  116. if (this.ultraGrid2.Rows.Count == 0)
  117. {
  118. MessageBox.Show("没有可以导出的数据", "提示");
  119. return;
  120. }
  121. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  122. {
  123. string fName = this.saveFileDialog1.FileName;
  124. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  125. Process.Start(fName);
  126. }
  127. }
  128. catch (Exception ex)
  129. {
  130. System.Diagnostics.Debug.WriteLine(ex.ToString());
  131. }
  132. }
  133. private void button1_Click(object sender, EventArgs e)
  134. {
  135. try
  136. {
  137. CUIC030120 CWindow = new CUIC030120();
  138. CWindow.ob = this.ob;
  139. if (CWindow.ShowDialog() == DialogResult.OK)
  140. {
  141. //null;
  142. }
  143. CWindow.Dispose();
  144. }
  145. catch (Exception ex)
  146. {
  147. System.Diagnostics.Debug.WriteLine(ex.ToString());
  148. }
  149. }
  150. }
  151. }