UIM030060.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 UIM030060 : FrmBase
  13. {
  14. public UIM030060()
  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. ccp.ServerName = "UIM.UIM02.UIM020010";
  43. ccp.MethodName = "queryStockHis";
  44. ccp.ServerParams = new object[] { beginDate,endDate,coilNo, CustomInfo };
  45. ccp.SourceDataTable = this.dataSet1.Tables[0];
  46. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  47. }
  48. catch (Exception EX)
  49. {
  50. MessageBox.Show(EX.ToString());
  51. }
  52. }
  53. private void DoExport()
  54. {
  55. try
  56. {
  57. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  58. {
  59. string fileName = this.saveFileDialog1.FileName;
  60. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  61. System.Diagnostics.Process.Start(fileName);
  62. }
  63. }
  64. catch (Exception EX)
  65. {
  66. MessageBox.Show(EX.ToString());
  67. }
  68. }
  69. private void UIM030060_Load(object sender, EventArgs e)
  70. {
  71. if (CustomInfo == "2")
  72. {
  73. ultraGrid1.DisplayLayout.Bands[0].Columns["PKG_QLT"].Hidden = false;
  74. }
  75. else
  76. {
  77. ultraGrid1.DisplayLayout.Bands[0].Columns["PKG_QLT"].Hidden = true;
  78. }
  79. }
  80. }
  81. }