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; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.PlnSaleOrd.BaseMethod; using Core.StlMes.Client.PlnSaleOrd.Entity; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; namespace Core.StlMes.Client.PlnSaleOrd { public partial class FrmProcessOrder : FrmBase { public FrmProcessOrder() { this.IsLoadUserView = true; InitializeComponent(); System.Threading.Thread t = new System.Threading.Thread(setGridColunmName); t.Start(); } private void setGridColunmName() { System.Threading.Thread.Sleep(3000); if (!this.IsDisposed) { EntityHelper.ShowGridCaption(ultraGridGP.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridDZ.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridZG.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridDBK.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridRCL.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridJG.DisplayLayout.Bands[0]); } } private void FrmProcessOrder_Load(object sender, EventArgs e) { ultraComboFinishEditor.SelectedIndex = 0; EntityHelper.ShowGridCaption(ultraGridGP.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridDZ.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridZG.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridDBK.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridRCL.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGridJG.DisplayLayout.Bands[0]); //设置可读 BaseHelper.setOtherColumnReadOnly(ultraGridGP, new string[] { "CHC" }); BaseHelper.setOtherColumnReadOnly(ultraGridDZ, new string[] { "CHC" }); BaseHelper.setOtherColumnReadOnly(ultraGridZG, new string[] { "CHC" }); BaseHelper.setOtherColumnReadOnly(ultraGridDBK, new string[] { "CHC" }); BaseHelper.setOtherColumnReadOnly(ultraGridRCL, new string[] { "CHC" }); BaseHelper.setOtherColumnReadOnly(ultraGridJG, new string[] { "CHC" }); InitUpTime(); userControlSaleordProc1.UltraGridSaleordProc1.AfterRowActivate += UltraGridSaleordProc1_AfterRowActivate; PlanComm.setGridDigitalCol(ultraGridZG.DisplayLayout.Bands[0], 5, 0, "BacklogSeq", "OutnumSingle", "Ordernum", "MatchNum", "ReqProdNum"); PlanComm.setGridDigitalCol(ultraGridZG.DisplayLayout.Bands[0], 5, 2, "Outdiameter", "Wallthick", "Aimwallthick", "Lengthmax", "Lengthmin", "Aimlength", "RollLength", "OutLength", "DiameterGp", "LengthGp"); PlanComm.setGridDigitalCol(ultraGridZG.DisplayLayout.Bands[0], 7, 3, "Finishweight", "ReqProdWt", "BuyplanWt", "MatchWt", "Orderweight", "WeightGpOne", "Getrate"); PlanComm.setGridDigitalCol(ultraGridJG.DisplayLayout.Bands[0], 5, 0, "BacklogSeq", "OutnumSingle", "Ordernum", "MatchNum", "ReqProdNum"); PlanComm.setGridDigitalCol(ultraGridJG.DisplayLayout.Bands[0], 5, 2, "Outdiameter", "Wallthick", "Aimwallthick", "Lengthmax", "Lengthmin", "Aimlength"); PlanComm.setGridDigitalCol(ultraGridJG.DisplayLayout.Bands[0], 7, 3, "Finishweight", "ReqProdWt", "BuyplanWt", "MatchWt", "Orderweight", "Getrate"); PlanComm.setGridDigitalCol(ultraGridJG.DisplayLayout.Bands[0], 5, 0, "BacklogSeq", "OutnumSingle", "Ordernum", "MatchNum", "ReqProdNum"); PlanComm.setGridDigitalCol(ultraGridJG.DisplayLayout.Bands[0], 5, 2, "Outdiameter", "Wallthick", "Aimwallthick", "Lengthmax", "Lengthmin", "Aimlength", "LengthmaxIn", "LengthminIn"); PlanComm.setGridDigitalCol(ultraGridJG.DisplayLayout.Bands[0], 7, 3, "Finishweight", "ReqProdWt", "BuyplanWt", "MatchWt", "Orderweight", "Getrate"); } /// /// 初始化时间 /// private void InitUpTime() { BeginTime.Value = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString()); EndTime.Value = DateTime.Parse(DateTime.Now.AddDays(1).AddSeconds(-1).ToString()); } private void Chc_CheckedChanged(object sender, EventArgs e) { if (ChcTime.Checked) { BeginTime.Enabled = true; EndTime.Enabled = true; } else { BeginTime.Enabled = false; EndTime.Enabled = false; } if (ChcOrderNo.Checked) { TxtOrderNo.ReadOnly = false; } else { TxtOrderNo.ReadOnly = true; } } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": DoQuery(); break; case "Export": if (TabControl1.SelectedTab.Key.Equals("1")) { userControlSaleordProc1.Export(); } else { GridHelper.ulGridToExcel(UltraGirdBLInfo, "备料需求"); } break; case "Close": this.Close(); break; case "PLINECHANGE": MscPlineChange(); break; } } private void DoQuery() { QueryOrderInfo(); } /// /// 查询销售合同 /// private void QueryOrderInfo() { String orderNo = ""; String beginTime = ""; String endTime = ""; String isFinish = ""; if (ChcOrderNo.Checked) { orderNo = TxtOrderNo.Text.Trim(); } if (ChcTime.Checked && BeginTime.Value != null && EndTime.Value != null) { beginTime = BeginTime.Value.ToString(); endTime = EndTime.Value.ToString(); } if (checkBoxFinish.Checked) { isFinish = ultraComboFinishEditor.Value.ToString(); } userControlSaleordProc1.Query(orderNo, beginTime, endTime, isFinish, this.ob); UltraGridRow ugr = userControlSaleordProc1.getActiveRow(); if (ugr == null) { plnReqinfGpEntityBindingSource.Clear(); plnOrderDzEntityBindingSource.Clear(); plnOrderZgEntityBindingSource.Clear(); plnOrderDbkEntityBindingSource.Clear(); plnOrderRclEntityBindingSource.Clear(); plnOrderJgxEntityBindingSource.Clear(); } } /// /// 查询铸造工序 /// /// 交货行号 /// 排产流水号 //private void QueryGP(string ordLnDlyPk, string plnDivideId, string orderSource) //{ // ArrayList param = new ArrayList(); // param.Add(ordLnDlyPk); // param.Add(plnDivideId); // param.Add(orderSource); // //List listZG = EntityHelper.GetData // // ("com.steering.pss.plnsaleord.processOrder.CoreProcessOrder.queryGP", new object[] { param }, this.ob); // //plnReqinfGpEntityBindingSource.DataSource = listZG; //} /// /// 查询锻造工序 /// /// 交货行号 /// 排产流水号 //private void QueryDZ(string ordLnDlyPk, string plnDivideId, string orderSource) //{ // ArrayList param = new ArrayList(); // param.Add(ordLnDlyPk); // param.Add(plnDivideId); // param.Add(orderSource); // List listZG = EntityHelper.GetData // ("com.steering.pss.plnsaleord.processOrder.CoreProcessOrder.queryDZ", new object[] { param }, this.ob); // plnOrderDzEntityBindingSource.DataSource = listZG; //} /// /// 查询轧管工序 /// /// 交货行号 /// 排产流水号 private void QueryZG(string ordLnDlyPk, string plnDivideId, string orderSource) { ArrayList param = new ArrayList(); param.Add(ordLnDlyPk); param.Add(plnDivideId); param.Add(orderSource); List listZG = EntityHelper.GetData ("com.steering.pss.plnsaleord.processOrder.CoreProcessOrder.queryZG", new object[] { param }, this.ob); plnOrderZgEntityBindingSource.DataSource = listZG; } /// /// 查询墩拔扩工序 /// /// 交货行号 /// 排产流水号 private void QueryDBK(string ordLnDlyPk, string plnDivideId, string orderSource) { ArrayList param = new ArrayList(); param.Add(ordLnDlyPk); param.Add(plnDivideId); param.Add(orderSource); List listDBK = EntityHelper.GetData ("com.steering.pss.plnsaleord.processOrder.CoreProcessOrder.queryDBK", new object[] { param }, this.ob); plnOrderDbkEntityBindingSource.DataSource = listDBK; } /// /// 查询热处理工序 /// /// 交货行号 /// 排产流水号 private void QueryRCL(string ordLnDlyPk, string plnDivideId, string orderSource) { ArrayList param = new ArrayList(); param.Add(ordLnDlyPk); param.Add(plnDivideId); param.Add(orderSource); List listRCL = EntityHelper.GetData ("com.steering.pss.plnsaleord.processOrder.CoreProcessOrder.queryRCL", new object[] { param }, this.ob); plnOrderRclEntityBindingSource.DataSource = listRCL; } /// /// 查询加工工序 /// /// 交货行号 /// 排产流水号 private void QueryJG(string ordLnDlyPk, string plnDivideId, string orderSource) { ArrayList param = new ArrayList(); param.Add(ordLnDlyPk); param.Add(plnDivideId); param.Add(orderSource); List listJG = EntityHelper.GetData ("com.steering.pss.plnsaleord.processOrder.CoreProcessOrder.queryJG", new object[] { param }, this.ob); plnOrderJgxEntityBindingSource.DataSource = listJG; } private void checkBoxFinish_CheckedChanged(object sender, EventArgs e) { if (checkBoxFinish.Checked) { ultraComboFinishEditor.Enabled = true; } else { ultraComboFinishEditor.Enabled = false; } } /// /// 销售合同 /// /// /// void UltraGridSaleordProc1_AfterRowActivate(object sender, EventArgs e) { UltraGridRow ugr = userControlSaleordProc1.getActiveRow(); if (ugr == null) { return; } string ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Text.Trim(); string plnDivideId = ugr.Cells["PlnDivideId"].Text.Trim(); string orderSource = "销售合同"; #region 显示经过的工序 string processSeq = ugr.Cells["ProcessSeq"].Value.ToString(); if (processSeq.Contains("A") || processSeq.Contains("B")) { TabControl2.Tabs["1"].Enabled = true; } else { TabControl2.Tabs["1"].Enabled = false; } if (processSeq.Contains("C")) { TabControl2.Tabs["2"].Enabled = true; } else { TabControl2.Tabs["2"].Enabled = false; } if (processSeq.Contains("D")) { TabControl2.Tabs["3"].Enabled = true; } else { TabControl2.Tabs["3"].Enabled = false; } if (processSeq.Contains("E")) { TabControl2.Tabs["4"].Enabled = true; } else { TabControl2.Tabs["4"].Enabled = false; } if (processSeq.Contains("F")) { TabControl2.Tabs["5"].Enabled = true; } else { TabControl2.Tabs["5"].Enabled = false; } if (processSeq.Contains("G")) { TabControl2.Tabs["6"].Enabled = true; } else { TabControl2.Tabs["6"].Enabled = false; } #endregion //if (TabControl2.ActiveTab.Key.Equals("1")) //{ // QueryGP(ordLnDlyPk, plnDivideId, orderSource); //} //else if (TabControl2.ActiveTab.Key.Equals("2")) //{ // QueryDZ(ordLnDlyPk, plnDivideId, orderSource); //} //else if (TabControl2.ActiveTab.Key.Equals("3")) { QueryZG(ordLnDlyPk, plnDivideId, orderSource); } else if (TabControl2.ActiveTab.Key.Equals("4")) { QueryDBK(ordLnDlyPk, plnDivideId, orderSource); } else if (TabControl2.ActiveTab.Key.Equals("5")) { QueryRCL(ordLnDlyPk, plnDivideId, orderSource); } else { QueryJG(ordLnDlyPk, plnDivideId, orderSource); } } /// /// 备料需求 /// /// /// private void UltraGirdBLInfo_AfterRowActivate(object sender, EventArgs e) { UltraGridRow ugr = UltraGirdBLInfo.ActiveRow; if (ugr == null) { return; } string ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Text.Trim(); string plnDivideId = ugr.Cells["PlnDivideId"].Text.Trim(); string orderSource = "备料需求"; //if (TabControl2.ActiveTab.Key.Equals("1")) //{ // QueryGP(ordLnDlyPk, plnDivideId, orderSource); //} //else if (TabControl2.ActiveTab.Key.Equals("2")) //{ // QueryDZ(ordLnDlyPk, plnDivideId, orderSource); //} //else if (TabControl2.ActiveTab.Key.Equals("3")) { QueryZG(ordLnDlyPk, plnDivideId, orderSource); } else if (TabControl2.ActiveTab.Key.Equals("4")) { QueryDBK(ordLnDlyPk, plnDivideId, orderSource); } else if (TabControl2.ActiveTab.Key.Equals("5")) { QueryRCL(ordLnDlyPk, plnDivideId, orderSource); } else { QueryJG(ordLnDlyPk, plnDivideId, orderSource); } } /// /// TAB页切换 /// /// /// private void TabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { UltraGridRow ugr = null; string orderSource = ""; if (TabControl1.SelectedTab.Key.Equals("1")) { ugr = userControlSaleordProc1.getActiveRow(); orderSource = "销售合同"; } else { ugr = UltraGirdBLInfo.ActiveRow; orderSource = "备料需求"; } if (ugr == null) { return; } string ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Text.Trim(); string plnDivideId = ugr.Cells["PlnDivideId"].Text.Trim(); //if (e.Tab.Key.Equals("1")) //{ // QueryGP(ordLnDlyPk, plnDivideId, orderSource); //} //else if (e.Tab.Key.Equals("2")) //{ // QueryDZ(ordLnDlyPk, plnDivideId, orderSource); //} //else if (e.Tab.Key.Equals("3")) { QueryZG(ordLnDlyPk, plnDivideId, orderSource); } else if (e.Tab.Key.Equals("4")) { QueryDBK(ordLnDlyPk, plnDivideId, orderSource); } else if (e.Tab.Key.Equals("5")) { QueryRCL(ordLnDlyPk, plnDivideId, orderSource); } else { QueryJG(ordLnDlyPk, plnDivideId, orderSource); } } /// /// 制程变更 /// private void MscPlineChange() { //当前工序选择行 IQueryable ugrs = null; //当前工序 string nowProcess = ""; if (TabControl2.ActiveTab.Key.Equals("1")) { ultraGridGP.UpdateData(); ugrs = ultraGridGP.Rows.AsQueryable().Where(" CHC = 'True' "); nowProcess = "B"; } else if (TabControl2.ActiveTab.Key.Equals("2")) { ultraGridDZ.UpdateData(); ugrs = ultraGridDZ.Rows.AsQueryable().Where(" CHC = 'True' "); nowProcess = "C"; } else if (TabControl2.ActiveTab.Key.Equals("3")) { ultraGridZG.UpdateData(); ugrs = ultraGridZG.Rows.AsQueryable().Where(" CHC = 'True' "); nowProcess = "D"; } else if (TabControl2.ActiveTab.Key.Equals("4")) { ultraGridDBK.UpdateData(); ugrs = ultraGridDBK.Rows.AsQueryable().Where(" CHC = 'True' "); nowProcess = "E"; } else if (TabControl2.ActiveTab.Key.Equals("5")) { ultraGridRCL.UpdateData(); ugrs = ultraGridRCL.Rows.AsQueryable().Where(" CHC = 'True' "); nowProcess = "F"; } else { ultraGridJG.UpdateData(); ugrs = ultraGridJG.Rows.AsQueryable().Where(" CHC = 'True' "); nowProcess = "G"; } if (ugrs == null || ugrs.Count() == 0) { MessageUtil.ShowWarning("请选择一条工序记录进行制程变更!"); return; } UltraGridRow ugr = ugrs.First(); //交货行主键 string ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Text; //排产流水号 string plnDivideId = ugr.Cells["PlnDivideId"].Text; //联动组号 string planGroupId = ugr.Cells["PlanGroupId"].Text; //工序完成量 double finishWgtB = Convert.ToDouble(finishWeight.Value.ToString()); UltraGridRow ugrProduc = userControlSaleordProc1.getActiveRow(); //成品排产量 double planWgt = double.Parse(ugrProduc.Cells["PlanWtD"].Text); string mscPline = ugrProduc.Cells["ProcessSeq"].Text; //合同行 string orderNoSeq = ugrProduc.Cells["OrderNoSeq"].Text; //合同来源 string orderSource = ugrProduc.Cells["OrderSource"].Text; //成品完成量 double finishWgtE = 0; //判断是否为制程最后一道工序 if (mscPline.Substring(mscPline.Length - 1).Equals(nowProcess)) { finishWgtE = finishWgtB; } else { finishWgtE = finishWgtB; string[] processes = mscPline.Split('-'); //标识(用于判断是否当前工序,如果还没有到当前工序,则继续循环,否则直接计划成品完成量) Boolean flag = false; for (int i = 0; i < processes.Length; i++) { if (!flag) { if (processes[i].Equals(nowProcess)) { flag = true; } } else { double getRate = GetRate(processes[i], ordLnDlyPk, plnDivideId, planGroupId); finishWgtE = finishWgtE * getRate; } } } if (finishWgtE > planWgt) { MessageUtil.ShowWarning("工序成品完成量:" + finishWgtE + "吨大于排产分配量:" + planWgt + "吨"); return; } FrmMscPlineChange frmMscPlineChange = new FrmMscPlineChange(ordLnDlyPk, nowProcess, plnDivideId, planGroupId, finishWgtB, finishWgtE, this.ob, orderNoSeq, orderSource); if (!getOrdFistProFinishWt(ordLnDlyPk, plnDivideId, this.ob) && finishWgtB <= 0) { frmMscPlineChange.ultraToolbarsManager1.Tools["修改"].SharedProps.Visible = true; frmMscPlineChange.ultraToolbarsManager1.Tools["新增"].SharedProps.Visible = false; frmMscPlineChange.ultraToolbarsManager1.Tools["下发"].SharedProps.Visible = false; frmMscPlineChange.ultraToolbarsManager1.Tools["删除"].SharedProps.Visible = false; } frmMscPlineChange.ShowDialog(); DoQuery(); ugrs = userControlSaleordProc1.UltraGridSaleordProc1.Rows.AsQueryable().Where(" OrdLnDlyPk = '" + ordLnDlyPk + "' "); ugrs = ugrs.AsQueryable().Where(" PlnDivideId = '" + plnDivideId + "' "); if (ugrs != null && ugrs.Count() > 0) { userControlSaleordProc1.UltraGridSaleordProc1.ActiveRow = ugrs.First(); } } private void ultraGrid_AfterRowActivate(object sender, EventArgs e) { UltraGridRow ugrActive = null; UltraGrid ug = null; if (TabControl2.ActiveTab.Key.Equals("1")) { ug = ultraGridGP; ugrActive = ultraGridGP.ActiveRow; } else if (TabControl2.ActiveTab.Key.Equals("2")) { ug = ultraGridDZ; ugrActive = ultraGridDZ.ActiveRow; } else if (TabControl2.ActiveTab.Key.Equals("3")) { ug = ultraGridZG; ugrActive = ultraGridZG.ActiveRow; } else if (TabControl2.ActiveTab.Key.Equals("4")) { ug = ultraGridDBK; ugrActive = ultraGridDBK.ActiveRow; } else if (TabControl2.ActiveTab.Key.Equals("5")) { ug = ultraGridRCL; ugrActive = ultraGridRCL.ActiveRow; } else { ug = ultraGridJG; ugrActive = ultraGridJG.ActiveRow; } if (ugrActive == null) { return; } else { foreach (UltraGridRow ugr in ug.Rows) { ugr.Cells["CHC"].Value = false; } ugrActive.Cells["CHC"].Value = true; finishWeight.Value = ugrActive.Cells["FINISHWEIGHT"].Text == "" ? 0 : Convert.ToDouble(ugrActive.Cells["FINISHWEIGHT"].Text); } } private void ultraButton1_Click(object sender, EventArgs e) { MscPlineChange(); } /// /// 控制工序完成量的输入 /// /// /// private void finishWeight_ValueChanged(object sender, EventArgs e) { IQueryable ugrs = null; if (TabControl2.ActiveTab.Key.Equals("1")) { ugrs = ultraGridGP.Rows.AsQueryable().Where(" CHC = 'True' "); } else if (TabControl2.ActiveTab.Key.Equals("2")) { ugrs = ultraGridDZ.Rows.AsQueryable().Where(" CHC = 'True' "); } else if (TabControl2.ActiveTab.Key.Equals("3")) { ugrs = ultraGridZG.Rows.AsQueryable().Where(" CHC = 'True' "); } else if (TabControl2.ActiveTab.Key.Equals("4")) { ugrs = ultraGridDBK.Rows.AsQueryable().Where(" CHC = 'True' "); } else if (TabControl2.ActiveTab.Key.Equals("5")) { ugrs = ultraGridRCL.Rows.AsQueryable().Where(" CHC = 'True' "); } else { ugrs = ultraGridJG.Rows.AsQueryable().Where(" CHC = 'True' "); } UltraGridRow ugr = ugrs.First(); //如果工序存在激活行,则工序完成量不能小于激活行的完成量 if (ugr != null) { double finishWgt = ugr.Cells["FINISHWEIGHT"].Text == "" ? 0 : Convert.ToDouble(ugr.Cells["FINISHWEIGHT"].Text); double inWgt = finishWeight.Value == null ? 0 : Convert.ToDouble(finishWeight.Value.ToString()); if (inWgt < finishWgt) { finishWeight.Value = finishWgt; } } } /// /// 查询成材率 /// /// 工序 /// 交货行主键 /// 排产流水号 /// 联动主号 /// private double GetRate(string process, string ordLnDlyPk, string plnDivideId, string planGroupId) { double getRate = 1; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.CoreProcessOrder"; ccp.MethodName = "getGetRate"; ccp.ServerParams = new object[] { process, ordLnDlyPk, plnDivideId, planGroupId }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { getRate = Double.Parse(ccp.ReturnInfo); } return getRate; } private void ultraButton2_Click(object sender, EventArgs e) { //DoReqProcOrd(); } /// /// 工序 补量 /// //private void DoReqProcOrd() //{ // //当前工序选择行 // IQueryable ugrs = null; // //当前工序 // string nowProcess = ""; // if (TabControl2.ActiveTab.Key.Equals("2")) // { // ultraGridDZ.UpdateData(); // ugrs = ultraGridDZ.Rows.AsQueryable().Where(" CHC = 'True' "); // nowProcess = "C"; // } // else if (TabControl2.ActiveTab.Key.Equals("3")) // { // ultraGridZG.UpdateData(); // ugrs = ultraGridZG.Rows.AsQueryable().Where(" CHC = 'True' "); // nowProcess = "D"; // } // else if (TabControl2.ActiveTab.Key.Equals("4")) // { // ultraGridDBK.UpdateData(); // ugrs = ultraGridDBK.Rows.AsQueryable().Where(" CHC = 'True' "); // nowProcess = "E"; // } // else if (TabControl2.ActiveTab.Key.Equals("5")) // { // ultraGridRCL.UpdateData(); // ugrs = ultraGridRCL.Rows.AsQueryable().Where(" CHC = 'True' "); // nowProcess = "F"; // } // else // { // ultraGridJG.UpdateData(); // ugrs = ultraGridJG.Rows.AsQueryable().Where(" CHC = 'True' "); // nowProcess = "G"; // } // if (ugrs == null || ugrs.Count() == 0) // { // MessageUtil.ShowWarning("请选择一条工序记录进行制程变更!"); // return; // } // if (ultraNumericReq.Value == null || (double)ultraNumericReq.Value == 0) // { // MessageUtil.ShowWarning("申请量有误!"); // return; // } // UltraGridRow ugr = ugrs.First(); // //交货行主键 // string ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Text; // //排产流水号 // string plnDivideId = ugr.Cells["PlnDivideId"].Text; // //联动组号 // string planGroupId = ugr.Cells["PlanGroupId"].Text; // //工序合同号 // string proOrderNo = ugr.Cells["ProOrderNo"].Text; // //补量申请量 // double reqOrdQty = (double)ultraNumericReq.Value; // string createName = UserInfo.GetUserName(); // if (MessageUtil.ShowQuestion("确认补投料" + reqOrdQty + "吨?") == DialogResult.No) // { // return; // } // CoreClientParam ccp = new CoreClientParam(); // ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.CoreProcessOrder"; // ccp.MethodName = "addReqOrder"; // ccp.ServerParams = new object[] { nowProcess, ordLnDlyPk, plnDivideId, // planGroupId, reqOrdQty, createName }; // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); // if (ccp.ReturnCode != -1) // { // MessageUtil.ShowTips("操作成功!"); // return; // } //} /// /// 获取首个工序完成量 /// /// public static bool getOrdFistProFinishWt(string ordLnDlyPk, string plnDivideId, OpeBase _ob) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.CorePlnProcOrdFinish"; ccp.MethodName = "getOrdFistProFinishWt"; ccp.ServerParams = new object[] { ordLnDlyPk, plnDivideId }; ccp = _ob.ExecuteSortResultByQueryToDataTable(ccp, CoreInvokeType.Internal); if (ccp == null || ccp.ReturnObject == null) { return false; } return (bool)ccp.ReturnObject; } } }