baa5bcdae63b25b63a1e5aefeedd236d3fcbb6ba.svn-base 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.UIK.UIK05
  13. {
  14. public partial class UIK050070 : FrmBase
  15. {
  16. public UIK050070()
  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 "insert"://导出
  31. this.DoInSert();
  32. break;
  33. }
  34. }
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. dataSet1.Tables[0].Clear();
  40. CoreClientParam ccp = new CoreClientParam();
  41. ccp.ServerName = "UIK.UIK05.UIK050001";
  42. ccp.MethodName = "DoQuery";
  43. ccp.ServerParams = new object[] { };
  44. ccp.SourceDataTable = this.dataSet1.Tables[0];
  45. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  46. if (this.ultraGrid1.Rows.Count <= 0)
  47. {
  48. MessageBox.Show("暂无记录!");
  49. }
  50. return;
  51. }
  52. catch (Exception Ex)
  53. {
  54. MessageBox.Show(Ex.ToString());
  55. }
  56. }
  57. private void DoExport()
  58. {
  59. try
  60. {
  61. if (this.ultraGrid1.Rows.Count == 0)
  62. {
  63. MessageBox.Show("没有可以导出的数据", "提示");
  64. return;
  65. }
  66. //saveFileDialog1.FileName = "轧辊库存数据" + DateTime.Today.ToShortDateString() + "_01";
  67. saveFileDialog1.FileName = "轧辊库存数据" + DateTime.Today.ToString("yyyyMMdd")+"_01";
  68. saveFileDialog1.Filter = "表格(*.xls)|*.xls";
  69. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  70. {
  71. string fName = this.saveFileDialog1.FileName;
  72. this.ultraGridExcelExporter1.Export(ultraGrid1, fName);
  73. Process.Start(fName);
  74. }
  75. }
  76. catch (Exception ex)
  77. {
  78. System.Diagnostics.Debug.WriteLine(ex.ToString());
  79. }
  80. }
  81. private void DoInSert()
  82. {
  83. UIK050090 CWindow = new UIK050090();
  84. CWindow.ob = this.ob;
  85. //CWindow.UIK050090_Load(sender,e);
  86. CWindow.Show();
  87. }
  88. }
  89. }