⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defaultpostsettings.aspx.cs

📁 community server 源码
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Controls;
using CommunityServer.Components;
using CommunityServer.ControlPanel.UI;
using CommunityServer.Controls;
using ResourceLinkButton = CommunityServer.ControlPanel.Controls.ResourceLinkButton;
using ResourceManager = CommunityServer.ControlPanel.Components.ResourceManager;

namespace CommunityServer.ControlPanel.Galleries.Options
{
	/// <summary>
	/// Summary description for PostOptionsPage.
	/// </summary>
	public class DefaultPostSettings : BaseGalleryPage
	{

		#region Child Controls

		protected StatusMessage Status;
		protected YesNoRadioButtonList ynEnableReplies;
        protected YesNoRadioButtonList ynEnableRatings;
        protected YesNoRadioButtonList ynEnableTrackbacks;
		protected YesNoRadioButtonList ynAggregatePost;
		protected YesNoRadioButtonList ynCommunity;
		protected YesNoRadioButtonList ynEnableOrderPrints;
		protected YesNoRadioButtonList ynSyndicateExcerpt;
        protected CommentModerationDropDownList ModerationDDL;
		protected FeedbackNotificationDropDownList NotificationType;
		protected ResourceLinkButton SaveButton;

		#endregion

        override protected void OnInit(EventArgs e)
        {
            this.Load += new System.EventHandler(this.Page_Load);
            this.SaveButton.Click += new EventHandler(SaveButton_Click);
            base.OnInit(e);
        }

        
        private void Page_Load(object sender, EventArgs e)
		{
  
			if(!IsPostBack)
            {
                ynEnableReplies.SelectedValue = CurrentGallery.EnableComments;
                ynEnableRatings.SelectedValue = CurrentGallery.EnableRatings;
                ynEnableTrackbacks.SelectedValue = CurrentGallery.EnableTrackbacks;
				ynEnableOrderPrints.SelectedValue = CurrentGallery.EnableOrderPrints;
				ynAggregatePost.SelectedValue = CurrentGallery.EnablePostAggregationDefault;
                ynCommunity.SelectedValue = CurrentGallery.EnableCommunityParticipationDefault;
                ynSyndicateExcerpt.SelectedValue = CurrentGallery.SyndicateExcerptDefault;

                ListItem li = ModerationDDL.Items.FindByValue(CurrentGallery.ModerationTypeDefault.ToString());
                if(li != null)
                    li.Selected = true;

				NotificationType.SelectedValue = CurrentGallery.FeedbackNotificationType;

            }
		}

        private void SaveButton_Click(object sender, EventArgs e)
        {
            if(Page.IsValid)
            {

                
				CurrentGallery.EnableCommentsDefault = ynEnableReplies.SelectedValue;
                CurrentGallery.EnableRatingsDefault = ynEnableRatings.SelectedValue;
                CurrentGallery.EnableTrackbacksDefault = ynEnableTrackbacks.SelectedValue;
				CurrentGallery.EnableOrderPrints = ynEnableOrderPrints.SelectedValue;
				CurrentGallery.EnablePostAggregationDefault = ynAggregatePost.SelectedValue;
                CurrentGallery.EnableCommunityParticipationDefault = ynCommunity.SelectedValue;
                CurrentGallery.SyndicateExcerptDefault = ynSyndicateExcerpt.SelectedValue;

                CurrentGallery.ModerationTypeDefault = (CommentModerationType) Enum.Parse(typeof(CommentModerationType),ModerationDDL.SelectedValue);
				CurrentGallery.FeedbackNotificationType = NotificationType.SelectedValue;

            	CommunityServer.Galleries.Galleries.Update(CurrentGallery);

				Status.Success = true;
				// Status.Text = "Your changes have been saved successfully";
				Status.Visible = true;

            }
        }



    }
}

⌨️ 快捷键说明

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