850fd009e6531314bc77a62c5d7207420789d7dd.svn-base 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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.Text.RegularExpressions;//正则表达式所在空间
  12. using Infragistics.Win.UltraWinGrid;
  13. using Microsoft.Office.Interop.Excel;
  14. using System.Diagnostics;
  15. namespace Core.LZMes.Client.UIB
  16. {
  17. public partial class UIB100207 : FrmBase
  18. {
  19. public UIB100207()
  20. {
  21. InitializeComponent();
  22. }
  23. public override void ToolBar_Click(object sender, string ToolbarKey)
  24. {
  25. try
  26. {
  27. switch (ToolbarKey.ToString())
  28. {
  29. case "Query":
  30. this.DoQuery();
  31. break;
  32. case "Export":
  33. this.DoExport();
  34. break;
  35. }
  36. }
  37. catch (System.Exception ex)
  38. {
  39. System.Diagnostics.Debug.WriteLine(ex.ToString());
  40. }
  41. }
  42. public void DoQuery()
  43. {
  44. try
  45. {
  46. ArrayList al = new ArrayList();
  47. al.Add("UIB100207_01.SELECT");
  48. string strLine = "";
  49. if (this.comboBox1.SelectedIndex == 0)
  50. {
  51. strLine = "R";
  52. }
  53. else
  54. {
  55. strLine = "L";
  56. }
  57. al.Add(strLine);
  58. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");
  59. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");
  60. al.Add(this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd") + "000000");
  61. al.Add(this.ultraDateTimeEditor4.DateTime.ToString("yyyyMMdd") + "999999");
  62. al.Add(this.textBox1.Text.ToString());
  63. al.Add(this.textBox2.Text.ToString());
  64. this.dataSet1.Tables[0].Clear();
  65. CoreClientParam ccp = new CoreClientParam();
  66. ccp.ServerName = "UIB.JHY.JHYComQuery";
  67. ccp.MethodName = "doSimpleQuery";
  68. ccp.ServerParams = new object[] { al };
  69. ccp.SourceDataTable = this.dataSet1.Tables[0];
  70. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  71. }
  72. catch (Exception ex)
  73. {
  74. }
  75. }
  76. //导出
  77. public void DoExport()
  78. {
  79. try
  80. {
  81. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  82. {
  83. string fName = this.saveFileDialog1.FileName;
  84. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  85. Process.Start(fName);
  86. }
  87. }
  88. catch (Exception ex)
  89. {
  90. System.Diagnostics.Debug.WriteLine(ex.ToString());
  91. }
  92. }
  93. private void UIB100207_Load(object sender, EventArgs e)
  94. {
  95. try
  96. {
  97. this.comboBox1.SelectedIndex = 0;
  98. }
  99. catch (Exception ex)
  100. {
  101. }
  102. }
  103. }
  104. }