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" })); }
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)); }
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)); }
public static void DeleteBankAccount(string id) { bankAccountService.Delete(id, AuthenticationHelper.CompanyId.Value); }
public IActionResult Delete(int id) { _bankAccountService.Delete(User.Identity.GetUserId(), id); return(Ok()); }
public IActionResult Delete(int id) { _bankAccountService.Delete(id); return(Ok()); }