[Authorize(Roles = "Administrator")] // Secure to administrators only public ActionResult Register(GroupViewModel groupList) { GroupQuery groupQuery = new GroupQuery(); ViewData["GroupList"] = new Group(); ViewData["GroupList"] = groupQuery.GetAllGroups(); return(View()); }
public ActionResult ChangeGroup(ChangeGroupViewModel model) { if (ModelState.IsValid) { ViewData["UserID"] = model.UserID; ViewData["EditGroupID"] = model.GroupID; GroupQuery groupQuery = new GroupQuery(); ViewData["GroupList"] = groupQuery.GetAllGroups(); return(View()); } else { return(RedirectToAction("ShowUsers", "Account")); } }