public IActionResult Edit(Expense expense)
 {
     if (ModelState.IsValid)
     {
         _expenseRepository.EditExpense(expense);
         return(RedirectToAction(nameof(Index)));
     }
     return(View(expense));
 }
예제 #2
0
        public ActionResult Edit(int id, [Bind("Id,Name,Payee,Amount")] Expense expense)
        {
            if (id != expense.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                _expenseRepository.EditExpense(expense);
                return(RedirectToAction(nameof(Index)));
            }
            return(View(expense));
        }
예제 #3
0
 public Task EditExpenseAsync(ExpenseDto expense)
 {
     //TODO : Charges should be recalculate after a change in expense
     return(_expenseRepository.EditExpense(expense));
 }
예제 #4
0
 public ActionResult <Expense> EditExpense(int id, AddExpense addExpense)
 {
     _expenseRepository.EditExpense(id, addExpense);
     return(Ok());
 }