public IActionResult Update(CreateEditPaymentViewModel vm) { var payment = _repository.GetById <Payment>(vm.PaymentId); payment.Amount = vm.Amount; payment.Description = vm.Description; payment.CategoryId = vm.CategoryId; _repository.Update(payment); return(RedirectToAction("Index")); }
public IActionResult Add(CreateEditPaymentViewModel vm) { _repository.Add(new Payment { Amount = vm.Amount, CategoryId = vm.CategoryId, Description = vm.Description, UserId = User.Identity.Name, }); return(RedirectToAction("Index")); }