public void RemoveBillDetail(TransportBillDetail billDetail) { if (this.BillDetails != null) { this.BillDetails.Remove(billDetail); } }
public void AddBillDetail(TransportBillDetail billDetail) { if (this.BillDetails == null) { this.BillDetails = new List<TransportBillDetail>(); } this.BillDetails.Add(billDetail); }
private void ReverseTransportActingBill(TransportBillDetail billDetail) { #region 扣减旧TransportBillDetail的数量和金额 TransportActingBill actingBill = this.genericMgr.FindById<TransportActingBill>(billDetail.ActBill); actingBill.BillingQty -= billDetail.BillQty; actingBill.BillingAmount -= billDetail.BillAmount; actingBill.BillingQty += billDetail.CurrentBillQty; actingBill.BillingAmount += billDetail.CurrentBillAmount; if ((actingBill.BillQty > 0 && actingBill.BillQty < actingBill.BillingQty) || (actingBill.BillQty < 0 && actingBill.BillQty > actingBill.BillingQty)) { throw new BusinessException("TransportActingBill.Error.CurrentBillQtyGeRemainQty"); } if ((actingBill.BillAmount > 0 && actingBill.BillAmount < actingBill.BillingAmount) || (actingBill.BillAmount < 0 && actingBill.BillAmount > actingBill.BillingAmount)) { throw new BusinessException("TransportActingBill.Error.CurrentBillAmountGeRemainAmount"); } if (actingBill.BillQty == actingBill.BillingQty && actingBill.BillAmount == actingBill.BillingAmount) { actingBill.IsClose = true; } else { actingBill.IsClose = false; } this.genericMgr.Update(actingBill); #endregion }