using BWP.B3Frameworks.BL; using BWP.B3SubstituteKill.BO; using BWP.B3SubstituteKill.Rpcs; using Forks.EnterpriseServices; using Forks.EnterpriseServices.BusinessInterfaces; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BWP.B3SubstituteKill.BL { [BusinessInterface(typeof(StatPayBL))] [LogicName("代宰结算")] public interface IStatPayBL : IDepartmentWorkFlowBillBL { } public class StatPayBL : DepartmentWorkFlowBillBL, IStatPayBL { protected override void beforeSave(StatPay dmo) { if (dmo.SourceBillID == null || dmo.PriceBill_ID == null) { dmo.PriceBill_ID = null; if (dmo.Date.HasValue && dmo.Supplier_ID.HasValue) dmo.PriceBill_ID = SupplierRpc.GetPriceBillID(dmo.Supplier_ID.Value, dmo.Date.Value); } foreach (var d in dmo.CostDetails) d.Money = d.Price * d.Number; foreach (var d in dmo.CallbackPayDetails) d.Money = d.Price * d.Number; dmo.ReceiveMoney = dmo.CostDetails.CostMoney - dmo.CallbackPayDetails.CallbackPayMoney; base.beforeSave(dmo); } protected override List MinDmoProperties { get { var b = base.MinDmoProperties; b.Add("SourceBillID"); b.Add("SourceBillType"); return b; } } } }