| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- 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 FrmMilDateWaitingDecision : FrmBase
- {
- private string departm = "";
- private string plineCode = "";
- public FrmMilDateWaitingDecision()
- {
- 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 "Save":
- doSave();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void doSave()
- {
- ultraGrid1.UpdateData();
- ArrayList parm = new ArrayList();
- IQueryable<UltraGridRow> uGrid = ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (uGrid.Count() == 0)
- {
- MessageUtil.ShowTips("请选择要保存的数据!");
- return;
- }
- foreach (UltraGridRow uRow in uGrid)
- {
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["WAITING_DECISION_MEMO"].Value.ToString());
- list.Add(uRow.Cells["AGAIN_MEMO"].Value.ToString());
- list.Add(uRow.Cells["IS_VISIBLE"].Value.ToString());
- list.Add(uRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
- list.Add(uRow.Cells["PRO_PLAN_ID"].Value.ToString());
- list.Add(uRow.Cells["GX_PLAN_NO"].Value.ToString());
- parm.Add(list);
- }
- int count = ServerHelper.SetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.saveMilDateWaitingDecision", new object[] { parm }, this.ob);
- MessageUtil.ShowTips("保存成功!");
- doQuery();
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void doQuery()
- {
-
- string date = "";
- string endDate = "";
- string JudgeStoveNo = "";
- string LotNo = "";
- string ContractNo = "";
- string plineCode = "";
- string VALIDFLAG = "";
- string IsVisible = "";
- 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();
- }
- }
- if (chkPlineCode.Checked)
- {
- plineCode = cobPlineCode.Value.ToString();
- }
- if (chkVALIDFLAG.Checked)
- {
- VALIDFLAG = cobVALIDFLAG.Value.ToString();
- }
- if (chkIsVisible.Checked)
- {
- IsVisible = cobIsVisible.Value.ToString();
- }
- WaitingForm2 wf = new WaitingForm2("正在加载,请稍候....");
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getFrmMilDateWaitingDecision", new Object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, plineCode, VALIDFLAG, IsVisible }, this.ob);
- GridHelper.CopyDataToDatatable(dt, this.dataTable2, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- wf.Close();
- }
-
- /// <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 (chkPlineCode.Checked) { cobPlineCode.Enabled = true; } else { cobPlineCode.Enabled = false; }
- if (chkVALIDFLAG.Checked) { cobVALIDFLAG.Enabled = true; } else { cobVALIDFLAG.Enabled = false; }
- if (chkIsVisible.Checked) { cobIsVisible.Enabled = true; } else { cobIsVisible.Enabled = false; }
- }
- private void FrmMilDateWaitingDecision_Load(object sender, EventArgs e)
- {
- cmbDate.Value = DateTime.Parse(DateTime.Today.ToString());
- 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);
- cmbDate.Value = DateTime.Parse(date.ToString("yyyy-MM-dd"));
- cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
- //cmbEndDate.Value = DateTime.Parse(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd 06:59:59"));
- //cmbDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 07:00:00"));
- //TubeRoll.SetComboItemHeight(uteLotNo);
- //TubeRoll.SetComboItemHeight(cmbBz);
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- GridHelper.ulGridToExcel(ultraGrid1, "轧管生产按炉跟踪判定情况");
- }
-
- }
- }
|