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

📄 deletecategorycommand.cs

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

using System;
using CommunityServer.Components;

namespace CommunityServer.ControlPanel.Blogs
{
    public class DeleteCategoryCommand : BlogCommand
    {
        public override string Message(BlogCommandPage page)
        {
            PostCategory pc = GetCategory(page);

            return "Are you sure you want to the category <strong>" + pc.Name + "</strong>? This action can not be undone.";
        }

        public override void Action(BlogCommandPage page)
        {
            PostCategory pc = GetCategory(page);
            PostCategories.DeleteCategory(pc.CategoryID,pc.SectionID);
        }

        protected PostCategory GetCategory(BlogCommandPage page)
        {
            PostCategory pc = PostCategories.GetCategory(Int32.Parse(page.Request.QueryString["CategoryID"]),page.CurrentWeblog.SectionID);
            if(pc.SectionID != page.CurrentWeblog.SectionID)
                throw new CSException(CSExceptionType.SectionNotFound);

            return pc;
        }

        public override string Title
        {
            get { return "Delete Category";}
        }

//		public override string CloseScript(BlogCommandPage page)
//		{
//			return "alert('I am overriden'); " + base.CloseScript (page);
//		}

    }
}

⌨️ 快捷键说明

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