89378a931f6f0282e07706d4c806022b5a4b25c2.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 UIC020170 : FrmBase
  15. {
  16. public UIC020170()
  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. CoreClientParam ccp = null;
  40. //查询
  41. this.dataSet1.Clear();
  42. ArrayList al = new ArrayList();
  43. al.Add("UIC010001_24.SELECT");
  44. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
  45. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  46. ccp = new CoreClientParam();
  47. ccp.ServerName = "UIB.COM.ComDBQuery";
  48. ccp.MethodName = "doSimpleQuery";
  49. ccp.ServerParams = new object[] { al };
  50. ccp.IfShowErrMsg = false;
  51. ccp.SourceDataTable = this.dataSet1.Tables[0];
  52. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  53. }
  54. catch (Exception ex)
  55. {
  56. System.Diagnostics.Debug.WriteLine(ex.ToString());
  57. }
  58. }
  59. private void DoExport()
  60. {
  61. try
  62. {
  63. if (this.ultraGrid1.Rows.Count == 0)
  64. {
  65. MessageBox.Show("没有可以导出的数据", "提示");
  66. return;
  67. }
  68. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  69. {
  70. string fName = this.saveFileDialog1.FileName;
  71. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  72. Process.Start(fName);
  73. }
  74. }
  75. catch (Exception ex)
  76. {
  77. System.Diagnostics.Debug.WriteLine(ex.ToString());
  78. }
  79. }
  80. private void UIC010001_Load(object sender, EventArgs e)
  81. {
  82. this.ultraComboEditor1.SelectedIndex = 0;
  83. }
  84. //private void button1_Click(object sender, EventArgs e)
  85. //{
  86. // try
  87. // {
  88. // CUIC030120 CWindow = new CUIC030120();
  89. // CWindow.ob = this.ob;
  90. // if (CWindow.ShowDialog() == DialogResult.OK)
  91. // {
  92. // //null;
  93. // }
  94. // CWindow.Dispose();
  95. // }
  96. // catch (Exception ex)
  97. // {
  98. // System.Diagnostics.Debug.WriteLine(ex.ToString());
  99. // }
  100. //}
  101. }
  102. }