📄 commentrestore.cs
字号:
namespace PowerEasy.WebSite.CommentUI
{
using PowerEasy.Common;
using PowerEasy.Components;
using PowerEasy.Contents;
using PowerEasy.Controls;
using PowerEasy.Model.Contents;
using PowerEasy.Web.UI;
using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class CommentRestore : AdminPage
{
protected Button BtnReset;
protected Button BtnSubmit;
protected CheckBox ChkReplyIsPrivate;
protected HtmlForm form1;
protected HtmlHead Head1;
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 TextBox TxtCommentRestore;
protected TextBox TxtCommentTitle;
protected HtmlTableCell UserExp;
protected PowerEasy.Controls.RequiredFieldValidator ValrCommentRestore;
protected PowerEasy.Controls.RequiredFieldValidator ValrCommentTitle;
protected void BtnReset_Click(object sender, EventArgs e)
{
base.Response.Redirect("ContentCommontManage.aspx?GeneralId=" + BasePage.RequestInt32("GeneralId").ToString());
}
protected void BtnSubmit_Click(object sender, EventArgs e)
{
CommentInfo commentInfo = new CommentInfo();
commentInfo.CommentId = BasePage.RequestInt32("CommentID");
commentInfo.CommentTitle = StringHelper.RemoveXss(this.TxtCommentTitle.Text);
commentInfo.Reply = StringHelper.RemoveXss(this.TxtCommentRestore.Text);
if (PEContext.Current.User.Identity.IsAuthenticated)
{
commentInfo.ReplyAdmin = PEContext.Current.User.UserName;
}
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>", "ContentCommontManage.aspx?GeneralId=" + BasePage.RequestInt32("GeneralId").ToString());
}
else
{
AdminPage.WriteErrMsg("<li>回复指定失败,请返回。</li>");
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!base.IsPostBack)
{
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);
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='../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=" + commentInfo.UserName + "'><img alt='发送短信' src='../Images/Comment/message.gif' border='0' /></a>";
this.LblUserShow.Text = "<a href='../User/UserShow.aspx?UserId=" + commentInfo.UserId.ToString() + "'><img alt='用户信息' src='../Images/Comment/profile.gif' border='0' /></a>";
this.LblEmail.Text = "<a href='mailto:" + commentInfo.Email + "'><img alt='邮箱' src='../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 + -