1e15b02243e593ad501617b8834fe89b9bdb54f8.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.UIM.UIM01
  13. {
  14. public partial class UIM010400 : FrmBase
  15. {
  16. public UIM010400()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "DoQuery":
  25. this.DoQuery();
  26. break;
  27. case "doexport":
  28. this.DoExport();
  29. break;
  30. case "Exit":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. CoreClientParam ccp = null;
  40. ccp = new CoreClientParam();
  41. Hashtable ht = new Hashtable();
  42. ht.Add("i1", this.ultraComboEditor1.Text);
  43. ht.Add("i2", this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
  44. ht.Add("i3", this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  45. ht.Add("o4", "");
  46. ccp.ServerName = "UIB.COM.ComDBProcedure";
  47. ccp.MethodName = "doXmlProcedure";
  48. ccp.ServerParams = new object[] { "UIM010400.CALL", ht };
  49. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  50. //查询
  51. this.dataSet2.Clear();
  52. ArrayList al = new ArrayList();
  53. al.Add("UIM010400.SELECT");
  54. al.Add(this.ultraComboEditor1.Text);
  55. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "-" + this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  56. ccp = new CoreClientParam();
  57. ccp.ServerName = "UIB.COM.ComDBQuery";
  58. ccp.MethodName = "doSimpleQuery";
  59. ccp.ServerParams = new object[] { al };
  60. ccp.IfShowErrMsg = false;
  61. ccp.SourceDataTable = this.dataSet2.Tables[0];
  62. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  63. this.dataSet1.Clear();
  64. ArrayList al1 = new ArrayList();
  65. string line = this.ultraComboEditor1.Text.ToString();
  66. if(line=="酸轧")
  67. {
  68. al1.Add("UIM010400_02.SELECT");
  69. }
  70. else if (line == "连退重卷")
  71. {
  72. al1.Add("UIM010400_01.SELECT");
  73. }
  74. //al.Add(this.ultraComboEditor1.Text);
  75. al1.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
  76. al1.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  77. CoreClientParam ccp2 = new CoreClientParam();
  78. ccp2.ServerName = "UIB.COM.ComDBQuery";
  79. ccp2.MethodName = "doSimpleQuery";
  80. ccp2.ServerParams = new object[] { al1 };
  81. ccp2.IfShowErrMsg = false;
  82. ccp2.SourceDataTable = this.dataSet1.Tables[0];
  83. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  84. }
  85. catch (Exception ex)
  86. {
  87. System.Diagnostics.Debug.WriteLine(ex.ToString());
  88. }
  89. }
  90. private void DoExport()
  91. {
  92. try
  93. {
  94. if (this.ultraGrid1.Rows.Count == 0)
  95. {
  96. MessageBox.Show("没有可以导出的数据", "提示");
  97. return;
  98. }
  99. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  100. {
  101. string fName = this.saveFileDialog1.FileName;
  102. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  103. Process.Start(fName);
  104. }
  105. }
  106. catch (Exception ex)
  107. {
  108. System.Diagnostics.Debug.WriteLine(ex.ToString());
  109. }
  110. }
  111. private void UIM010400_Load(object sender, EventArgs e)
  112. {
  113. this.ultraComboEditor1.SelectedIndex = 1;
  114. }
  115. }
  116. }