public IActionResult DeleteQClass(long id) { string user; string Uid; Request.Cookies.TryGetValue("User", out user); Request.Cookies.TryGetValue("Uid", out Uid); if (user == null || Uid == null) { return(RedirectToAction("Login", "Home")); } var u = _UserService.InspectGuid(new TGuid { User = user, Uid = Uid, }); if (u == null) { return(RedirectToAction("Login", "Home")); } if (u.Role != Role.SuperAdmin) { return(View("DeleteError")); } _ExamService.DeleteQClassById(id); return(RedirectToAction(nameof(Index))); }