InvoiceReceiptStore.cs 945 B

12345678910111213141516171819202122232425
  1. using Comal.Classes;
  2. namespace Comal.Stores
  3. {
  4. internal class InvoiceReceiptStore : BaseStore<InvoiceReceipt>
  5. {
  6. protected override void BeforeSave(InvoiceReceipt entity)
  7. {
  8. base.BeforeSave(entity);
  9. //UpdateAggregate<Invoice>(entity, entity.InvoiceLink, Sum<Invoice>(ir => ir.Amount, i => i.AmountPaid));
  10. //UpdateAggregate<Receipt>(entity, entity.ReceiptLink, Sum<Receipt>(ir => ir.Amount, r => r.Total));
  11. }
  12. protected override void BeforeDelete(InvoiceReceipt entity)
  13. {
  14. base.BeforeDelete(entity);
  15. //entity.InvoiceLink.ID = Guid.Empty;
  16. //UpdateAggregate<Invoice>(entity, entity.InvoiceLink, Sum<Invoice>(ir => ir.Amount, i => i.AmountPaid));
  17. //entity.ReceiptLink.ID = Guid.Empty;
  18. //UpdateAggregate<Receipt>(entity, entity.ReceiptLink, Sum<Receipt>(ir => ir.Amount, r => r.Total));
  19. }
  20. }
  21. }