Beispiel #1
0
        public async Task <ActionResult> Delete(AccountViewModel vm)
        {
            AccountDto toDelete = Mapper.Map <AccountViewModel, AccountDto>(vm);
            await _accountRepo.Delete(toDelete.Id);

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        private void BtnDeleteAccount_Click(object sender, RoutedEventArgs e)
        {
            AccountDto accountDto = GetClickedAccount(sender);

            try
            {
                _accountRepo.Delete(accountDto.Id);
            }
            catch
            {
                MessageBox.Show("Unable to delete account. It has been used for other transactions.");
            }

            InitializeAccounts();
        }