📄 commentrestore.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
using PowerEasy.Components;
using PowerEasy.Contents;
using PowerEasy.Controls;
using PowerEasy.Model.Contents;
using PowerEasy.Web.UI;
using System;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class CommentRestore : AdminPage
{
protected Button BtnReset;
protected Button BtnSubmit;
protected CheckBox ChkReplyIsPrivate;
protected Label LblCommentTitle;
protected Label LblContent;
protected Label LblEmail;
protected Label LblMessage;
protected Label LblPassedItems;
protected Label LblTitle;
protected Label LblUpdateDateTime;
protected Label LblUserExp;
protected Label LblUserFace;
protected Label LblUserName;
protected Label LblUserRegTime;
protected Label LblUserShow;
protected string Path = "";
protected ExtendedSiteMapPath SmpNavigator;
protected TextBox TxtCommentRestore;
protected TextBox TxtCommentTitle;
protected HtmlTableRow UserExp;
protected PowerEasy.Controls.RequiredFieldValidator ValrCommentRestore;
protected PowerEasy.Controls.RequiredFieldValidator ValrCommentTitle;
protected void BtnReset_Click(object sender, EventArgs e)
{
BasePage.ResponseRedirect("CommentManage.aspx?NodeId=" + BasePage.RequestInt32("NodeId").ToString() + "&GeneralId=" + BasePage.RequestInt32("GeneralId").ToString());
}
protected void BtnSubmit_Click(object sender, EventArgs e)
{
CommentInfo commentInfo = new CommentInfo();
commentInfo.CommentId = BasePage.RequestInt32("CommentID");
commentInfo.CommentTitle = this.TxtCommentTitle.Text.Trim();
commentInfo.Reply = this.TxtCommentRestore.Text;
if (!string.IsNullOrEmpty(PEContext.Current.Admin.AdminName))
{
commentInfo.ReplyAdmin = PEContext.Current.Admin.AdminName;
}
else
{
commentInfo.ReplyAdmin = "匿名发表";
}
commentInfo.ReplyDateTime = DateTime.Now;
if (this.ChkReplyIsPrivate.Checked)
{
commentInfo.ReplyIsPrivate = true;
}
else
{
commentInfo.ReplyIsPrivate = false;
}
if (Comment.AdministratorReply(commentInfo))
{
AdminPage.WriteSuccessMsg("<li>回复指定评论成功。</li>", "CommentManage.aspx?NodeId=" + BasePage.RequestInt32("NodeId").ToString() + "&GeneralId=" + BasePage.RequestInt32("GeneralId").ToString());
}
else
{
AdminPage.WriteErrMsg("<li>回复指定失败,请返回。</li>");
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!base.IsPostBack)
{
this.Path = base.BasePath;
this.Path = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + this.Path;
int num = BasePage.RequestInt32("GeneralId");
int commentId = BasePage.RequestInt32("CommentID");
string str = BasePage.RequestString("Title");
if (num == 0)
{
AdminPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回。</li>");
}
else
{
CommentInfo commentInfo = Comment.GetCommentInfo(commentId);
if (BasePage.RequestInt32("UserId") <= 0)
{
this.ChkReplyIsPrivate.Enabled = false;
}
this.LblTitle.Text = str;
if (!string.IsNullOrEmpty(commentInfo.UserFace))
{
this.LblUserFace.Text = string.Concat(new object[] { "<img alt='' src='", commentInfo.UserFace, "' width='", commentInfo.FaceWidth, "' height='", commentInfo.FaceHeight, "' />" });
}
else
{
this.LblUserFace.Text = "<img alt='' src='" + this.Path + "Images/Comment/01.gif' width='80' height='90' />";
}
this.LblUserName.Text = commentInfo.UserName;
this.LblPassedItems.Text = commentInfo.PassedItems.ToString();
this.LblUserExp.Text = commentInfo.UserExp.ToString();
this.LblUserRegTime.Text = commentInfo.UserRegTime.ToString("yyyy-MM-dd");
this.LblMessage.Text = "<a href='../Accessories/MessageSend.aspx?UserName=" + HttpUtility.UrlEncode(commentInfo.UserName) + "'><img alt='发送短信' src='" + this.Path + "Images/Comment/message.gif' border='0' /></a>";
this.LblUserShow.Text = "<a href='../User/UserShow.aspx?UserId=" + commentInfo.UserId.ToString() + "'><img alt='用户信息' src='" + this.Path + "Images/Comment/profile.gif' border='0' /></a>";
this.LblEmail.Text = "<a href='mailto:" + commentInfo.Email + "'><img alt='邮箱' src='" + this.Path + "Images/Comment/email.gif' border='0' /></a>";
this.LblContent.Text = commentInfo.Content;
this.LblUpdateDateTime.Text = commentInfo.UpdateDateTime.ToString("yyyy-MM-dd");
}
if (!SiteConfig.SiteOption.EnablePointMoneyExp)
{
this.UserExp.Style.Add("display", "none");
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -