moderationhomeadmin.cs

来自「本系统是在asp版《在线文件管理器》的基础上设计制作」· CS 代码 · 共 88 行

CS
88
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;using System.Collections;using System.Web;using System.Web.UI.WebControls;using CommunityServer.Components;using CommunityServer.Controls;
using CommunityServer.Discussions.Components;

namespace CommunityServer.Discussions.Controls 
{
	
    /// <summary>
    /// This control displays the admin section's moderation home content.
    /// </summary>
    public class ModerationHomeAdmin : TemplatedWebControl 
    {

        #region Child Controls

        protected Label	UserWaiting;
        protected Label	PostWaiting;

        #endregion

        protected override String ExternalSkinFileName
        {
            get
            {
                return CreateExternalSkinFileName("Moderation");
            }
        }


        protected override void OnLoad(EventArgs e) 
        {
            if ( !Page.IsPostBack ) 
            {
                this.DataBind();
            }
            base.OnLoad (e);
        }

        protected override void AttachChildControls() 
        {
            UserWaiting = FindControl( "UserWaiting" ) as Label;
            PostWaiting = FindControl( "PostWaiting" ) as Label;
        }

        public override void DataBind() 
        {
            base.DataBind();

            // this function simple binds the basic site stats label controls on the page.
            string[] postWaiting = new string[2];

			
            // Check how many posts are awaiting moderation approval,
            // by looping through and totalling the forums to moderate.
            //
            ArrayList forumsToModerate = Moderate.GetForumsToModerate();

            int totalPosts = 0;
            foreach (Forum f in forumsToModerate) 
            {
                totalPosts += f.PostsToModerate;
            }

            postWaiting[0] = totalPosts.ToString();
            postWaiting[1] = ResourceManager.GetString("Moderation");


            // finally we format language text, and format
            // the data elements.
            //
            PostWaiting.Text = String.Format( ResourceManager.GetString("Admin_Home_PostWaiting"), postWaiting);

        }

    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?