public ActionResult EditGroup(int id) { if (User.Identity.IsAuthenticated && User.IsInRole("Admin")) { Group group = StatementManager.GetGroupById(id); return(View(group)); } return(RedirectToAction("Index", "Home")); }
public ActionResult RemoveGroup(int id) { if (User.Identity.IsAuthenticated && User.IsInRole("Admin")) { return(View(new RemoveGroupViewModel { Id = id, Value = StatementManager.GetGroupById(id).Value })); } return(RedirectToAction("Index", "Home")); }
public ActionResult RemoveGroup(RemoveGroupViewModel model) { if (User.Identity.IsAuthenticated && User.IsInRole("Admin")) { if (StatementManager.GetGroupById(model.Id) != null) { StatementManager.RemoveGroup(model.Id); } return(RedirectToAction("Groups", "Admin")); } return(RedirectToAction("Index", "Home")); }