public ActionResult Delete(int id) { var isAdmin = User.IsInRole("Administrator"); string deleteBy = User.Identity.GetUserName(); bool isSuccess = categoryService.DeleteCategory(id, deleteBy, isAdmin); if (!isSuccess) { ModelState.AddModelError("ServerError", "Delete brand fail!"); } return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { bool isSuccess = categoryService.DeleteCategory(id); if (!isSuccess) { ModelState.AddModelError("ServerError", "Delete brand fail!"); } return(RedirectToAction("Index")); }