| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866 |
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- 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 Infragistics.Win;
- 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 FrmMilDateStatistics2 : FrmBase
- {
- private string departm = "";
- private string plineCode = "";
- private string[] plineCodes = { };
- public FrmMilDateStatistics2()
- {
- 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"CloseMilPlan":
- closeMilPlan();
- break;
- case "CancelCloseMilPlan":
- cancelCloseMilPlan();
- break;
- case "Refresh":
- doRefresh();
- break;
- case "Print":
- doPrint();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 刷新
- /// </summary>
- private void doRefresh()
- {
- this.ultraGrid3.UpdateData();
- IQueryable<UltraGridRow> checkMag = this.ultraGrid3.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMag.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要关闭的炉计划信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMag)
- {
- MilProcessesEntity milProsess = (MilProcessesEntity)uRow.ListObject;
- string milProcessTity = JSONFormat.Format(milProsess);
- parm.Add(milProcessTity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics";
- ccp.MethodName = "doRefresh";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("刷新成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 关闭炉计划
- /// </summary>
- private void closeMilPlan()
- {
- this.ultraGrid3.UpdateData();
- IQueryable<UltraGridRow> checkMag = this.ultraGrid3.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMag.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要关闭的炉计划信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach(UltraGridRow uRow in checkMag)
- {
- MilProcessesEntity milProsess = (MilProcessesEntity)uRow.ListObject;
- string milProcessTity = JSONFormat.Format(milProsess);
- parm.Add(milProcessTity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics";
- ccp.MethodName = "closeMilPlan";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("关闭炉计划成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销关闭炉计划
- /// </summary>
- private void cancelCloseMilPlan()
- {
- this.ultraGrid3.UpdateData();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid3.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销关闭的炉计划信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMags)
- {
- MilProcessesEntity milProsess = (MilProcessesEntity)uRow.ListObject;
- string milProcessTity = JSONFormat.Format(milProsess);
- parm.Add(milProcessTity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics";
- ccp.MethodName = "cancelCloseMilPlan";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
-
- /// <summary>
- /// 进程表数据查询
- /// </summary>
- private void doQueryMilDateStatisticsBatchSample()
- {
- string date = "";
- string endDate = "";
- string JudgeStoveNo = "";
- string LotNo = "";
- string ContractNo = "";
- string PlineCode = "";
- int n = 0;
- 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();
- }
- n += 1;
- }
- if (chkJudgeStoveNo.Checked)
- {
- if (uteJudgeStoveNo.Text.Trim() == "")
- {
- JudgeStoveNo = "";
- }
- else
- {
- JudgeStoveNo = uteJudgeStoveNo.Text.Trim().ToString();
- }
- n += 1;
- }
- if (chkLotNo.Checked)
- {
- if (uteLotNo.Text.Trim() == "")
- {
- LotNo = "";
- }
- else
- {
- LotNo = uteLotNo.Text.Trim().ToString();
- }
- n += 1;
- }
- if (chkContractNo.Checked)
- {
- if (uteContractNo.Text.Trim() == "")
- {
- ContractNo = "";
- }
- else
- {
- ContractNo = uteContractNo.Text.Trim().ToString();
- }
- n += 1;
- }
- if (chkPlineCode.Checked)
- {
- if (cobPlineCode.Text.Trim() == "")
- {
- PlineCode = "";
- }
- else
- {
- PlineCode = cobPlineCode.Value.ToString();
- }
- n += 1;
- }
- if (n == 0)
- {
- MessageUtil.ShowTips("请您选择至少一个查询条件,否则会查不到数据!");
- return;
- }
- WaitingForm2 wf = new WaitingForm2("正在加载,请稍候....");
- try
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilDateStatisticsBatchSample", new Object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, plineCodes, PlineCode }, this.ob);
- GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- //数据处理
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- //结炉验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 离线支 + 返线支 - 下线【实时】支
- int a = Int32.Parse(ugr.Cells["YJZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["undeterminedNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["ScrapNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) + Int32.Parse(ugr.Cells["FXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["HGZ12"].Value.ToString3());
- if (a == 0)
- {
- ugr.Cells["Verify"].Value = "可结炉";
- }
- else
- {
- ugr.Cells["Verify"].Value = "不可结炉";
- }
- //平衡验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 离线支 + 返线支 - 下线支【结炉】
- int b = Int32.Parse(ugr.Cells["YJZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["undeterminedNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["ScrapNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) + Int32.Parse(ugr.Cells["FXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["XXZ"].Value.ToString3());
- //离线待处理支:离线支 - 返线支 - 组炉支 - 委外废品支
- int c = Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["FXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["ZLZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["WWFPZ"].Value.ToString3());
- if (Int32.Parse(ugr.Cells["XXZ"].Value.ToString3()) > 0)
- {
- if (b == 0) { ugr.Cells["PH"].Value = "OK"; }
- else
- {
- if (Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) == 0)
- {
- ugr.Cells["PH"].Value = "清线不齐";
- }
- else
- {
- if (c != 0)
- {
- if (b > 0)
- {
- ugr.Cells["PH"].Value = "清线不齐";
- }
- else
- {
- ugr.Cells["PH"].Value = "返线不齐";
- }
- }
- else
- {
- ugr.Cells["PH"].Value = "清线不齐";
- }
- }
- }
- }
- else
- {
- ugr.Cells["PH"].Value = "无";
- }
- //重量差
- ugr.Cells["ZLC"].Value = double.Parse(ugr.Cells["YJD"].Value.ToString3()) - double.Parse(ugr.Cells["XXD"].Value.ToString3());
- if (ugr.Cells["PH"].Value.ToString().Contains("线不齐"))
- {
- ugr.Appearance.BackColor = Color.IndianRed;
- }
- if (ugr.Cells["NODE_STATUS1"].Value.ToString() != "下线")
- {
- ugr.Appearance.BackColor = Color.SkyBlue;
- }
- }
- wf.Close();
- }
- catch
- {
- }
- finally {
- wf.Close();
- }
- }
- /// <summary>
- /// 静态进程表查询
- /// </summary>
- private void doQueryMilDateStatisticsBatchSampleNew()
- {
- string date = "";
- string endDate = "";
- string JudgeStoveNo = "";
- string LotNo = "";
- string ContractNo = "";
- string PlineCode = "";
- int n = 0;
- if (chkDate1.Checked)
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate1.Value.ToString()), DateTime.Parse(cmbEndDate1.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
- return;
- }
- else
- {
- date = cmbDate1.Value.ToString();
- endDate = cmbEndDate1.Value.ToString();
- }
- n += 1;
- }
- if (chkJudgeStoveNo1.Checked)
- {
- if (uteJudgeStoveNo1.Text.Trim() == "")
- {
- JudgeStoveNo = "";
- }
- else
- {
- JudgeStoveNo = uteJudgeStoveNo1.Text.Trim().ToString();
- }
- n += 1;
- }
- if (chkLotNo1.Checked)
- {
- if (uteLotNo1.Text.Trim() == "")
- {
- LotNo = "";
- }
- else
- {
- LotNo = uteLotNo1.Text.Trim().ToString();
- }
- n += 1;
- }
- if (chkContractNo1.Checked)
- {
- if (uteContractNo1.Text.Trim() == "")
- {
- ContractNo = "";
- }
- else
- {
- ContractNo = uteContractNo1.Text.Trim().ToString();
- }
- n += 1;
- }
- if (chkPlineCode2.Checked)
- {
- if (cobPlineCode2.Text.Trim() == "")
- {
- PlineCode = "";
- }
- else
- {
- PlineCode = cobPlineCode2.Value.ToString();
- }
- n += 1;
- }
- if (n == 0)
- {
- MessageUtil.ShowTips("请您选择至少一个查询条件,否则会查不到数据!");
- return;
- }
- WaitingForm2 wf = new WaitingForm2("正在加载,请稍候....");
- try
- {
- List<MilProcessesEntity> listSource = EntityHelper.GetData<MilProcessesEntity>(
- "com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilDateStatisticsBatchSampleNew", new object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, plineCodes, PlineCode }, this.ob);
- MilProcessesEntitybindingSource.DataSource = listSource;
- //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilDateStatisticsBatchSample", new Object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, getPlineCode() }, this.ob);
- //GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
- //GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- //数据处理
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- //结炉验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 委外废品支 - 离线支 + 返线支 - 下线【实时】支
- int a = Int32.Parse(ugr.Cells["Yjz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Undeterminednum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Scrapnum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Wwfpz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) + Int32.Parse(ugr.Cells["Fxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Hgz12"].Value.ToString3());
- if (a == 0)
- {
- ugr.Cells["Verify"].Value = "可结炉";
- }
- else
- {
- ugr.Cells["Verify"].Value = "不可结炉";
- }
- //平衡验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 委外废品支 - 离线支 + 返线支 - 下线支【结炉】
- int b = Int32.Parse(ugr.Cells["Yjz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Undeterminednum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Scrapnum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Wwfpz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) + Int32.Parse(ugr.Cells["Fxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Hgz12"].Value.ToString3());
- //离线待处理支:离线支 - 返线支 - 组炉支
- int c = Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Fxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Zlz"].Value.ToString3());
- if (Int32.Parse(ugr.Cells["Hgz12"].Value.ToString3()) > 0)
- {
- if (b == 0) { ugr.Cells["Ph"].Value = "OK"; }
- else
- {
- if (Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) == 0)
- {
- ugr.Cells["Ph"].Value = "清线不齐";
- }
- else
- {
- if (c != 0)
- {
- if (b > 0)
- {
- ugr.Cells["Ph"].Value = "清线不齐";
- }
- else
- {
- ugr.Cells["Ph"].Value = "返线不齐";
- }
- }
- else
- {
- ugr.Cells["Ph"].Value = "清线不齐";
- }
- }
- }
- }
- else
- {
- ugr.Cells["Ph"].Value = "无";
- }
- //重量差
- //ugr.Cells["ZLC"].Value = double.Parse(ugr.Cells["YJD"].Value.ToString3()) - double.Parse(ugr.Cells["XXD"].Value.ToString3());
- if (ugr.Cells["Ph"].Value.ToString().Contains("线不齐"))
- {
- ugr.Appearance.BackColor = Color.IndianRed;
- }
- if (ugr.Cells["NodeStatus1"].Value.ToString() != "下线")
- {
- ugr.Appearance.BackColor = Color.SkyBlue;
- }
- }
- wf.Close();
- }
- catch
- {
- }
- finally
- {
- wf.Close();
- }
- }
- /// <summary>
- /// 组炉数据查询
- /// </summary>
- private void doQueryFurnace()
- {
- string ZpJudgeStoveNo = "";
- string ZpLotNo = "";
- string OldJudgeStoveNo = "";
- string ph = "";
- string date = "";
- string endDate = "";
- if (ultraCheckEditor2.Checked)
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(dateTimePicker1.Value.ToString()), DateTime.Parse(dateTimePicker2.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
- return;
- }
- else
- {
- date = dateTimePicker1.Value.ToString();
- endDate = dateTimePicker2.Value.ToString();
- }
-
- }
- if (chkZpJudgeStoveNo.Checked)
- {
- if (uteZpJudgeStoveNo.Text.Trim() == "")
- {
- ZpJudgeStoveNo = "";
- }
- else
- {
- ZpJudgeStoveNo = uteZpJudgeStoveNo.Value.ToString();
- }
- }
- if (chkZpLotNo.Checked)
- {
- if (uteZpLotNo.Text.Trim() == "")
- {
- ZpLotNo = "";
- }
- else
- {
- ZpLotNo = uteZpLotNo.Value.ToString();
- }
- }
- if (chkOldJudgeStoveNo.Checked)
- {
- if (uteOldJudgeStoveNo.Text.Trim() == "")
- {
- OldJudgeStoveNo = "";
- }
- else
- {
- OldJudgeStoveNo = uteOldJudgeStoveNo.Value.ToString();
- }
- }
- if (ultraCheckEditor1.Checked)
- {
- if (ultraComboEditor1.Value.Equals("0"))
- {
- ph = "OK";
- }
- else if (ultraComboEditor1.Value.Equals("1"))
- {
- ph = "清线不齐";
- }
- }
- WaitingForm2 wf = new WaitingForm2("正在加载,请稍候....");
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilOfflineGroup", new Object[] { date, endDate, ZpJudgeStoveNo, ZpLotNo, plineCodes, OldJudgeStoveNo, ph }, this.ob);
- GridHelper.CopyDataToDatatable(dt, this.dataTable2, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid2);
- wf.Close();
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void doQuery()
- {
- if (this.ultraTabControl1.Tabs[0].Active)
- {
- doQueryMilDateStatisticsBatchSample();
- }
- else if (this.ultraTabControl1.Tabs[1].Active)
- {
- doQueryFurnace();
- }else if(this.ultraTabControl1.Tabs[2].Active)
- {
- doQueryMilDateStatisticsBatchSampleNew();
- }
- }
-
-
- /// <summary>
- /// 打印
- /// </summary>
- private void doPrint()
- {
- 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.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();
- }
- }
- doQuery();
- string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilDateStatistics.cpt&__bypagesize__=false&LOT_NO=" + LotNo + "&JUDGE_STOVE_NO=" + JudgeStoveNo + "&DATE=" + date + "&DATE2=" + endDate + "&PLINE_CODE=" + plineCode + "&CONTRACT_NO=" + ContractNo;
- FrmRepExcel fre = new FrmRepExcel(this.ob, url);
- //fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.Text = "轧管生产数据统计";
- fre.ShowDialog();
- }
- /// <summary>
- /// 查询条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- if (chkDate.Checked) { cmbDate.Enabled = true; } else { cmbDate.Enabled = false; }
- if (chkDate.Checked) { cmbEndDate.Enabled = true; } else { cmbEndDate.Enabled = false; }
- 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; }
- if (chkOldJudgeStoveNo.Checked) { uteOldJudgeStoveNo.Enabled = true; } else { uteOldJudgeStoveNo.Enabled = false; }
- if (chkZpJudgeStoveNo.Checked) { uteZpJudgeStoveNo.Enabled = true; } else { uteZpJudgeStoveNo.Enabled = false; }
- if (chkZpLotNo.Checked) { uteZpLotNo.Enabled = true; } else { uteZpLotNo.Enabled = false; }
- if (ultraCheckEditor1.Checked) { ultraComboEditor1.Enabled = true; } else { ultraComboEditor1.Enabled = false; }
- if (ultraCheckEditor2.Checked) { dateTimePicker1.Enabled = true; } else { dateTimePicker1.Enabled = false; }
- if (ultraCheckEditor2.Checked) { dateTimePicker2.Enabled = true; } else { dateTimePicker2.Enabled = false; }
- if (chkPlineCode.Checked) { cobPlineCode.Enabled = true; } else { cobPlineCode.Enabled = false; }
- if (chkPlineCode2.Checked) { cobPlineCode2.Enabled = true; } else { cobPlineCode2.Enabled = false; }
- }
- private void chkDate1_CheckedChanged(object sender, EventArgs e)
- {
- this.cmbDate1.Enabled = this.cmbEndDate1.Enabled = chkDate1.Checked;
- }
- private void FrmMilDateStatistics2_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<MilProcessesEntity>(ultraGrid3.DisplayLayout.Bands[0]);
- cmbDate.Value = DateTime.Parse(DateTime.Today.ToString());
- cmbDate1.Value = DateTime.Parse(DateTime.Today.ToString());
- NativeMethodNew na = new NativeMethodNew(this.ob);
- departm = UserInfo.GetDepartment();
- 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 07:00"));
- cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
- cmbDate1.Value = DateTime.Parse(date.ToString("yyyy-MM-dd 07:00"));
- cmbEndDate1.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
- dateTimePicker1.Value = DateTime.Parse(date.ToString("yyyy-MM-dd 07:00"));
- dateTimePicker2.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
- //加载产线
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getPlineNameZG", new object[] { plineCodes }, ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- cobPlineCode.DataSource = dt;
- cobPlineCode.ValueMember = "PLINE_CODE";
- cobPlineCode.DisplayMember = "PLINE_NAME";
- cobPlineCode2.DataSource = dt;
- cobPlineCode2.ValueMember = "PLINE_CODE";
- cobPlineCode2.DisplayMember = "PLINE_NAME";
- }
-
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- if (this.ultraTabControl1.Tabs[0].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid1, "轧管生产数据汇总");
- }
- else if (this.ultraTabControl1.Tabs[1].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid2, "组炉数据");
- }
- else if (this.ultraTabControl1.Tabs[2].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid3, "轧管生产数据汇总");
- }
-
- }
- /// <summary>
- /// 非250、258、168、460的产线代码都为空
- /// </summary>
- /// <returns></returns>
- private string getPlineCode()
- {
- if (plineCode.Equals("C008") || plineCode.Equals("C009") || plineCode.Equals("C010") || plineCode.Equals("C017"))
- {
- return plineCode;
- }
- else
- {
- return "";
- }
- }
- private void chkLotNo1_CheckedChanged(object sender, EventArgs e)
- {
- this.uteLotNo1.Enabled = chkLotNo1.Checked;
- }
- private void chkJudgeStoveNo1_CheckedChanged(object sender, EventArgs e)
- {
- this.uteJudgeStoveNo1.Enabled = chkJudgeStoveNo1.Checked;
- }
- private void chkContractNo1_CheckedChanged(object sender, EventArgs e)
- {
- this.uteContractNo1.Enabled = chkContractNo1.Checked;
- }
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (toolMenu == null) return;
- if (this.ultraTabControl1.Tabs[0].Active)
- {
- if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Refresh"))
- {
- toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- }
- else if (this.ultraTabControl1.Tabs[1].Active)
- {
- if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Refresh"))
- {
- toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- }
- else
- {
- if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Refresh"))
- {
- toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.True;
- }
- }
- }
- private void FrmMilDateStatistics2_Shown(object sender, EventArgs e)
- {
- if (toolMenu == null) return;
- if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan"))
- {
- toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- if (toolMenu.Toolbars[0].Tools.Exists("Refresh"))
- {
- toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.False;
- }
- }
-
- }
- }
|