UIM030600.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 UIM030600 : FrmBase
  13. {
  14. public UIM030600()
  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 queryDate = this.ultraDateTimeEditor1.Value == null ? "" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  39. string fr_wth = this.ultraTextEditor1.Text.Trim();
  40. string to_wth = this.ultraTextEditor2.Text.Trim();
  41. this.ultraGrid1.DisplayLayout.Bands[0].Columns["UnboundColumn2"].Header.Caption ="厚度"+"["+fr_wth+","+to_wth+"]";
  42. CoreClientParam ccp = new CoreClientParam();
  43. ccp.ServerName = "UIM.UIM02.UIM020010";
  44. switch (CustomInfo)
  45. {
  46. case "1":
  47. ccp.MethodName = "queryPltcmSizeDetailA";
  48. break;
  49. case "2":
  50. ccp.MethodName = "queryCalSizeDetailB";
  51. break;
  52. case "3":
  53. ccp.MethodName = "queryRclSizeDetailC";
  54. break;
  55. }
  56. ccp.ServerParams = new object[] { fr_wth, to_wth,queryDate };
  57. ccp.SourceDataTable = this.dataSet1.Tables[0];
  58. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  59. }
  60. catch (Exception EX)
  61. {
  62. MessageBox.Show(EX.ToString());
  63. }
  64. }
  65. private void DoExport()
  66. {
  67. try
  68. {
  69. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  70. {
  71. string fileName = this.saveFileDialog1.FileName;
  72. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  73. System.Diagnostics.Process.Start(fileName);
  74. }
  75. }
  76. catch (Exception EX)
  77. {
  78. MessageBox.Show(EX.ToString());
  79. }
  80. }
  81. private void ultraButton1_Click(object sender, EventArgs e)
  82. {
  83. try {
  84. this.dataSet2.Tables[0].Clear();
  85. string fr_Date = this.ultraDateTimeEditor2.Value == null ? "" : this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  86. string to_Date = this.ultraDateTimeEditor3.Value == null ? "" : this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd");
  87. string stl = this.ultraTextEditor3.Text.Trim();
  88. CoreClientParam ccp = new CoreClientParam();
  89. ccp.ServerName = "UIM.UIM02.UIM020010";
  90. switch (CustomInfo)
  91. {
  92. case "1":
  93. ccp.MethodName = "queryPltcmSizeDetailE";
  94. break;
  95. case "2":
  96. ccp.MethodName = "queryCalSizeDetailF";
  97. break;
  98. case "3":
  99. ccp.MethodName = "queryRclSizeDetailG";
  100. break;
  101. }
  102. ccp.ServerParams = new object[] { fr_Date, to_Date, stl };
  103. ccp.SourceDataTable = this.dataSet2.Tables[0];
  104. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  105. }
  106. catch (Exception o)
  107. {
  108. MessageBox.Show(o.ToString());
  109. }
  110. }
  111. private void button1_Click(object sender, EventArgs e)
  112. {
  113. try
  114. {
  115. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  116. {
  117. string fileName = this.saveFileDialog1.FileName;
  118. ultraGridExcelExporter1.Export(ultraGrid2, fileName);
  119. System.Diagnostics.Process.Start(fileName);
  120. }
  121. }
  122. catch (Exception EX)
  123. {
  124. MessageBox.Show(EX.ToString());
  125. }
  126. }
  127. }
  128. }