📄 gallerydeletecategorycommand.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using CommunityServer.Components;
namespace CommunityServer.ControlPanel.Photos
{
public class GalleryDeleteCategoryCommand : GalleryCommand
{
public override string Message(GalleryCommandPage 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(GalleryCommandPage page)
{
PostCategory pc = GetCategory(page);
PostCategories.DeleteCategory(pc.CategoryID,pc.SectionID);
}
protected PostCategory GetCategory(GalleryCommandPage page)
{
PostCategory pc = PostCategories.GetCategory(Int32.Parse(page.Request.QueryString["CategoryID"]),page.CurrentGallery.SectionID,true);
if(pc.SectionID != page.CurrentGallery.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 + -