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

📄 deletelinkcategorycommand.cs

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

using System;
using CommunityServer.Components;
using CommunityServer.Controls;

namespace CommunityServer.ControlPanel.Blogs
{
	/// <summary>
	/// Summary description for DeleteLinkCategoryCommand.
	/// </summary>
	public class DeleteLinkCategoryCommand : BlogCommand
	{
		public DeleteLinkCategoryCommand()
		{
		}

	    public override string Message(BlogCommandPage page)
	    {
	        LinkCategory lc = LinkCategories.GetCategory(Int32.Parse(page.Request.QueryString["CategoryID"]),page.CurrentWeblog.SectionID,true);
            if(lc == null)
                throw new Exception("Category does not exist");
            
            return "Are you sure you want to delete <strong>" + lc.Name + "</strong>? All of it's child links will be deleted as well.";
	    }

	    public override void Action(BlogCommandPage page)
	    {
	        LinkCategory lc = LinkCategories.GetCategory(Int32.Parse(page.Request.QueryString["CategoryID"]),page.CurrentWeblog.SectionID,true);
            if(lc == null)
                throw new Exception("Category does not exist");

            LinkCategories.DeleteCategory(lc.LinkCategoryID,page.CurrentWeblog.SectionID);
	    }

        public override void CloseScript(BlogCommandPage page)
        {
        	Modal.ClosePage(page,page.Request.QueryString["CategoryID"]);
        }


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

	}
}

⌨️ 快捷键说明

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