| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- 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<DataRow>().Select(a => a["plineName"].ToString()).ToArray());
- string strPineCodes = string.Join(",", _dtPline.Rows.Cast<DataRow>().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月");
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
-
- case "DoQuery":
- doQuery2();
- break;
-
- case "Update":
- updateHrCapcty();
- break;
-
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 回报小时能力
- /// </summary>
- 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);
- }
-
- /// <summary>
- /// 调 度 统 计(小时能力)查询
- /// </summary>
- 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;
- }
- }
-
- }
- }
|