public IActionResult DeleteOutlet(int Id) { var outlet = _outletData.GetOutlet(Id); if (outlet != null) { _outletData.DeleteOutlet(outlet); return(Ok("{ \"response\":\"deleted\"}")); } return(NotFound(" { \"response\": \"Outlet with Id: " + Id + " was not found\" }")); }
public ActionResult Delete(int id) { int result = 0; if (UserRolePermissionForPage.Delete == true) { result = _iCommonService.GetValidateReference("Outlet", id.ToString()); if (result > 0) { return(RedirectToAction(nameof(Index), new { noDelete = result })); } else { var deletedid = _iOutletService.DeleteOutlet(id); return(RedirectToAction(nameof(Index))); } } else { return(RedirectToAction("NotFound", "Error")); } }
public bool Delete(int id) { var response = _outletservice.DeleteOutlet(id); return(response); }