FrmMilTestReport.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.ZGMil.Common;
  5. using Core.StlMes.Client.ZGMil.Entity;
  6. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  7. using CoreFS.CA06;
  8. using Infragistics.Win.UltraWinGrid;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. namespace Core.StlMes.Client.ZGMil.Report
  18. {
  19. public partial class FrmMilTestReport : FrmBase
  20. {
  21. private string departm = "";
  22. private string plineCode = "";
  23. private string[] plineCodes = { };
  24. public FrmMilTestReport()
  25. {
  26. InitializeComponent();
  27. this.IsLoadUserView = true;
  28. }
  29. /// <summary>
  30. /// 重写基类方法
  31. /// </summary>
  32. /// <param name="sender"></param>
  33. /// <param name="ToolbarKey"></param>
  34. public override void ToolBar_Click(object sender, string ToolbarKey)
  35. {
  36. switch (ToolbarKey)
  37. {
  38. case "Query":
  39. doQuery();
  40. break;
  41. case "Export":
  42. doExport();
  43. break;
  44. case "Close":
  45. this.Close();
  46. break;
  47. }
  48. }
  49. private void doExport()
  50. {
  51. GridHelper.ulGridToExcel(ultraGrid1, "探伤表检报告");
  52. }
  53. private void doQuery()
  54. {
  55. string contractNO = "";
  56. string judgeStoveNo = "";
  57. if (chkContractNO.Checked)
  58. {
  59. if (uteContractNO.Text.Trim() == "")
  60. {
  61. contractNO = "";
  62. }
  63. else
  64. {
  65. contractNO = uteContractNO.Value.ToString();
  66. }
  67. }
  68. if (chkJudgeStoveNo.Checked)
  69. {
  70. if (uteJudgeStoveNo.Text.Trim() == "")
  71. {
  72. judgeStoveNo = "";
  73. }
  74. else
  75. {
  76. judgeStoveNo = uteJudgeStoveNo.Value.ToString();
  77. }
  78. }
  79. //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmFeedSaw.queryMinResult", new Object[] { date, endDate, bc, bz, plineCode }, this.ob);
  80. //GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
  81. List<QcmInspectionReportEntity> listSource = EntityHelper.GetData<QcmInspectionReportEntity>(
  82. "com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilTestReport", new object[] { contractNO, judgeStoveNo, plineCodes }, this.ob);
  83. bindingSource1.DataSource = listSource;
  84. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  85. }
  86. private void chkDate_CheckedChanged(object sender, EventArgs e)
  87. {
  88. if (chkContractNO.Checked) { uteContractNO.Enabled = true; } else { uteContractNO.Enabled = false; }
  89. if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
  90. }
  91. /// <summary>
  92. /// 非250、258、168、460的产线代码都为空
  93. /// </summary>
  94. /// <returns></returns>
  95. private string getPlineCode()
  96. {
  97. if (plineCode.Equals("C008") || plineCode.Equals("C009") || plineCode.Equals("C010") || plineCode.Equals("C017"))
  98. {
  99. return plineCode;
  100. }
  101. else
  102. {
  103. return "";
  104. }
  105. }
  106. private void FrmMilTestReport_Load(object sender, EventArgs e)
  107. {
  108. EntityHelper.ShowGridCaption<QcmInspectionReportEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  109. NativeMethodNew na = new NativeMethodNew(this.ob);
  110. departm = UserInfo.GetDepartment();
  111. plineCode = na.GetPCode(departm);//获取 用户 对应的产线
  112. plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
  113. }
  114. private void ultraRESULT_PATH_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  115. {
  116. UltraGridRow row = ultraGrid1.ActiveRow;
  117. if (e.Button.Key.ToLower().Equals("select"))
  118. {
  119. if (ultraGrid1.ActiveCell.Column.Key == "DetectResultPath")
  120. {
  121. //探伤报告
  122. string filePath = row.GetValue("DetectResultPath") ;
  123. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
  124. down.DeleteButton.Visible = false;
  125. down.ShowDialog();
  126. }
  127. else if (ultraGrid1.ActiveCell.Column.Key == "FaceResultPath")
  128. {
  129. //表检报告
  130. string filePath = row.GetValue("FaceResultPath");
  131. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
  132. down.DeleteButton.Visible = false;
  133. down.ShowDialog();
  134. }
  135. }
  136. }
  137. }
  138. }