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; 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 FrmBcControlLog : FrmBase { private string departm = ""; private string plineCode = ""; private string Process = "";//参数 private DataTable _dtPline = null; private string[] arrId;//数据权限 public FrmBcControlLog() { InitializeComponent(); this.IsLoadUserView = true; } private void FrmBcControlLog_Load(object sender, EventArgs e) { NativeMethodNew na = new NativeMethodNew(this.ob); departm = UserInfo.GetDepartment(); //plineCode = na.GetPCode(departm);//获取 用户 对应的产线 arrId = this.ValidDataPurviewIds;//获取数据权限 Process = this.CustomInfo.ToString();//参数 _dtPline = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.JudgeBaseInfo", new object[] { Process }, ob); //_dtPline.AcceptChanges(); string strPlineNames = string.Join(",", _dtPline.Rows.Cast().Select(a => a["plineName"].ToString()).ToArray()); string strPineCodes = string.Join(",", _dtPline.Rows.Cast().Select(a => a["plineCode"].ToString()).ToArray()); ultraPlineCode.Text = strPlineNames; ultraPlineCode.Tag = strPineCodes; DateTime now = DateTime.Now; DateTime date = new DateTime(now.Year,now.Month,1); dateBAL_YEAR_MONTH.Text = now.ToString("yyyy年MM月"); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "DoQuery": doQuery2(); break; case "Update": updateHrCapcty(); break; case "Close": this.Close(); break; } } /// /// 回报小时能力 /// private void updateHrCapcty() { ArrayList listAll = new ArrayList(); if (ultraGrid2.Rows.Count > 0) { foreach (UltraGridRow ugr in ultraGrid2.Rows) { ArrayList list = new ArrayList(); list.Add(ugr.Cells["XSJZ"].Value.ToString()); list.Add(ugr.Cells["QUALIFIED_NUM"].Value.ToString()); list.Add(ugr.Cells["INWL_ID"].Value.ToString()); list.Add(ugr.Cells["OUTWL_ID"].Value.ToString()); list.Add(ugr.Cells["PLINE_CODE"].Value.ToString()); listAll.Add(list); } } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics"; ccp.MethodName = "updateBcControlLog"; ccp.ServerParams = new object[] { listAll, Process }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); MessageUtil.ShowTips(ccp.ReturnInfo); } /// /// 调 度 统 计(小时能力)查询 /// private void doQuery2() { string time = ""; if (ckBAL_YEAR_MONTH.Checked) { if (dateBAL_YEAR_MONTH.Text.Trim() == "") { time = ""; } else { time = dateBAL_YEAR_MONTH.Value.ToString("yyyyMM"); } } if (ckPlineCode.Checked) { plineCode = ultraPlineCode.Tag.ToString().Replace(",", "', '"); } DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getBcControlLog", new Object[] { time, plineCode, Process }, this.ob); GridHelper.CopyDataToDatatable(dt, this.dataTable2, true); GridHelper.RefreshAndAutoSize(this.ultraGrid2); } private void chkDate_CheckedChanged(object sender, EventArgs e) { if (ckBAL_YEAR_MONTH.Checked) { dateBAL_YEAR_MONTH.Enabled = true; } else { dateBAL_YEAR_MONTH.Enabled = false; } if (ckPlineCode.Checked) { ultraPlineCode.Enabled = true; } else { ultraPlineCode.Enabled = false; } //if (ultraCheckEditor2.Checked) { ultraComboEditor1.Enabled = true; } else { ultraComboEditor1.Enabled = false; } } private void ultraPlineCode_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraPlineCode.Tag.ToString2(), this.ob); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraPlineCode.Text = frm.ChoicePlineName; ultraPlineCode.Tag = frm.ChoicePlineCode; } } } }