QCM0106.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. namespace Core.LZMes.Client.QCM
  13. {
  14. public partial class QCM0106 : FrmBase
  15. {
  16. public QCM0106()
  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. }
  28. }
  29. private void DoQuery()
  30. {
  31. //查询
  32. try
  33. {
  34. this.dataSet1.Clear();
  35. string starttime = "";
  36. string endtime = "";
  37. if (checkBox2.Checked)
  38. {
  39. starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
  40. endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
  41. }
  42. string sbatchno = "";
  43. string ebatchno = "";
  44. if (checkBox3.Checked)
  45. {
  46. sbatchno = this.textBox1.Text.Trim();
  47. if (textBox2.Text.ToString() == "")
  48. {
  49. ebatchno = this.textBox1.Text.Trim();
  50. }
  51. else
  52. {
  53. ebatchno = this.textBox2.Text.Trim();
  54. }
  55. }
  56. if (!checkBox2.Checked && !checkBox3.Checked)
  57. {
  58. MessageBox.Show("时间与轧批号必须选择其中一个条件!");
  59. return;
  60. }
  61. string prod_line = "";
  62. if (this.comboBox3.Text.ToString() == "热连轧")
  63. {
  64. prod_line = "RZ1";
  65. }
  66. else if (this.comboBox3.Text.ToString() == "连退")
  67. {
  68. prod_line = "LT1";
  69. }
  70. else if (this.comboBox3.Text.ToString() == "酸轧")
  71. {
  72. prod_line = "SZ1";
  73. }
  74. else if (this.comboBox3.Text.ToString() == "中板线")
  75. {
  76. prod_line = "ZB1";
  77. }
  78. else if (this.comboBox3.Text.ToString() == "厚板线")
  79. {
  80. prod_line = "HB1";
  81. }
  82. else if (this.comboBox3.Text.ToString() == "高棒")
  83. {
  84. prod_line = "GX1";
  85. }
  86. else if (this.comboBox3.Text.ToString() == "高线")
  87. {
  88. prod_line = "GX2";
  89. }
  90. else if (this.comboBox3.Text.ToString() == "棒二")
  91. {
  92. prod_line = "BC2";
  93. }
  94. CoreClientParam ccp = new CoreClientParam();
  95. ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
  96. ccp.MethodName = "Query";
  97. ccp.ServerParams = new object[] { starttime, endtime, prod_line, sbatchno, ebatchno };
  98. ccp.SourceDataTable = this.dataSet1.Tables[0];
  99. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  100. }
  101. catch (Exception ex)
  102. {
  103. System.Diagnostics.Debug.WriteLine(ex.ToString());
  104. }
  105. }
  106. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  107. {
  108. }
  109. }
  110. }