public bool DeletePayment(InvoicePayments deletedPayment) { var result = _database.InvoicePayments.Remove(deletedPayment); _database.Save(); return((result != null) ? true : false); }
public async Task <uint> Handle(CreatePurchaseOrderPaymentCommand request, CancellationToken cancellationToken) { InvoicePayments payment = _Mapper.Map <CreatePurchaseOrderPaymentCommand, InvoicePayments> (request); await _database.InvoicePayments.AddAsync(payment); await _database.SaveAsync(); return(payment.Id); }
public async Task <Unit> Handle(DeleteCustomerInvoicePaymentCommand request, CancellationToken cancellationToken) { InvoicePayments payments = await _database.InvoicePayments.FindAsync(request.Id); if (payments == null) { throw new NotFoundException("Customer Invoice Payment", request.Id); } _database.InvoicePayments.Remove(payments); await _database.SaveAsync(); return(Unit.Value); }
public async Task <Unit> Handle(UpdatePurchaseOrderPaymentCommand request, CancellationToken cancellationToken) { InvoicePayments payment = await _database.InvoicePayments.FindAsync(request.Id); if (payment == null) { throw new NotFoundException("Payment", request.Id); } _Mappper.Map(request, payment); _database.InvoicePayments.Update(payment); await _database.SaveAsync(); return(Unit.Value); }
public async Task <uint> Handle(CreateCustomerInvoicePaymentCommand request, CancellationToken cancellationToken) { Invoice invoice = await _database.Invoice.FindAsync(request.InvoiceNo); if (invoice == null) { throw new NotFoundException("Invoice", request.InvoiceNo); } InvoicePayments payments = _Mapper.Map <CreateCustomerInvoicePaymentCommand, InvoicePayments> (request); await _database.InvoicePayments.AddAsync(payments); await _database.SaveAsync(); return(payments.Id); }
public bool UpdatePayment(InvoicePayments payment) { var result = _database.InvoicePayments.Update(payment); return((result != null) ? true : false); }
public InvoicePayments AddPayment(InvoicePayments payment) { _database.InvoicePayments.Add(payment); _database.Save(); return(payment); }