public IHttpActionResult GetPaymentType(int id) { //PaymentType paymentType = db.PaymentType.Find(id); PaymentType paymentType = _paymentTypeRepository.Get(id); if (paymentType == null) { return(NotFound()); } return(Ok(paymentType)); }
// GET: PaymentTypes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaymentType paymentType = _paymentTypeRepository.Get(id); //db.PaymentType.Find(id); if (paymentType == null) { return(HttpNotFound()); } return(View(paymentType)); }
public Task <bool> Handle(PaymentExpenseCommand command) { var entity = _expenseRepository.Get(command.Id); if (entity == null) { AddNotification("despesa", "Despesa não localizada"); return(Task.FromResult(false)); } entity.Pay( _paymentTypeRepository.Get(command.PaymentType), command.Number ); AddNotifications(entity); if (Invalid) { return(Task.FromResult(false)); } _expenseRepository.Update(entity); _uow.Commit(); return(Task.FromResult(true)); }