UIM030400.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 UIM030400 : FrmBase
  13. {
  14. public UIM030400()
  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 queryDate = this.ultraDateTimeEditor1.Value == null ? "" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  39. CoreClientParam ccp = new CoreClientParam();
  40. ccp.ServerName = "UIM.UIM02.UIM020010";
  41. ccp.MethodName = "queryFinishedCoilOfDay";
  42. ccp.ServerParams = new object[] { queryDate };
  43. ccp.SourceDataTable = this.dataSet1.Tables[0];
  44. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  45. }
  46. catch (Exception EX)
  47. {
  48. MessageBox.Show(EX.ToString());
  49. }
  50. }
  51. private void DoExport()
  52. {
  53. try
  54. {
  55. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  56. {
  57. string fileName = this.saveFileDialog1.FileName;
  58. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  59. System.Diagnostics.Process.Start(fileName);
  60. }
  61. }
  62. catch (Exception EX)
  63. {
  64. MessageBox.Show(EX.ToString());
  65. }
  66. }
  67. }
  68. }