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"));
        }
Example #2
0
        public ActionResult Delete(int id)
        {
            bool isSuccess = categoryService.DeleteCategory(id);

            if (!isSuccess)
            {
                ModelState.AddModelError("ServerError", "Delete brand fail!");
            }
            return(RedirectToAction("Index"));
        }