b359bddd3c2906f5e982e955f78aa7dc4de8549c.svn-base 3.3 KB

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