public HttpResponseMessage DeleteBanks(BankModel aBankModel) { try { if (this.ModelState.IsValid) { var result = service.DeleteBank(aBankModel); if (result != null) { return(Request.CreateResponse(HttpStatusCode.OK, result)); } else { string message = "Not deleted successfully"; return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, message)); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } }
public IActionResult DeleteBank(int BankId, Bank bank) { if (_bankService.DeleteBank(BankId) > 0) { return(RedirectToAction("Index")); } return(View(bank)); }
public ActionResult Delete([DataSourceRequest] DataSourceRequest request, BankModel model) { if (model != null) { var bank = _bankService.GetBankById(model.Id); _bankService.DeleteBank(bank); } return(Json(new[] { model }.ToDataSourceResult(request, ModelState))); }
public IActionResult Delete(int id) { SaveResult <BankViewModel> result = _bankService.DeleteBank(id); if (!result.IsSuccess) { ModelState.AddModelError("Create", result.Message); } return(RedirectToAction("Index")); }
public async Task<JsonResult> SetBankDeleted(int id) { try { await Task.Run(() => bankService.DeleteBank(id, "SYSTEM")); return Json("OK", JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(ex.Message, JsonRequestBehavior.AllowGet); } }
public ActionResult Delete(int id) { int result = 0; if (UserRolePermissionForPage.Delete == true) { result = _iCommonService.GetValidateReference("Bank", id.ToString()); if (result > 0) { return(RedirectToAction(nameof(Index), new { noDelete = result })); } else { var deletedid = _iBankService.DeleteBank(id); return(RedirectToAction(nameof(Index))); } } else { return(RedirectToAction("NotFound", "Error")); } }
public IActionResult Delete(int id) { try { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(AccessDeniedView()); } var bank = _bankService.GetBankById(id); if (bank == null) { return(RedirectToAction("Configure")); } _bankService.DeleteBank(bank); return(new NullJsonResult()); } catch (Exception ex) { throw new NopException(ex.Message, ex); } }
public ActionResult Delete(int id) { return(new JsonResult(_bankService.DeleteBank(id))); }
public void Delete(int id) { _BankService.DeleteBank(id); }
public async Task <IActionResult> DeleteBank([FromBody] Bank bank) { return(new OkObjectResult(await _bankService.DeleteBank(bank))); }
public ActionResult Delete(int id) { _bankService.DeleteBank(id); return(new NoContentResult()); }
public ActionResult DeleteConfirmed(int id) { _bankService.DeleteBank(id); return(Content(Url.Action("Index"))); }
public async Task <IActionResult> DeleteBank(int Id) { await _bankService.DeleteBank(Id); return(Ok()); }
public ActionResult DeleteBank(int bankId, int branchId) { _bankService.DeleteBank(bankId); return RedirectToAction("BanksList", new { branchId = branchId }); }