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;
}
///
/// 重写基类方法
///
///
///
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "Query":
doQuery();
break;
case "Export":
ExportData();
break;
case "Close":
this.Close();
break;
}
}
///
/// 查询
///
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 listSource = EntityHelper.GetData(
"com.steering.mes.zgmil.report.FrmMilDateStatistics.InspectionReportGoDown", new object[] { JudgeStoveNo, LotNo, ContractNo }, this.ob);
bindingSource1.DataSource = listSource;
GridHelper.RefreshAndAutoSize(this.ultraGrid1);
}
///
/// 查询条件
///
///
///
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(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);
}
///
/// 批量下载
///
private void ExportData()
{
if (ultraGrid1.Selected.Rows.Count <= 0)
{
MessageUtil.ShowWarning("请拖选您要批量下载的探伤报告!");
return;
}
List pathList = new List();
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();
}
}
}
}