public ActionResult DeleteExpense(string id) { var expenseRepository = new ExpenseRepository(); expenseRepository.DeleteExpense(Convert.ToInt32(id)); return(RedirectToAction("ExpenseManager")); }
public IActionResult DeleteExpense(Guid id) { var accountId = HttpContext.Session.Get <long>(SessionHelper.SessionKeyAccountId); if (accountId == default) { return(RedirectToAction("Login", "Account", new { id = LoginHelper.BudgetApp })); } if (id == default || id == Guid.Empty) { return(RedirectToAction("ExpenseSummary", "Expense")); } ExpenseRepository.DeleteExpense(id); return(RedirectToAction("ExpenseSummary", "Expense")); }