using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.YdmStuffManage.Entity; 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.YdmStuffManage { public partial class FrmUpdateLenth : FrmBase { public FrmUpdateLenth() { InitializeComponent(); } private void FrmUpdateLenth_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "DoQuery": doQuery(); break; case"Update": updateLength(); break; case "Close": this.Close(); break; } } /// /// 查询未送判 余材 /// private void doQuery() { string stoveNo = ""; string judgeNo = ""; if(this.chkStoveNo.Checked) { stoveNo = this.txtStoveNo.Text.Trim(); } if(this.chkJugeHeatNo.Checked) { judgeNo = this.txtJugeNo.Text.Trim(); } ArrayList parmList = new ArrayList(); parmList.Add(stoveNo); parmList.Add(judgeNo); List listSource = EntityHelper.GetData( "Core.LgMes.Server.Stuffmanage.FrmUpdateLenth.doQuery", new object[] { parmList }, this.ob); MatGpMEntity3bindingSource.DataSource = listSource; } /// /// 修改坯长 /// private void updateLength() { this.ultraGrid1.UpdateData(); IQueryable checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { MessageUtil.ShowTips("请选择需要修改的库存信息!"); return; } ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in checkMagRows) { MatGpMEntity3 matBcEntity = (MatGpMEntity3)row.ListObject; string matBcTity = JSONFormat.Format(matBcEntity); parmList.Add(matBcTity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmUpdateLenth"; ccp.MethodName = "updateLen"; ccp.ServerParams = new object[] { parmList }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } private void chkStoveNo_CheckedChanged(object sender, EventArgs e) { this.txtStoveNo.Enabled = this.chkStoveNo.Checked; } private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e) { this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked; } } }