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.Entity; using Core.StlMes.Client.ZGMil.NodeResultQuery; using Core.StlMes.Client.ZGMil.Popup; using Core.StlMes.Client.ZGMil.Report; using Core.StlMes.Client.ZGMil.ResultConrtrol; 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.Signature { public partial class FrmApplyInputUpdate : FrmBase { private string Process = "";//参数 private string[] arrId;//数据权限 private DataTable _dtPline = null; public FrmApplyInputUpdate() { InitializeComponent(); } private void FrmApplyInputUpdate_Load(object sender, EventArgs e) { DateTime now = DateTime.Now; DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天 DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天 this.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00"); this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59"); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); 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()); ultraTextEditor1.Text = strPlineNames; ultraTextEditor1.Tag = strPineCodes; InitBindColumn(); } private void InitBindColumn() { } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "DoQuery": QueryZgJugdeApply(); break; case "updateInputWt": updateInputWt(); break; case "Close": this.Close(); break; } } /// /// 调整设料量 /// private void updateInputWt() { this.ultraGrid1.UpdateData(); UltraGridRow uRow = this.ultraGrid1.ActiveRow; //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentid = UserInfo.GetDeptid(); if (uRow == null) { MessageUtil.ShowTips("请选择需要调整的炉信息!"); return; } if (Double.Parse(uRow.Cells["InputCount"].Value.ToString3()) < 0) { MessageUtil.ShowTips("请输入正确的数字!"); return; } if (Double.Parse(uRow.Cells["InputWeight"].Value.ToString3()) < 0) { MessageUtil.ShowTips("请输入正确的数字 !"); return; } ArrayList list = new ArrayList(); list.Add(uRow.Cells["JugdeApplyCode"].Value.ToString()); list.Add(uRow.Cells["JugdeApplySequeno"].Value.ToString()); list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString()); list.Add(uRow.Cells["BatchNo"].Value.ToString()); list.Add(uRow.Cells["BatchGroudNo"].Value.ToString()); list.Add(uRow.Cells["InputCount"].Text.ToString3()); list.Add(uRow.Cells["InputWeight"].Text.ToString3()); list.Add(UserInfo.GetUserName()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "updateInputWt"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("调整成功!")) { QueryZgJugdeApply(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 查询送判数据 /// private void QueryZgJugdeApply() { string plinCode = ""; string jugeNo = ""; string startTim = ""; string endTim = ""; string departMentid = UserInfo.GetDeptid(); if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "") { jugeNo = this.txtHeatNo2.Text.Trim(); } if (chkTim2.Checked) { if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString())) { MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!"); return; } else { startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); } } if (chkPlineCode.Checked) { plinCode = ultraTextEditor1.Tag.ToString().Replace(",", "', '"); } List listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, plinCode }, this.ob); qcmZgJugdeApplyEntityBindingSource.DataSource = listSource; GridHelper.RefreshAndAutoSize(ultraGrid1); } private void chkTim2_CheckedChanged(object sender, EventArgs e) { this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked; } private void chkHeatNo2_CheckedChanged(object sender, EventArgs e) { this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked; } private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraTextEditor1.Tag.ToString2(), this.ob); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraTextEditor1.Text = frm.ChoicePlineName; ultraTextEditor1.Tag = frm.ChoicePlineCode; } } private void chkPlineCode_CheckedChanged(object sender, EventArgs e) { this.ultraTextEditor1.Enabled = this.chkPlineCode.Checked; } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid1.ActiveRow; List listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.QueryZgApplyInputRecord", new object[] { uRow.Cells["JugdeApplyCode"].Value.ToString(), uRow.Cells["JugdeApplySequeno"].Value.ToString(), uRow.Cells["JudgeStoveNo"].Value.ToString(), uRow.Cells["BatchNo"].Value.ToString(), uRow.Cells["BatchGroudNo"].Value.ToString() }, this.ob); bindingSource1.DataSource = listSource; } } }