⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commentexcerpt.aspx.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
    using PowerEasy.Common;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.Model.Contents;
    using PowerEasy.Web.UI;
    using PowerEasy.WebSite.Controls;
    using System;
    using System.Web;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class CommentExcerpt : AdminPage
    {
        protected Button BtnReset;
        protected Button BtnSubmit;
        protected CheckBox ChkIsPrivate;
        protected Label lblCommentTime;
        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 RadioButtonList RadlPosition;
        protected PowerEasy.WebSite.Controls.ScoreControl ScoreControl;
        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("ContentView.aspx?GeneralId=" + BasePage.RequestInt32("GeneralId").ToString());
        }

        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            CommentInfo commentInfo = new CommentInfo();
            commentInfo.CommentTitle = this.TxtCommentTitle.Text.Trim();
            commentInfo.GeneralId = BasePage.RequestInt32("GeneralId");
            commentInfo.TopicId = 1;
            commentInfo.NodeId = 0;
            commentInfo.Content = this.TxtCommentRestore.Text;
            commentInfo.UpdateDateTime = DateTime.Now;
            commentInfo.Score = this.ScoreControl.Score;
            commentInfo.Position = DataConverter.CLng(this.RadlPosition.SelectedValue);
            commentInfo.Status = true;
            commentInfo.IP = PEContext.Current.UserHostAddress;
            if (this.ChkIsPrivate.Checked)
            {
                commentInfo.IsPrivate = true;
            }
            else
            {
                commentInfo.IsPrivate = false;
            }
            if (!string.IsNullOrEmpty(PEContext.Current.Admin.UserName))
            {
                commentInfo.UserName = PEContext.Current.Admin.UserName;
            }
            else
            {
                commentInfo.UserName = "匿名发表";
            }
            commentInfo.Face = "";
            if (Comment.Add(commentInfo))
            {
                AdminPage.WriteSuccessMsg("<li>添加评论成功!</li>", "ContentView.aspx?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 extendCommentInfo = Comment.GetExtendCommentInfo(commentId);
                    this.LblTitle.Text = str;
                    if (!string.IsNullOrEmpty(extendCommentInfo.UserFace))
                    {
                        this.LblUserFace.Text = string.Concat(new object[] { "<img alt='' src='", extendCommentInfo.UserFace, "' width='", extendCommentInfo.FaceWidth, "' height='", extendCommentInfo.FaceHeight, "' />" });
                    }
                    else
                    {
                        this.LblUserFace.Text = "<img alt='' src='" + this.Path + "Images/Comment/01.gif' width='80' height='90' />";
                    }
                    this.LblUserName.Text = extendCommentInfo.UserName;
                    this.LblPassedItems.Text = extendCommentInfo.PassedItems.ToString();
                    this.LblUserExp.Text = extendCommentInfo.UserExp.ToString();
                    this.LblUserRegTime.Text = extendCommentInfo.UserRegTime.ToString("yyyy-MM-dd");
                    this.LblMessage.Text = "<a href='../Accessories/MessageSend.aspx?UserName=" + HttpUtility.UrlEncode(extendCommentInfo.UserName) + "'><img alt='发送短信' src='" + this.Path + "Images/Comment/message.gif' border='0' /></a>";
                    this.LblUserShow.Text = "<a href='../User/UserShow.aspx?UserId=" + extendCommentInfo.UserId.ToString() + "'><img alt='用户信息' src='" + this.Path + "Images/Comment/profile.gif' border='0' /></a>";
                    this.LblEmail.Text = "<a href='mailto:" + extendCommentInfo.Email + "'><img alt='邮箱' src='" + this.Path + "Images/Comment/email.gif' border='0' /></a>";
                    this.LblContent.Text = extendCommentInfo.Content;
                    this.lblCommentTime.Text = " <img src='" + this.Path + "Images/Comment/ip.gif' alt='评论发布时间' />";
                    this.LblUpdateDateTime.Text = extendCommentInfo.UpdateDateTime.ToString("yyyy-MM-dd");
                    this.TxtCommentTitle.Text = extendCommentInfo.CommentTitle;
                    this.TxtCommentRestore.Text = extendCommentInfo.Content;
                }
                if (!SiteConfig.SiteOption.EnablePointMoneyExp)
                {
                    this.UserExp.Style.Add("display", "none");
                }
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -