| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.ZGMil.Entity;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Signature;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.ZGMil.Report
- {
- public partial class FrmInspectionReportGoDown : FrmBase
- {
- private string departm = "";
- private string plineCode = "";
- public FrmInspectionReportGoDown()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQuery();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void doQuery()
- {
- string JudgeStoveNo = "";
- string LotNo = "";
- string ContractNo = "";
- if (chkJudgeStoveNo.Checked)
- {
- if (uteJudgeStoveNo.Text.Trim() == "")
- {
- JudgeStoveNo = "";
- }
- else
- {
- JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
- }
- }
- if (chkLotNo.Checked)
- {
- if (uteLotNo.Text.Trim() == "")
- {
- LotNo = "";
- }
- else
- {
- LotNo = uteLotNo.Value.ToString();
- }
- }
- if (chkContractNo.Checked)
- {
- if (uteContractNo.Text.Trim() == "")
- {
- ContractNo = "";
- }
- else
- {
- ContractNo = uteContractNo.Value.ToString();
- }
- }
- List<QcmInspectionReportEntity> listSource = EntityHelper.GetData<QcmInspectionReportEntity>(
- "com.steering.mes.zgmil.report.FrmMilDateStatistics.InspectionReportGoDown", new object[] { JudgeStoveNo, LotNo, ContractNo }, this.ob);
- bindingSource1.DataSource = listSource;
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- }
- /// <summary>
- /// 查询条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- if (chkLotNo.Checked) { uteLotNo.Enabled = true; } else { uteLotNo.Enabled = false; }
- if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
- if (chkContractNo.Checked) { uteContractNo.Enabled = true; } else { uteContractNo.Enabled = false; }
- }
- private void FrmInspectionReportGoDown_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<QcmInspectionReportEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- departm = UserInfo.GetDepartment();
- plineCode = na.GetPCode(departm);//获取 用户 对应的产线
- DateTime now = DateTime.Now;
- DateTime date = new DateTime(now.Year, now.Month, 1);
-
- }
- /// <summary>
- /// 批量下载
- /// </summary>
- private void ExportData()
- {
- if (ultraGrid1.Selected.Rows.Count <= 0)
- {
- MessageUtil.ShowWarning("请拖选您要批量下载的探伤报告!");
- return;
- }
- List<string> pathList = new List<string>();
- foreach (UltraGridRow uRow in ultraGrid1.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- string filePathOld = uRow.GetValue("DetectResultPath");
- if (filePathOld != "")
- pathList.Add(filePathOld);
- }
- }
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, pathList);
- down.DeleteButton.Visible = false;
- down.ShowDialog();
- //打开下载后的文件夹
- if (down.Pic != "")
- System.Diagnostics.Process.Start("Explorer.exe", down.Pic);
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (e.Button.Key.ToLower().Equals("select"))
- {
- string filePath = row.GetValue("DetectResultPath");
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
- down.DeleteButton.Visible = false;
- down.ShowDialog();
- }
- }
-
- }
- }
|