Example #1
0
 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));
     }
 }
Example #2
0
 public IActionResult DeleteBank(int BankId, Bank bank)
 {
     if (_bankService.DeleteBank(BankId) > 0)
     {
         return(RedirectToAction("Index"));
     }
     return(View(bank));
 }
Example #3
0
 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);
     }
 }
Example #6
0
        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"));
            }
        }
Example #7
0
        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)));
 }
Example #9
0
 public void Delete(int id)
 {
     _BankService.DeleteBank(id);
 }
Example #10
0
 public async Task <IActionResult> DeleteBank([FromBody] Bank bank)
 {
     return(new OkObjectResult(await _bankService.DeleteBank(bank)));
 }
Example #11
0
 public ActionResult Delete(int id)
 {
     _bankService.DeleteBank(id);
     return(new NoContentResult());
 }
Example #12
0
        public ActionResult DeleteConfirmed(int id)
        {
            _bankService.DeleteBank(id);

            return(Content(Url.Action("Index")));
        }
Example #13
0
        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 });
 }