📄 rolemembersview.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;using System.Web.UI;using System.Web.UI.WebControls;using CommunityServer.Components;namespace CommunityServer.Discussions.Controls
{
/// <summary>
/// This server control is used to display all the members of the current forum.
/// </summary>
[
ParseChildren(true)
]
public class RoleMembersView : ForumMembersView
{
CSContext csContext = CSContext.Current;
Role role;
// *********************************************************************
// RoleMembersView
//
/// <summary>
/// Constructor
/// </summary>
///
// ********************************************************************/
public RoleMembersView() : base()
{
role = Roles.GetRole( new Guid(Context.Request.QueryString["Role"]));
}
// *********************************************************************
// InitializeControlTemplate
//
/// <summary>
/// Initializes the user control loaded in CreateChildControls. Initialization
/// consists of finding well known control names and wiring up any necessary events.
/// </summary>
///
// ********************************************************************/
override protected void InitializeSkin(Control skin)
{
// Set the title and description
//
sectionTitle = (Label) skin.FindControl("SectionTitle");
sectionTitle.Text = string.Format(ResourceManager.GetString("RoleMembers_Title"), role.Name);
sectionDescription = (Label) skin.FindControl("SectionDescription");
sectionDescription.Text = ((role.Description != string.Empty) ? role.Description : "") + ResourceManager.GetString("RoleMembers_Description");
// Disable the alpha picker
//
EnableAlphaPicker = false;
base.InitializeSkin(skin);
}
public override void DataBind()
{
UserSet userSet = Roles.UsersInRole(pager.PageIndex, pager.PageSize, sort.SelectedSortOrder, sortOrder.SelectedValue, role.RoleID);
// Do we have data to display?
//
if (!userSet.HasResults)
Page.Response.Redirect( Globals.GetSiteUrls().Message(CSExceptionType.UserSearchNotFound), true );
userList.DataSource = userSet.Users;
userList.DataBind();
pager.TotalRecords = currentPage.TotalRecords = userSet.TotalRecords;
currentPage.TotalPages = pager.CalculateTotalPages();
currentPage.PageIndex = pager.PageIndex;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -