using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.ZGMil.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.ZGMil.Signature { public partial class FrmStorageScrap : FrmBase { private string Process = "";//参数 private string userName = "";//操作人 public FrmStorageScrap() { InitializeComponent(); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": QueryMat(); break; case "Scrape": Scrape(); break; case "ScrapeBack": ScrapeBack(); break; case "Close": this.Close(); break; } } /// /// 查询库存信息 /// private void QueryMat() { string jugeNo = ""; string plinCode = ""; //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentId = UserInfo.GetDeptid(); NativeMethodNew na = new NativeMethodNew(this.ob); plinCode = na.GetPCode(this.UserInfo.GetDepartment()); if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "") { jugeNo = this.txtJugeNo.Text.Trim(); } if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text == "") { MessageUtil.ShowTips("请输入判定炉号!"); return; } List listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmStorageScrap.queryMat", new object[] { jugeNo, Process }, this.ob); bindingSource1.DataSource = listSource; } /// /// 库里剔废 /// private void Scrape() { this.ultraGrid1.UpdateData(); IQueryable checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { MessageUtil.ShowTips("请选择需要修改的主信息!"); return; } ArrayList parm = new ArrayList(); foreach (UltraGridRow uRow in checkMagRows) { MatBcMEntity matZcEntity = (MatBcMEntity)uRow.ListObject; string matZcTity = JSONFormat.Format(matZcEntity); parm.Add(matZcTity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmStorageScrap"; ccp.MethodName = "scrape"; ccp.ServerParams = new object[] { parm, userName }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("剔废成功!")) { QueryMat(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销剔废 /// private void ScrapeBack() { this.ultraGrid1.UpdateData(); IQueryable checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { MessageUtil.ShowTips("请选择需要修改的主信息!"); return; } ArrayList parm = new ArrayList(); foreach (UltraGridRow uRow in checkMagRows) { MatBcMEntity matZcEntity = (MatBcMEntity)uRow.ListObject; string matZcTity = JSONFormat.Format(matZcEntity); parm.Add(matZcTity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmStorageScrap"; ccp.MethodName = "scrapeBack"; ccp.ServerParams = new object[] { parm }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销剔废成功!")) { QueryMat(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } private void FrmUpdateFlagJugeStoveNo_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); Process = this.CustomInfo.ToString();//参数 userName = this.UserInfo.GetUserName(); } private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e) { this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked; } } }