コード例 #1
0
ファイル: UsersController.cs プロジェクト: BEXIS2/Core
        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 });
        }
コード例 #2
0
ファイル: GroupsController.cs プロジェクト: BEXIS2/Core
        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 });
        }