Пример #1
0
        /// <summary>
        /// Gets the list of items to show in the table, according to the specifed first and max items.
        /// </summary>
        /// <returns></returns>
        protected override IList <AuthorityGroupSummary> ListItems(int firstRow, int maxRows)
        {
            var request = new ListAuthorityGroupsRequest
            {
                Page = { FirstRow = firstRow, MaxRows = maxRows }
            };

            ListAuthorityGroupsResponse listResponse = null;

            Platform.GetService(
                delegate(IAuthorityGroupAdminService service)
            {
                listResponse = service.ListAuthorityGroups(request);
            });

            return(listResponse.AuthorityGroups);
        }
Пример #2
0
        public override void Start()
        {
            // load all auth groups
            Platform.GetService(
                delegate(IAuthorityGroupAdminService service)
            {
                ListAuthorityGroupsResponse authorityGroupsResponse = service.ListAuthorityGroups(new ListAuthorityGroupsRequest());

                _authorityGroups = CollectionUtils.Map(
                    authorityGroupsResponse.AuthorityGroups,
                    delegate(AuthorityGroupSummary summary)
                {
                    return(new AuthorityGroupTableEntry(summary, OnAuthorityGroupChecked));
                });
            });

            // load user
            Platform.GetService(
                delegate(IUserAdminService service)
            {
                if (_isNew)
                {
                    _userDetail = new UserDetail
                    {
                        // Force users to change the password when they log in
                        PasswordExpiryTime = Platform.Time
                    };
                }
                else
                {
                    LoadUserForEditResponse response = service.LoadUserForEdit(new LoadUserForEditRequest(_userName));
                    _userDetail = response.UserDetail;
                }
            });

            InitialiseTable();

            base.Start();
        }