Ejemplo n.º 1
0
        public ActionResult Delete(Guid id)
        {
            var result = bankAccountService.Delete(id);

            if (result)
            {
                return(StatusCode(204));
            }

            return(NotFound());
        }
        public IActionResult Delete(int no)
        {
            Customer customer = customerService.Get(User.Identity.Name);

            BankAccount bankAccount = bankAccountService.Get(no, customer.No);

            if (bankAccount.Balance > 0)
            {
                return(Ok(new { status = "failed", message = "Lütfen hesabın bakiyesini sıfırlayın." }));
            }

            bankAccountService.Delete(no, customer.No);

            return(Ok(new { status = "success" }));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Delete(int id)
        {
            var viewModel = new BankAccountListViewModel();

            try
            {
                await _bankAccountService.Delete(id);

                viewModel.BankAccounts = await _bankAccountService.GetAll();
            }
            catch (Exception e)
            {
                viewModel.Error = new Shared.Models.GackoError(e);
            }
            return(View("Index", viewModel));
        }
Ejemplo n.º 4
0
        public Task <BaseResponse> Delete(int Id)
        {
            var response = new BaseResponse();

            TryCatch(() =>
            {
                var model = bankAccountService.GetById(Id);
                if (model == null)
                {
                    throw new ErrorCodeException(ErrorCodeDefine.GET_BANK_ACCOUNT);
                }

                bankAccountService.Delete(model);
                unitOfWork.Commit();
                response.Successful();
            }, response);
            return(Task.FromResult(response));
        }
Ejemplo n.º 5
0
 public static void DeleteBankAccount(string id)
 {
     bankAccountService.Delete(id, AuthenticationHelper.CompanyId.Value);
 }
Ejemplo n.º 6
0
 public IActionResult Delete(int id)
 {
     _bankAccountService.Delete(User.Identity.GetUserId(), id);
     return(Ok());
 }
Ejemplo n.º 7
0
 public IActionResult Delete(int id)
 {
     _bankAccountService.Delete(id);
     return(Ok());
 }