public ActionResult Edit(int id) { USER User = userModels.GetItem(id); if (Check.checkUserEdit(User)) { ViewBag.Active = "manager"; ViewBag.ListRole = roleModels.GetAllItems(); return(View(User)); } return(RedirectToAction("NotFound", "Error")); }
// GET: ProfileManager public ActionResult Index() { // Show message if (Session["mes"] != null) { ViewBag.message = Session["mes"]; Session.Remove("mes"); } if (Session["mes_er"] != null) { ViewBag.message_er = Session["mes_er"]; Session.Remove("mes_er"); } ViewBag.Active = "manager"; CustomPrincipal prin = (CustomPrincipal)User; USER UserProfile = userModels.GetItem(prin.ID); ViewBag.ListRole = roleModels.GetAllItems(); return(View(UserProfile)); }
public ActionResult Edit(int id) { POST Post = postsModels.GetItem(id); CustomPrincipal prin = (CustomPrincipal)User; if (Check.checkUserEdit(userModels.GetItem(Post.ID_USER))) { ViewBag.ListCategories = categoriesModels.GetAllItem(); ViewBag.Active = "manager"; return(View(Post)); } Session["mes_er"] = "Bạn không đủ quyền"; return(RedirectToAction("Index", "PostManager")); }