public ActionResult Delete(int id, int accountId) { try { _transactionLogic.DeleteTransaction(id, accountId); _accountLogic.RefreshAccountBalance(accountId); return(RedirectToAction("Index", "Transaction", new { id = accountId })); } catch (Exception e) { Console.WriteLine(e); return(View("Error")); } }
private async void DeleteTransaction(object sender, RoutedEventArgs e) { var element = (FrameworkElement)sender; var transaction = element.DataContext as FinancialTransaction; if (transaction == null) { return; } await TransactionLogic.DeleteTransaction(transaction); AddTransactionView.IsNavigationBlocked = false; }