using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity; using Core.Mes.Client.Comm.Control; using Infragistics.Win.UltraWinGrid; using CoreFS.CA06; using System.Collections; using Core.StlMes.Client.PlnSaleOrd.工序排产.entity; namespace Core.StlMes.Client.PlnSaleOrd.炉计划 { public partial class ComPlanEndJgx : UserControl { public string ordLnDlyPk = ""; public string indexSeq = ""; public string carftSeq = ""; public bool flag = false; public ComPlanEndJgx() { InitializeComponent(); } private void ComPlanEndJgx_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(entityGrid1.DisplayLayout.Bands[0]); } /// /// 查询轧管订单信息 /// public void QueryPlanZg(string materialNo,string gradecode,OpeBase ob) { List listSource = EntityHelper.GetData("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.getPlnOrderZgS", new object[] { materialNo, gradecode, "G" }, ob); plnOrderJgxSOEntityBindingSource.DataSource = listSource; GridHelper.RefreshAndAutoSize(entityGrid1); //plnOrderJgxSOEntityBindingSource.DataSource = listSource.Where(w => w.ReallWt > 0).ToList(); if (listSource.Count == 0) { ordLnDlyPk = ""; } } /// /// 利库 /// /// /// public void doAddLibrary(ArrayList list, string userName, OpeBase ob, int countCic, string specCic) { UltraGridRow row = entityGrid1.ActiveRow; if (row == null) return; int count = 0; string proPlanId = ""; string gxPlanNo = ""; foreach (UltraGridRow ugr in entityGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true) { count++; proPlanId = ugr.Cells["ProPlanId"].Value.ToString(); gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString(); } } if (count == 0 || count > 1) { MessageUtil.ShowTips("请选择一个加工订单!"); return; } if (specCic.Equals("") && countCic == 0) { MessageUtil.ShowTips("库存CIC在订单炼钢CIC集合里没有,请指定CIC!"); return; } if (MessageUtil.ShowYesNoAndQuestion("是否确认利库?") == DialogResult.No) return; PlanComm.WaitFromOpen(this.Cursor); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary"; ccp.MethodName = "doAddLibrary"; ccp.ServerParams = new object[] { list,proPlanId,gxPlanNo,userName }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); PlanComm.WaitFromColse(this.Cursor); if (ccp.ReturnCode == -1) return; MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("利库成功!")) { flag = true; } } /// /// 物料改判 /// /// /// public void doSentence(ArrayList list, string userName, OpeBase ob) { UltraGridRow row = entityGrid1.ActiveRow; if (row == null) return; int count = 0; string proPlanId = ""; string gxPlanNo = ""; foreach (UltraGridRow ugr in entityGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true) { count++; proPlanId = ugr.Cells["ProPlanId"].Value.ToString(); gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString(); } } if (count == 0 || count > 1) { MessageUtil.ShowTips("请选择一个轧管订单!"); return; } if (MessageUtil.ShowYesNoAndQuestion("是否确认改判?") == DialogResult.No) return; PlanComm.WaitFromOpen(this.Cursor); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary"; ccp.MethodName = "doSentence"; ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, userName }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); PlanComm.WaitFromColse(this.Cursor); if (ccp.ReturnCode == -1) return; MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("改判成功!")) { flag = true; } } private void entityGrid1_AfterRowActivate(object sender, EventArgs e) { UltraGridRow row = entityGrid1.ActiveRow; if (row == null) return; ordLnDlyPk = row.Cells["OrdLnDlyPk"].Value.ToString(); indexSeq = row.Cells["IndexSeq"].Value.ToString(); carftSeq = row.Cells["CraftSeq"].Value.ToString(); } } }