private void LoadShipPlanDoc() { if (this.NameValues != null && this.NameValues["BillNoItem"] != null && this.NameValues["ShipCustomer"] != null) { this.Model.ShipPlanView.Clear(); this.Toolbar2.Visible = false; //按照发票号查找预装柜表数据 long shipHead = Convert.ToInt64(this.NameValues["ShipPlanHead"].ToString()); long billNoItem = Convert.ToInt64(this.NameValues["BillNoItem"].ToString()); long customer = Convert.ToInt64(this.NameValues["ShipCustomer"].ToString()); string billNoItem_Code = this.NameValues["BillNoItem_Code"].ToString(); string billNoItem_Name = this.NameValues["BillNoItem_Name"].ToString(); //this.BillNoItemHead125.ID = billNoItem.ToString(); //this.BillNoItemHead125.Value = billNoItem_Code; //this.BillNoItemHead125.Text = billNoItem_Name; if (this.Model.InstalledArkHead.FocusedRecord != null) { this.Model.InstalledArkHead.FocusedRecord.BillNoItemHead = billNoItem; this.Model.InstalledArkHead.FocusedRecord.BillNoItemHead_BillNoItemID = billNoItem_Code; this.Model.InstalledArkHead.FocusedRecord.BillNoItemHead_BillNoItemID = billNoItem_Name; this.Model.InstalledArkHead.FocusedRecord.Customer = customer; this.Model.InstalledArkHead.FocusedRecord.Customer_Code = this.NameValues["ShipCustomer_Code"].ToString(); this.Model.InstalledArkHead.FocusedRecord.Customer_Name = this.NameValues["ShipCustomer_Name"].ToString(); } UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.Proxy.GetShipPlanDocProxy proxy = new OperateShipPlanBP.Proxy.GetShipPlanDocProxy(); List <UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.ShipPlanByBillHeadDTOData> listShipPlan = new List <OperateShipPlanBP.ShipPlanByBillHeadDTOData>(); proxy.BillNoItemHead = billNoItem; proxy.Customer = customer; if (billNoItem == 0) { proxy.Customer = shipHead; } proxy.Type = 1; listShipPlan = proxy.Do(); foreach (UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.ShipPlanByBillHeadDTOData shipDoc in listShipPlan) { ShipPlanViewRecord recourd = this.Model.ShipPlanView.AddNewUIRecord(); recourd.ShipPlanDetailHead = shipDoc.ShipPlan; recourd.ShipPlanDetailHead_DocNo = shipDoc.DocNo; recourd.RowNo = shipDoc.RowNo; recourd.ShipLine = shipDoc.ShipLine; recourd.ItemMaster = shipDoc.ItemMaster; recourd.ItemMaster_Code = shipDoc.ItemMaster_Code; recourd.ItemMaster_Name = shipDoc.ItemMaster_Name; recourd.SPECS = shipDoc.SPECS; recourd.Qty = shipDoc.Qty; recourd.ArkQty = shipDoc.ShipCanQty; recourd.ArkCanQty = shipDoc.ShipCanQty; recourd.OuterBoxNumber = shipDoc.OutBoxNumner; recourd.InBoxNumber = shipDoc.InBoxNumber; recourd.BoxNumber = shipDoc.BoxNumber; recourd.Bulks = shipDoc.Bulks; recourd.Length = shipDoc.Length; recourd.Weith = shipDoc.Width; recourd.Higth = shipDoc.Higth; recourd.GrossWeight = shipDoc.GrossWeight; recourd.NetWeight = shipDoc.NetWeight; recourd.IsWms = shipDoc.IsWms; recourd.SrcSO = shipDoc.SrcSO; recourd.SrcSONo = shipDoc.SrcSONo; recourd.SrcSOLine = shipDoc.SrcSOLine; recourd.SrcSOLineNo = shipDoc.SrcSOLineNo; if (recourd.IsWms ?? false) { this.OnInstaledArk122.Enabled = false; this.RemoveArk0.Enabled = false; this.BtnOk.Enabled = false; } } this.Model.InstalledArkHead.Clear(); this.Model.InstalledArkHead.CurrentFilter.OPath = this.Model.InstalledArkHead.FieldBillNoItemHead.AttributeName + "=" + billNoItem; this.Action.CommonAction.Load(this.Model.InstalledArkHead); this.Action.CommonAction.Load(this.Model.InstalledArkHead_InstalledArkLine); this.Action.CommonAction.Load(this.Model.InstalledArkHead_InstalledArkLine_InstalledArkDetailLine); //this.NameValues["BillNoItem"] = null; //this.NameValues["ShipCustomer"] = null; } }
//RemoveArk0_Click... /// <summary> /// 移除装柜 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RemoveArk0_Click_Extend(object sender, EventArgs e) { //调用模版提供的默认实现.--默认实现可能会调用相应的Action. //if (this.Model.ShipPlanView.SelectRecords.Count <= 0) //{ // throw new Exception("请选择要移除的出运明细数据"); //} //this.DataCollect(); if (this.Model.InstalledArkHead_InstalledArkLine_InstalledArkDetailLine.SelectRecords.Count <= 0) { throw new Exception("请选择要移除的装柜明细数据"); } //重新汇总体积 decimal sumBulks = this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumBulk ?? 0; decimal sumGrossWeight = this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumGrossWeight ?? 0;; decimal sumNetWeight = this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumNetWeight ?? 0; decimal sumBox = this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumBox ?? 0;; foreach (InstalledArkHead_InstalledArkLine_InstalledArkDetailLineRecord record in this.Model.InstalledArkHead_InstalledArkLine_InstalledArkDetailLine.SelectRecords) { bool isExit = false; foreach (ShipPlanViewRecord shipRecourd in this.Model.ShipPlanView.Records) { if (shipRecourd.ShipLine == record.SrcShipLine) { shipRecourd.ArkCanQty = shipRecourd.ArkCanQty + record.InstalledArkNumber ?? 0; shipRecourd.ArkQty = shipRecourd.ArkCanQty; isExit = true; continue; } } if (!isExit) { ShipPlanViewRecord recourd = this.Model.ShipPlanView.AddNewUIRecord(); recourd.ShipPlanDetailHead = record.SrcShip; recourd.ShipPlanDetailHead_DocNo = record.SrcShipNO; recourd.RowNo = record.SrcShipLineNo; recourd.ShipLine = record.SrcShipLine; recourd.SrcSO = record.SrcSO; recourd.SrcSONo = record.SrcSONo; recourd.SrcSOLine = record.SrcSOLine; recourd.SrcSOLineNo = record.SrcSOLineNo; recourd.ItemMaster = record.ItemMaster; recourd.ItemMaster_Code = record.ItemMaster_Code; recourd.ItemMaster_Name = record.ItemMaster_Name; recourd.SPECS = record.Standard; recourd.Qty = record.Qty; recourd.ArkQty = record.Qty ?? 0; recourd.ArkCanQty = record.Qty ?? 0; recourd.OuterBoxNumber = record.OutBoxNumner ?? 0; recourd.InBoxNumber = record.InBoxNumber ?? 0; recourd.Bulks = record.Bulks ?? 0; recourd.Length = record.Length ?? 0; recourd.Weith = record.Width ?? 0; recourd.Higth = record.Higth ?? 0; recourd.GrossWeight = record.GrossWeight ?? 0; recourd.NetWeight = record.NetWeight ?? 0; recourd.IsWms = false; recourd.SrcSO = record.SrcSO; recourd.SrcSONo = record.SrcSONo; recourd.SrcSOLine = record.SrcSOLine; recourd.SrcSOLineNo = record.SrcSOLineNo; } sumBulks -= record.Bulks ?? 0; sumGrossWeight -= record.GrossWeight ?? 0; sumNetWeight -= record.NetWeight ?? 0; sumBox -= record.BoxNumber ?? 0; //record.Remove(); record.Delete(); } this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumBulk = sumBulks; this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumGrossWeight = sumGrossWeight; this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumNetWeight = sumNetWeight; this.Model.InstalledArkHead_InstalledArkLine.FocusedRecord.SumBox = sumBox; //foreach (InstalledArkHead_InstalledArkLineRecord recourd in this.Model.InstalledArkHead_InstalledArkLine.Records) //{ // recourd.SumBulk = sumBulks; //} this.DataGrid12.CollectData(); this.DataGrid12.BindData(); this.DataGrid13.CollectData(); this.DataGrid13.BindData(); this.DataBinding(); this.DataCollect(); RemoveArk0_Click_DefaultImpl(sender, e); }