Пример #1
0
        [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());
        }
Пример #2
0
 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"));
     }
 }