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 CoreFS.CA06; 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 RepMilGodownData : FrmBase { private string departm = ""; private string deptid = ""; private string plineCode = ""; private string[] plineCodes = { }; public RepMilGodownData() { InitializeComponent(); this.IsLoadUserView = true; } private void RepMilGodownData_Load(object sender, EventArgs e) { cmbDate.Value = DateTime.Parse(DateTime.Today.ToString()); NativeMethodNew na = new NativeMethodNew(this.ob); departm = UserInfo.GetDepartment(); deptid = UserInfo.GetDeptid(); plineCode = na.GetPCode(departm);//获取 用户 对应的产线 plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob); DateTime now = DateTime.Now; DateTime date = new DateTime(now.Year, now.Month, 1); cmbDate.Value = DateTime.Parse(date.ToString("yyyy-MM-dd HH:mm:ss")); cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); } /// /// 非250、258、168、460的产线代码都为空 /// /// private string getPlineCode() { if (plineCode.Equals("C008") || plineCode.Equals("C009") || plineCode.Equals("C010") || plineCode.Equals("C017")) { return plineCode; } else { return ""; } } /// /// 重写基类方法 /// /// /// 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 ExportData() { GridHelper.ulGridToExcel(ultraGrid1, "入库单信息"); } /// /// 查询 /// private void doQuery() { string date = ""; string endDate = ""; string JudgeStoveNo = ""; string LotNo = ""; string contractNo = ""; if (chkDate.Checked) { if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0) { MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!"); return; } else { date = cmbDate.Value.ToString(); endDate = cmbEndDate.Value.ToString(); } } if (chkJudgeStoveNo.Checked) { if (uteJudgeStoveNo.Text.Trim() == "") { JudgeStoveNo = ""; } else { JudgeStoveNo = uteJudgeStoveNo.Text.ToString(); } } if (chkLotNo.Checked) { if (uteLotNo.Text.Trim() == "") { LotNo = ""; } else { LotNo = uteLotNo.Value.ToString(); } } if (ContractNo.Checked) { if (uteContractNo.Text.Trim() == "") { contractNo = ""; } else { contractNo = uteContractNo.Value.ToString(); } } WaitingForm2 wf = new WaitingForm2("正在加载,请稍候...."); DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilGodownData", new Object[] { date, endDate, JudgeStoveNo, LotNo, contractNo, plineCodes, deptid }, this.ob); GridHelper.CopyDataToDatatable(dt, this.dataTable1, true); GridHelper.RefreshAndAutoSize(this.ultraGrid1); wf.Close(); } /// /// 查询条件 /// /// /// private void chkDate_CheckedChanged(object sender, EventArgs e) { if (chkDate.Checked) { cmbDate.Enabled = true; cmbEndDate.Enabled = true; } else { cmbDate.Enabled = false; cmbEndDate.Enabled = false; } if (chkLotNo.Checked) { uteLotNo.Enabled = true; } else { uteLotNo.Enabled = false; } if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; } if (ContractNo.Checked) { uteContractNo.Enabled = true; } else { uteContractNo.Enabled = false; } } } }