FrmInputOutputStatement.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.StlMes.Client.ZGMil.Common;
  4. using Core.StlMes.Client.ZGMil.Entity;
  5. using CoreFS.CA06;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Windows.Forms;
  14. namespace Core.StlMes.Client.ZGMil.Report
  15. {
  16. public partial class FrmInputOutputStatement : FrmBase
  17. {
  18. private string departm = "";
  19. private string plineCode = "";
  20. private string[] plineCodes = { };
  21. public FrmInputOutputStatement()
  22. {
  23. InitializeComponent();
  24. this.IsLoadUserView = true;
  25. }
  26. private void FrmInputOutputStatement_Load(object sender, EventArgs e)
  27. {
  28. NativeMethodNew na = new NativeMethodNew(this.ob);
  29. departm = UserInfo.GetDepartment();
  30. plineCode = na.GetPCode(departm);//获取 用户 对应的产线
  31. plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
  32. DateTime now = DateTime.Now;
  33. DateTime date = new DateTime(now.Year, now.Month, 1);
  34. }
  35. /// <summary>
  36. /// 重写基类方法
  37. /// </summary>
  38. /// <param name="sender"></param>
  39. /// <param name="ToolbarKey"></param>
  40. public override void ToolBar_Click(object sender, string ToolbarKey)
  41. {
  42. switch (ToolbarKey)
  43. {
  44. case "Query":
  45. doQuery();
  46. break;
  47. case "Export":
  48. ExportData();
  49. break;
  50. case "Close":
  51. this.Close();
  52. break;
  53. }
  54. }
  55. /// <summary>
  56. /// 查询
  57. /// </summary>
  58. private void doQuery()
  59. {
  60. //string date = "";
  61. //string endDate = "";
  62. string JudgeStoveNo = "";
  63. string LotNo = "";
  64. string barYearMonth = "";
  65. //string ContractNo = "";
  66. if (chkJudgeStoveNo.Checked)
  67. {
  68. if (uteJudgeStoveNo.Text.Trim() == "")
  69. {
  70. JudgeStoveNo = "";
  71. }
  72. else
  73. {
  74. JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
  75. }
  76. }
  77. if (chkLotNo.Checked)
  78. {
  79. if (uteLotNo.Text.Trim() == "")
  80. {
  81. LotNo = "";
  82. }
  83. else
  84. {
  85. LotNo = uteLotNo.Value.ToString();
  86. }
  87. }
  88. if (chkBalYearMonth.Checked)
  89. {
  90. if (BAL_YEAR_MONTH.Text.Trim() == "")
  91. {
  92. barYearMonth = "";
  93. }
  94. else
  95. {
  96. barYearMonth = BAL_YEAR_MONTH.Value.ToString("yyyyMM");
  97. }
  98. }
  99. WaitingForm2 wf = new WaitingForm2("正在加载,请稍候....");
  100. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getInputOutputStatement", new Object[] { JudgeStoveNo, LotNo, plineCodes, barYearMonth }, this.ob);
  101. GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
  102. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  103. wf.Close();
  104. }
  105. /// <summary>
  106. /// 导出
  107. /// </summary>
  108. private void ExportData()
  109. {
  110. GridHelper.ulGridToExcel(ultraGrid1, "轧管投入产出报表");
  111. }
  112. /// <summary>
  113. /// 非250、258、168、460的产线代码都为空
  114. /// </summary>
  115. /// <returns></returns>
  116. private string getPlineCode()
  117. {
  118. if (plineCode.Equals("C008") || plineCode.Equals("C009") || plineCode.Equals("C010") || plineCode.Equals("C017"))
  119. {
  120. return plineCode;
  121. }
  122. else
  123. {
  124. return "";
  125. }
  126. }
  127. /// <summary>
  128. /// 查询条件
  129. /// </summary>
  130. /// <param name="sender"></param>
  131. /// <param name="e"></param>
  132. private void chkDate_CheckedChanged(object sender, EventArgs e)
  133. {
  134. if (chkBalYearMonth.Checked) { BAL_YEAR_MONTH.Enabled = true; } else { BAL_YEAR_MONTH.Enabled = false; }
  135. if (chkLotNo.Checked) { uteLotNo.Enabled = true; } else { uteLotNo.Enabled = false; }
  136. if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
  137. }
  138. }
  139. }