コード例 #1
0
        /// <summary>
        /// The BindData helper method is used to bind the list of
        /// security roles for this portal to an asp:datalist server control
        /// </summary>
        private void BindData()
        {
            // add the role name to the title
            if (roleId != Guid.Empty)
            {

                AppleseedRoleProvider roleProvider = (AppleseedRoleProvider)System.Web.Security.Roles.Provider;
                AppleseedRole role = roleProvider.GetRoleById(roleId);

                title.InnerText = General.GetString("ROLE_MEMBERSHIP") + role.Name;
            }

            // Get the portal's roles from the database
            UsersDB users = new UsersDB();

            // bind users in role to DataList
            usersInRole.DataSource = users.GetRoleMembers(roleId, this.PortalSettings.PortalAlias);
            usersInRole.DataBind();

            // bind all portal users to dropdownlist
            allUsers.DataSource = users.GetUsers(this.PortalSettings.PortalAlias);
            allUsers.DataBind();
        }