FrmInspectionReportGoDown.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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.Entity;
  5. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  6. using Core.StlMes.Client.ZGMil.Signature;
  7. using CoreFS.CA06;
  8. using Infragistics.Win.UltraWinGrid;
  9. using System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.Linq;
  16. using System.Text;
  17. using System.Windows.Forms;
  18. namespace Core.StlMes.Client.ZGMil.Report
  19. {
  20. public partial class FrmInspectionReportGoDown : FrmBase
  21. {
  22. private string departm = "";
  23. private string plineCode = "";
  24. public FrmInspectionReportGoDown()
  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. ExportData();
  43. break;
  44. case "Close":
  45. this.Close();
  46. break;
  47. }
  48. }
  49. /// <summary>
  50. /// 查询
  51. /// </summary>
  52. private void doQuery()
  53. {
  54. string JudgeStoveNo = "";
  55. string LotNo = "";
  56. string ContractNo = "";
  57. if (chkJudgeStoveNo.Checked)
  58. {
  59. if (uteJudgeStoveNo.Text.Trim() == "")
  60. {
  61. JudgeStoveNo = "";
  62. }
  63. else
  64. {
  65. JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
  66. }
  67. }
  68. if (chkLotNo.Checked)
  69. {
  70. if (uteLotNo.Text.Trim() == "")
  71. {
  72. LotNo = "";
  73. }
  74. else
  75. {
  76. LotNo = uteLotNo.Value.ToString();
  77. }
  78. }
  79. if (chkContractNo.Checked)
  80. {
  81. if (uteContractNo.Text.Trim() == "")
  82. {
  83. ContractNo = "";
  84. }
  85. else
  86. {
  87. ContractNo = uteContractNo.Value.ToString();
  88. }
  89. }
  90. List<QcmInspectionReportEntity> listSource = EntityHelper.GetData<QcmInspectionReportEntity>(
  91. "com.steering.mes.zgmil.report.FrmMilDateStatistics.InspectionReportGoDown", new object[] { JudgeStoveNo, LotNo, ContractNo }, this.ob);
  92. bindingSource1.DataSource = listSource;
  93. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  94. }
  95. /// <summary>
  96. /// 查询条件
  97. /// </summary>
  98. /// <param name="sender"></param>
  99. /// <param name="e"></param>
  100. private void chkDate_CheckedChanged(object sender, EventArgs e)
  101. {
  102. if (chkLotNo.Checked) { uteLotNo.Enabled = true; } else { uteLotNo.Enabled = false; }
  103. if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
  104. if (chkContractNo.Checked) { uteContractNo.Enabled = true; } else { uteContractNo.Enabled = false; }
  105. }
  106. private void FrmInspectionReportGoDown_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. DateTime now = DateTime.Now;
  113. DateTime date = new DateTime(now.Year, now.Month, 1);
  114. }
  115. /// <summary>
  116. /// 批量下载
  117. /// </summary>
  118. private void ExportData()
  119. {
  120. if (ultraGrid1.Selected.Rows.Count <= 0)
  121. {
  122. MessageUtil.ShowWarning("请拖选您要批量下载的探伤报告!");
  123. return;
  124. }
  125. List<string> pathList = new List<string>();
  126. foreach (UltraGridRow uRow in ultraGrid1.Selected.Rows)
  127. {
  128. if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
  129. {
  130. string filePathOld = uRow.GetValue("DetectResultPath");
  131. if (filePathOld != "")
  132. pathList.Add(filePathOld);
  133. }
  134. }
  135. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, pathList);
  136. down.DeleteButton.Visible = false;
  137. down.ShowDialog();
  138. //打开下载后的文件夹
  139. if (down.Pic != "")
  140. System.Diagnostics.Process.Start("Explorer.exe", down.Pic);
  141. }
  142. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  143. {
  144. UltraGridRow row = ultraGrid1.ActiveRow;
  145. if (e.Button.Key.ToLower().Equals("select"))
  146. {
  147. string filePath = row.GetValue("DetectResultPath");
  148. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
  149. down.DeleteButton.Visible = false;
  150. down.ShowDialog();
  151. }
  152. }
  153. }
  154. }