using Core.Mes.Client.Comm.Control;
using Core.Mes.Client.Comm.Server;
using Core.Mes.Client.Comm.Tool;
using Core.StlMes.Client.ZGMil.Common;
using Core.StlMes.Client.ZGMil.Entity;
using Core.StlMes.Client.ZGMil.ResultConrtrol;
using CoreFS.CA06;
using Infragistics.Win.UltraWinGrid;
using System;
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 FrmMilTestReport : FrmBase
{
private string departm = "";
private string plineCode = "";
private string[] plineCodes = { };
public FrmMilTestReport()
{
InitializeComponent();
this.IsLoadUserView = true;
}
///
/// 重写基类方法
///
///
///
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "Query":
doQuery();
break;
case "Export":
doExport();
break;
case "Close":
this.Close();
break;
}
}
private void doExport()
{
GridHelper.ulGridToExcel(ultraGrid1, "探伤表检报告");
}
private void doQuery()
{
string contractNO = "";
string judgeStoveNo = "";
if (chkContractNO.Checked)
{
if (uteContractNO.Text.Trim() == "")
{
contractNO = "";
}
else
{
contractNO = uteContractNO.Value.ToString();
}
}
if (chkJudgeStoveNo.Checked)
{
if (uteJudgeStoveNo.Text.Trim() == "")
{
judgeStoveNo = "";
}
else
{
judgeStoveNo = uteJudgeStoveNo.Value.ToString();
}
}
//DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmFeedSaw.queryMinResult", new Object[] { date, endDate, bc, bz, plineCode }, this.ob);
//GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
List listSource = EntityHelper.GetData(
"com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilTestReport", new object[] { contractNO, judgeStoveNo, plineCodes }, this.ob);
bindingSource1.DataSource = listSource;
GridHelper.RefreshAndAutoSize(this.ultraGrid1);
}
private void chkDate_CheckedChanged(object sender, EventArgs e)
{
if (chkContractNO.Checked) { uteContractNO.Enabled = true; } else { uteContractNO.Enabled = false; }
if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
}
///
/// 非250、258、168、460的产线代码都为空
///
///
private string getPlineCode()
{
if (plineCode.Equals("C008") || plineCode.Equals("C009") || plineCode.Equals("C010") || plineCode.Equals("C017"))
{
return plineCode;
}
else
{
return "";
}
}
private void FrmMilTestReport_Load(object sender, EventArgs e)
{
EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]);
NativeMethodNew na = new NativeMethodNew(this.ob);
departm = UserInfo.GetDepartment();
plineCode = na.GetPCode(departm);//获取 用户 对应的产线
plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
}
private void ultraRESULT_PATH_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
{
UltraGridRow row = ultraGrid1.ActiveRow;
if (e.Button.Key.ToLower().Equals("select"))
{
if (ultraGrid1.ActiveCell.Column.Key == "DetectResultPath")
{
//探伤报告
string filePath = row.GetValue("DetectResultPath") ;
dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
down.DeleteButton.Visible = false;
down.ShowDialog();
}
else if (ultraGrid1.ActiveCell.Column.Key == "FaceResultPath")
{
//表检报告
string filePath = row.GetValue("FaceResultPath");
dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
down.DeleteButton.Visible = false;
down.ShowDialog();
}
}
}
}
}