Example #1
0
        public ActionResult Users_Select()
        {
            SubjectManager subjectManager = new SubjectManager();
            List<UserGridRowModel> users = subjectManager.GetAllUsers().Select(u => UserGridRowModel.Convert(u)).ToList();

            return View(new GridModel<UserGridRowModel> { Data = users });
        }
Example #2
0
        public ActionResult Membership_Select(long id, long[] selectedUsers)
        {
            SubjectManager subjectManager = new SubjectManager();

            List<GroupMembershipGridRowModel> users = new List<GroupMembershipGridRowModel>();

            if (selectedUsers != null)
            {
                users = subjectManager.GetAllUsers().Select(u => GroupMembershipGridRowModel.Convert(u, selectedUsers.Contains(u.Id))).ToList();
            }
            else
            {
                Group group = subjectManager.GetGroupById(id);

                users = subjectManager.GetAllUsers().Select(u => GroupMembershipGridRowModel.Convert(u, u.Groups.Any(g => g.Id == id))).ToList();
            }

            return View(new GridModel<GroupMembershipGridRowModel> { Data = users });
        }