UIC020220.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.UIC
  13. {
  14. public partial class UIC020220 : FrmBase
  15. {
  16. public UIC020220()
  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 "Close":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. CoreClientParam ccp = new CoreClientParam();
  40. //查询
  41. this.dataSet1.Clear();
  42. ArrayList al = new ArrayList();
  43. string s1 = this.ultraComboEditor1.Text;
  44. if (s1 == "热轧")
  45. {
  46. al.Add("UIC020220_01.SELECT");
  47. }
  48. else if (s1 == "连退")
  49. {
  50. al.Add("UIC020220_02.SELECT");
  51. }
  52. else
  53. {
  54. al.Add("UIC020220_03.SELECT");
  55. }
  56. //al.Add(this.ultraComboEditor1.Text);
  57. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
  58. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  59. ccp = new CoreClientParam();
  60. ccp.ServerName = "UIB.COM.ComDBQuery";
  61. ccp.MethodName = "doSimpleQuery";
  62. ccp.ServerParams = new object[] { al };
  63. ccp.IfShowErrMsg = false;
  64. ccp.SourceDataTable = this.dataSet1.Tables[0];
  65. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  66. }
  67. catch (Exception ex)
  68. {
  69. System.Diagnostics.Debug.WriteLine(ex.ToString());
  70. }
  71. }
  72. private void DoExport()
  73. {
  74. try
  75. {
  76. if (this.ultraGrid1.Rows.Count == 0)
  77. {
  78. MessageBox.Show("没有可以导出的数据", "提示");
  79. return;
  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 UIC020220_Load(object sender, EventArgs e)
  94. {
  95. this.ultraComboEditor1.SelectedIndex = 0;
  96. }
  97. private void ultraGrid1_DoubleClick(object sender, EventArgs e)
  98. {
  99. try
  100. {
  101. }
  102. catch (Exception ex)
  103. {
  104. System.Diagnostics.Debug.WriteLine(ex.ToString());
  105. }
  106. }
  107. }
  108. }