UIK050104.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 Infragistics.Win.UltraWinGrid;
  12. using System.Diagnostics;
  13. namespace Core.LZMes.Client.UIK
  14. {
  15. public partial class UIK050104 : FrmBase
  16. {
  17. public UIK050104()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. switch (ToolbarKey)
  24. {
  25. case "Query"://查询
  26. this.DoQuery();
  27. break;
  28. case "Export"://添加换下轧辊实绩
  29. this.DoExport();
  30. break;
  31. //case "Update"://下发换下轧辊实绩
  32. // this.DoUpdate();
  33. // break;
  34. }
  35. }
  36. private void DoQuery()
  37. {
  38. try
  39. {
  40. string zgNum = "";
  41. string beginTime = "";
  42. string endTime = "";
  43. string type = "";
  44. CoreClientParam ccp = new CoreClientParam();
  45. DataTable dt = new DataTable();
  46. zgNum = this.ultraTextzgNum.Text;
  47. type = this.ultraComboEditor1.Text;
  48. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  49. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
  50. Hashtable ht = new Hashtable();
  51. ht.Add("i1", beginTime);
  52. ht.Add("i2", endTime);
  53. ht.Add("o3", "");
  54. ccp.ServerName = "UIB.COM.ComDBProcedure";
  55. ccp.MethodName = "doXmlProcedure";
  56. ccp.ServerParams = new object[] { "UIK050103_01.CALL", ht };
  57. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  58. this.dataSet1.Clear();
  59. ArrayList al = new ArrayList();
  60. al.Add("UIK050103_02.SELECT");
  61. al.Add(zgNum);
  62. al.Add(type);
  63. al.Add(beginTime);
  64. al.Add(endTime);
  65. CoreClientParam ccp2 = new CoreClientParam();
  66. ccp2.ServerName = "UIB.COM.ComDBQuery";
  67. ccp2.MethodName = "doSimpleQuery";
  68. ccp2.ServerParams = new object[] { al };
  69. ccp2.IfShowErrMsg = false;
  70. ccp2.SourceDataTable = this.dataSet1.Tables[0];
  71. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  72. this.dataSet2.Clear();
  73. ArrayList ar = new ArrayList();
  74. ar.Add("UIK050103_03.SELECT");
  75. CoreClientParam ccp3 = new CoreClientParam();
  76. ccp3.ServerName = "UIB.COM.ComDBQuery";
  77. ccp3.MethodName = "doSimpleQuery";
  78. ccp3.ServerParams = new object[] { ar };
  79. ccp3.IfShowErrMsg = false;
  80. ccp3.SourceDataTable = this.dataSet2.Tables[0];
  81. this.ExecuteQueryToDataTable(ccp3, CoreInvokeType.Internal);
  82. }
  83. catch (Exception Ex)
  84. {
  85. MessageBox.Show(Ex.ToString());
  86. }
  87. }
  88. private void DoExport()
  89. {
  90. try
  91. {
  92. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  93. {
  94. string fileName = this.saveFileDialog1.FileName;
  95. this.ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  96. System.Diagnostics.Process.Start(fileName);
  97. }
  98. }
  99. catch (Exception ex)
  100. {
  101. MessageBox.Show(ex.ToString());
  102. }
  103. }
  104. private void UIK050104_Load(object sender, EventArgs e)
  105. {
  106. }
  107. }
  108. }