Example #1
0
 public ActionResult DeleteTransaction(TransactionModel transaction)
 {
     if (transaction == null)
     {
         ModelState.AddModelError("InvalidRequest", "Invalid transaction");
     }
     if (ModelState.IsValid)
     {
         _transactionsService.DeleteTransaction(transaction.Id);
     }
     return(RedirectToAction("ViewTransactions", "Transactions"));
 }
Example #2
0
        public async Task <ActionResult> DeleteTransaction(int id)
        {
            await _transactionsService.DeleteTransaction(id, CurrentUserId);

            return(new JsonNetResult(true));
        }