Exemplo n.º 1
0
        public List <BankAccountModel> DeleteBankAccount(BankAccountModel model)
        {
            _bankAccountRepository.DeleteBankAccount(model.ID);
            var BankAccounts = GetAllBankAccountList(model);

            return(BankAccounts);
        }
        public ActionResult DeleteConfirmed(int?id)
        {
            try
            {
                if (id == null)
                {
                    ViewBag.Error = "Bank account not found. ";
                    return(View("Error"));
                }
                var partnerId = _bAccountRepository.BAccountDetails((int)id).PartnerId;

                _bAccountRepository.DeleteBankAccount((int)id);
                return(RedirectToAction("Details", "Partners", new { id = partnerId }));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }
        }
        public async Task <IActionResult> Delete(int customerId, int Id)
        {
            try
            {
                var BankAccount = await _repository.GetBankAccountAsync(customerId, Id);

                if (BankAccount == null)
                {
                    return(NotFound());
                }

                if (await _repository.DeleteBankAccount(BankAccount))
                {
                    return(Ok());
                }
            }
            catch (Exception e)
            {
                _logger.LogError(e, e.Message);
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Request Failure"));
            }

            return(BadRequest("Failed to delete the BankAccount"));
        }
Exemplo n.º 4
0
 public void DeleteBankAccount(int id)
 {
     _repository.DeleteBankAccount(id);
 }
 public bool DeleteBankAccount(Guid id)
 {
     return(bankAccountRepository.DeleteBankAccount(id));
 }