📄 commentreplymodify.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
using PowerEasy.Contents;
using PowerEasy.Controls;
using PowerEasy.Model.Contents;
using PowerEasy.Model.UserManage;
using PowerEasy.UserManage;
using PowerEasy.Web.UI;
using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class CommentReplyModify : AdminPage
{
protected Button BtnReset;
protected Button BtnSubmit;
private string commonlink = ("CommentID=" + BasePage.RequestInt32("CommentID").ToString() + "&GeneralID=" + BasePage.RequestInt32("GeneralID").ToString() + "&NodeID=" + BasePage.RequestInt32("NodeID").ToString() + "&Title=" + BasePage.RequestInt32("Title").ToString());
protected Label LblCommentTitle;
protected Label LblEmail;
protected Label LblScore;
protected Label LblTitle;
protected Label LblUserName;
protected ExtendedSiteMapPath SmpNavigator;
protected HtmlTableRow trEmail;
protected HtmlTableRow trUser;
protected TextBox TxtCommentReply;
protected void BtnReset_Click(object sender, EventArgs e)
{
BasePage.ResponseRedirect("CommentManage.aspx?" + this.commonlink);
}
protected void BtnSubmit_Click(object sender, EventArgs e)
{
if (this.Page.IsValid)
{
CommentInfo commentInfo = Comment.GetCommentInfo(BasePage.RequestInt32("CommentID"));
if (commentInfo.IsNull)
{
AdminPage.WriteErrMsg("<li>该评论不存在,请返回!</li>");
}
commentInfo.Reply = this.TxtCommentReply.Text;
if (Comment.Update(commentInfo))
{
AdminPage.WriteSuccessMsg("<li>管理员修改回复评论成功。</li>", "CommentManage.aspx?" + this.commonlink);
}
else
{
AdminPage.WriteErrMsg("<li>管理员修改回复评论失败,请返回。</li>");
}
}
}
protected void InitComment()
{
CommentInfo commentInfo = Comment.GetCommentInfo(BasePage.RequestInt32("CommentID"));
if (commentInfo.IsNull)
{
AdminPage.WriteErrMsg("<li>该评论不存在,请返回!</li>");
}
if (commentInfo.UserId != 0)
{
UserInfo userById = Users.GetUserById(commentInfo.UserId);
if (userById.IsNull)
{
AdminPage.WriteErrMsg("<li>该评论所属的用户不存在,请返回!</li>");
}
this.LblUserName.Text = userById.UserName;
this.LblEmail.Text = userById.Email;
}
else
{
if (!string.IsNullOrEmpty(commentInfo.UserName))
{
this.LblUserName.Text = commentInfo.UserName;
}
this.LblEmail.Text = commentInfo.Email;
}
this.LblCommentTitle.Text = commentInfo.CommentTitle;
this.LblScore.Text = commentInfo.Score.ToString();
this.TxtCommentReply.Text = commentInfo.Reply;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!base.IsPostBack)
{
this.InitComment();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -