📄 deletelinkcommand.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using CommunityServer.Blogs.Controls;
using CommunityServer.Components;
using CommunityServer.Controls;
namespace CommunityServer.ControlPanel.Blogs
{
/// <summary>
/// Summary description for DeleteLinkCommand.
/// </summary>
public class DeleteLinkCommand : BlogCommand
{
public DeleteLinkCommand()
{
}
public override string Title
{
get
{
return "Delete Link";
}
}
public override string Message(BlogCommandPage page)
{
LinkCategory lc = LinkCategories.GetCategory(Int32.Parse(page.Request.QueryString["CategoryID"]),page.CurrentWeblog.SectionID,true);
Link l = Links.GetLink(Int32.Parse(page.Request.QueryString["LinkID"]),lc.LinkCategoryID,true);
return "Are you sure you want to delete the link <strong>" + l.Title + "</strong>? This action can not be undone";
}
public override void Action(BlogCommandPage page)
{
if(page.IsValid)
{
LinkCategory lc = LinkCategories.GetCategory(Int32.Parse(page.Request.QueryString["CategoryID"]),page.CurrentWeblog.SectionID,true);
Link l = Links.GetLink(Int32.Parse(page.Request.QueryString["LinkID"]),lc.LinkCategoryID,true);
if(l != null)
{
Links.DeleteLink(l.LinkID,lc.LinkCategoryID);
}
}
}
public override void CloseScript(BlogCommandPage page)
{
Modal.ClosePage(page.Page,"true") ;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -