UIM030070.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. namespace Core.LZMes.Client.UIM.UIM03
  11. {
  12. public partial class UIM030070 : FrmBase
  13. {
  14. public UIM030070()
  15. {
  16. InitializeComponent();
  17. }
  18. public override void ToolBar_Click(object sender, string ToolbarKey)
  19. {
  20. switch (ToolbarKey)
  21. {
  22. case "Query":
  23. this.DoQuery();
  24. break;
  25. case "Export":
  26. this.DoExport();
  27. break;
  28. case "Exit":
  29. this.Close();
  30. break;
  31. }
  32. }
  33. private void DoQuery()
  34. {
  35. try
  36. {
  37. this.dataSet1.Tables[0].Clear();
  38. string beginDate = this.ultraDateTimeEditor1.Value == null ? "00000000" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  39. string endDate = this.ultraDateTimeEditor2.Value == null ? "00000000" : this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  40. string coilNo = textBox9.Text.Trim();
  41. CoreClientParam ccp = new CoreClientParam();
  42. System.Collections.ArrayList arrayParam = new System.Collections.ArrayList();
  43. arrayParam.Add("UIM030070_01.SELECT");
  44. arrayParam.Add(beginDate);
  45. arrayParam.Add(endDate);
  46. arrayParam.Add(coilNo);
  47. ccp.ServerName = "UIB.COM.ComDBQuery";
  48. ccp.MethodName = "doSimpleQuery";
  49. ccp.ServerParams = new object[] { arrayParam };
  50. ccp.SourceDataTable = this.dataSet1.Tables[0];
  51. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  52. }
  53. catch (Exception EX)
  54. {
  55. MessageBox.Show(EX.ToString());
  56. }
  57. }
  58. private void DoExport()
  59. {
  60. try
  61. {
  62. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  63. {
  64. string fileName = this.saveFileDialog1.FileName;
  65. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  66. System.Diagnostics.Process.Start(fileName);
  67. }
  68. }
  69. catch (Exception EX)
  70. {
  71. MessageBox.Show(EX.ToString());
  72. }
  73. }
  74. }
  75. }