c1d2323ba2533839358b1dfc8012024fecd79216.svn-base 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.UIB
  13. {
  14. public partial class UIB030180 : FrmBase
  15. {
  16. public UIB030180()
  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 "DoExport":
  28. this.DoExport();
  29. break;
  30. }
  31. }
  32. public void DoQuery()
  33. {
  34. try
  35. {
  36. ArrayList al = new ArrayList();
  37. if (this.comboBox1.SelectedIndex == 0)
  38. {
  39. al.Add("UIB030180_01.SELECT");
  40. }
  41. else if (this.comboBox1.SelectedIndex == 1)
  42. {
  43. al.Add("UIB030180_02.SELECT");
  44. }
  45. else
  46. {
  47. al.Add("UIB030180_03.SELECT");
  48. }
  49. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  50. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  51. this.dataSet1.Tables[0].Clear();
  52. CoreClientParam ccp = new CoreClientParam();
  53. ccp.ServerName = "UIB.COM.ComDBQuery";
  54. ccp.MethodName = "doSimpleQuery";
  55. ccp.ServerParams = new object[] { al };
  56. ccp.SourceDataTable = this.dataSet1.Tables[0];
  57. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  58. }
  59. catch (Exception ex)
  60. {
  61. System.Diagnostics.Debug.WriteLine(ex.ToString());
  62. }
  63. }
  64. public void DoExport()
  65. {
  66. try
  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 UIB030180_Load(object sender, EventArgs e)
  81. {
  82. this.comboBox1.SelectedIndex = 0;
  83. }
  84. }
  85. }