当前位置: 首页>>代码示例>>C#>>正文


C# RoleController.GetUserRolesByRoleName方法代码示例

本文整理汇总了C#中DotNetNuke.Security.Roles.RoleController.GetUserRolesByRoleName方法的典型用法代码示例。如果您正苦于以下问题:C# RoleController.GetUserRolesByRoleName方法的具体用法?C# RoleController.GetUserRolesByRoleName怎么用?C# RoleController.GetUserRolesByRoleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Security.Roles.RoleController的用法示例。


在下文中一共展示了RoleController.GetUserRolesByRoleName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindPortal

        private void BindPortal(int portalId, string activeLanguage)
        {
            var portalController = new PortalController();
            var portal = portalController.GetPortal(portalId, activeLanguage);

            BindDetails(portal);

            BindMarketing(portal);

            ctlLogo.FilePath = portal.LogoFile;
            ctlLogo.FileFilter = Globals.glbImageFileTypes;
            ctlBackground.FilePath = portal.BackgroundFile;
            ctlBackground.FileFilter = Globals.glbImageFileTypes;
            ctlFavIcon.FilePath = new FavIcon(portal.PortalID).GetSettingPath();
            chkSkinWidgestEnabled.Checked = PortalController.GetPortalSettingAsBoolean("EnableSkinWidgets", portalId, true);

            BindSkins(portal);

            BindPages(portal, activeLanguage);

            lblHomeDirectory.Text = portal.HomeDirectory;

            optUserRegistration.SelectedIndex = portal.UserRegistration;

            BindPaymentProcessor(portal);

            BindUsability(portal);

            var roleController = new RoleController();
            cboAdministratorId.DataSource = roleController.GetUserRolesByRoleName(portalId, portal.AdministratorRoleName);
            cboAdministratorId.DataBind(portal.AdministratorId.ToString());

            //PortalSettings for portal being edited
            var portalSettings = new PortalSettings(portal);

            cboTimeZone.DataBind(portalSettings.TimeZone.Id);

            if (UserInfo.IsSuperUser)
            {
                BindAliases(portal);

                BindSSLSettings(portal);

                BindHostSettings(portal);
            }

            LoadStyleSheet(portal);

            ctlAudit.Entity = portal;
        }
开发者ID:patonomatic,项目名称:VUWTC,代码行数:50,代码来源:SiteSettings.ascx.cs

示例2: Page_Load

        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <history>
        /// 	[cnurse]	9/8/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        protected void Page_Load( Object sender, EventArgs e )
        {
            try
            {
                if( ( Request.QueryString["pid"] != null ) && ( PortalSettings.ActiveTab.ParentId == PortalSettings.SuperTabId || UserInfo.IsSuperUser ) )
                {
                    intPortalId = int.Parse( Request.QueryString["pid"] );
                    ctlLogo.ShowUpLoad = false;
                    ctlBackground.ShowUpLoad = false;
                }
                else
                {
                    intPortalId = PortalId;
                    ctlLogo.ShowUpLoad = true;
                    ctlBackground.ShowUpLoad = true;
                }

                //this needs to execute always to the client script code is registred in InvokePopupCal
                cmdExpiryCalendar.NavigateUrl = Calendar.InvokePopupCal( txtExpiryDate );
                ClientAPI.AddButtonConfirm( cmdRestore, Localization.GetString( "RestoreCCSMessage", LocalResourceFile ) );

                // If this is the first visit to the page, populate the site data
                if( Page.IsPostBack == false )
                {
                    ClientAPI.AddButtonConfirm( cmdDelete, Localization.GetString( "DeleteMessage", LocalResourceFile ) );

                    PortalController objPortalController = new PortalController();
                    ListController ctlList = new ListController();
                    ListEntryInfoCollection colProcessor = ctlList.GetListEntryInfoCollection( "Processor" );

                    cboProcessor.DataSource = colProcessor;
                    cboProcessor.DataBind();
                    cboProcessor.Items.Insert( 0, new ListItem( "<" + Localization.GetString( "None_Specified" ) + ">", "" ) );

                    PortalInfo objPortal = objPortalController.GetPortal( intPortalId );

                    txtPortalName.Text = objPortal.PortalName;
                    ctlLogo.Url = objPortal.LogoFile;
                    ctlLogo.FileFilter = Globals.glbImageFileTypes;
                    txtDescription.Text = objPortal.Description;
                    txtKeyWords.Text = objPortal.KeyWords;
                    ctlBackground.Url = objPortal.BackgroundFile;
                    ctlBackground.FileFilter = Globals.glbImageFileTypes;
                    txtFooterText.Text = objPortal.FooterText;
                    optUserRegistration.SelectedIndex = objPortal.UserRegistration;
                    optBannerAdvertising.SelectedIndex = objPortal.BannerAdvertising;

                    cboSplashTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false );
                    cboSplashTabId.DataBind();
                    if( cboSplashTabId.Items.FindByValue( objPortal.SplashTabId.ToString() ) != null )
                    {
                        cboSplashTabId.Items.FindByValue( objPortal.SplashTabId.ToString() ).Selected = true;
                    }
                    cboHomeTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false );
                    cboHomeTabId.DataBind();
                    if( cboHomeTabId.Items.FindByValue( objPortal.HomeTabId.ToString() ) != null )
                    {
                        cboHomeTabId.Items.FindByValue( objPortal.HomeTabId.ToString() ).Selected = true;
                    }
                    cboLoginTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false );
                    cboLoginTabId.DataBind();
                    if( cboLoginTabId.Items.FindByValue( objPortal.LoginTabId.ToString() ) != null )
                    {
                        cboLoginTabId.Items.FindByValue( objPortal.LoginTabId.ToString() ).Selected = true;
                    }
                    cboUserTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false );
                    cboUserTabId.DataBind();
                    if( cboUserTabId.Items.FindByValue( objPortal.UserTabId.ToString() ) != null )
                    {
                        cboUserTabId.Items.FindByValue( objPortal.UserTabId.ToString() ).Selected = true;
                    }

                    ListEntryInfoCollection colList = ctlList.GetListEntryInfoCollection( "Currency" );

                    cboCurrency.DataSource = colList;
                    cboCurrency.DataBind();
                    if( Null.IsNull( objPortal.Currency ) || cboCurrency.Items.FindByValue( objPortal.Currency ) == null )
                    {
                        cboCurrency.Items.FindByValue( "USD" ).Selected = true;
                    }
                    else
                    {
                        cboCurrency.Items.FindByValue( objPortal.Currency ).Selected = true;
                    }
                    RoleController objRoleController = new RoleController();

                    ArrayList Arr = objRoleController.GetUserRolesByRoleName( intPortalId, objPortal.AdministratorRoleName );
                    int i;
                    for( i = 0; i <= Arr.Count - 1; i++ )
                    {
                        UserRoleInfo objUser = (UserRoleInfo)Arr[i];
                        cboAdministratorId.Items.Add( new ListItem( objUser.FullName, objUser.UserID.ToString() ) );
                    }
//.........这里部分代码省略.........
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:101,代码来源:SiteSettings.ascx.cs

示例3: LoadAuthorsList

        private void LoadAuthorsList()
        {
            var roleController = new RoleController();
            var hostController = HostController.Instance;
            ArrayList authorsList = roleController.GetUserRolesByRoleName(this.PortalId, hostController.GetString(Utility.PublishAuthorRole + this.PortalId));
            ArrayList adminsList = roleController.GetUserRolesByRoleName(this.PortalId, hostController.GetString(Utility.PublishAdminRole + this.PortalId));

            // check to make sure we only add authors who aren't already in the list.
            foreach (UserRoleInfo adminUserRole in adminsList)
            {
                bool located = false;
                foreach (UserRoleInfo authorUserRole in authorsList)
                {
                    if (adminUserRole.UserID == authorUserRole.UserID)
                    {
                        located = true;
                        break;
                    }
                }

                if (!located)
                {
                    authorsList.Add(adminUserRole);
                }
            }

            // sort the author list alphabetically
            authorsList.Sort(new UserRoleInfoComparer(true));
            this.ddlAuthor.DataTextField = "FullName";
            this.ddlAuthor.DataValueField = "UserId";
            this.ddlAuthor.DataSource = authorsList;
            this.ddlAuthor.DataBind();
        }
开发者ID:EngageSoftware,项目名称:Engage-Publish,代码行数:33,代码来源:ItemEdit.ascx.cs

示例4: BindGrid

        /// <summary>
        /// BindGrid loads the data grid from the Database
        /// </summary>
        /// <history>
        /// 	[cnurse]	9/10/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        private void BindGrid()
        {
            RoleController objRoleController = new RoleController();

            if( _roleId != - 1 )
            {
                string RoleName = objRoleController.GetRole( _roleId, PortalId ).RoleName;
                grdUserRoles.DataKeyField = "UserId";
                grdUserRoles.Columns[2].Visible = false;
                grdUserRoles.DataSource = objRoleController.GetUserRolesByRoleName( PortalId, RoleName );
                grdUserRoles.DataBind();
            }
            if( _userId != - 1 )
            {
                UserInfo objUserInfo = UserController.GetUser( PortalId, _userId, false );
                grdUserRoles.DataKeyField = "RoleId";
                grdUserRoles.Columns[1].Visible = false;
                grdUserRoles.DataSource = objRoleController.GetUserRolesByUsername( PortalId, objUserInfo.Username, Null.NullString );
                grdUserRoles.DataBind();
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:28,代码来源:SecurityRoles.ascx.cs

示例5: BindGrid

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// BindGrid loads the data grid from the Database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	9/10/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        private void BindGrid()
        {
            var objRoleController = new RoleController();

            if (RoleId != Null.NullInteger)
            {
                cmdAdd.Text = Localization.GetString("AddUser.Text", LocalResourceFile);
                grdUserRoles.DataKeyField = "UserId";
                grdUserRoles.Columns[2].Visible = false;
                grdUserRoles.DataSource = objRoleController.GetUserRolesByRoleName(PortalId, Role.RoleName);
                grdUserRoles.DataBind();
            }
            if (UserId != -1)
            {
                cmdAdd.Text = Localization.GetString("AddRole.Text", LocalResourceFile);
                grdUserRoles.DataKeyField = "RoleId";
                grdUserRoles.Columns[1].Visible = false;
                grdUserRoles.DataSource = objRoleController.GetUserRolesByUsername(PortalId, User.Username, Null.NullString);
                grdUserRoles.DataBind();
            }
        }
开发者ID:patonomatic,项目名称:VUWTC,代码行数:32,代码来源:SecurityRoles.ascx.cs


注:本文中的DotNetNuke.Security.Roles.RoleController.GetUserRolesByRoleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。