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

📄 commentmanage.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
    using PowerEasy.AccessManage;
    using PowerEasy.Common;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.Enumerations;
    using PowerEasy.Model.Contents;
    using PowerEasy.Web.UI;
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web.UI.WebControls;

    public class CommentManage : AdminPage
    {
        protected Button BtnSubmit1;
        protected Button BtnSubmit2;
        protected Button BtnSubmit3;
        private string commonlink = ("CommentID=" + BasePage.RequestInt32("CommentID").ToString() + "&GeneralID=" + BasePage.RequestInt32("GeneralID").ToString() + "&NodeID=" + BasePage.RequestInt32("NodeID").ToString() + "&Title=" + BasePage.RequestInt32("Title").ToString());
        protected HiddenField HdnSearchType;
        protected Label LblCommontBottom2;
        protected LinkButton LbtnAllComment;
        protected LinkButton LbtnuditedComment;
        protected LinkButton LbtnUNAuditedComment;
        private bool m_Administrator;
        private string m_NodeCommentCheck = "";
        private string m_NodeCommentManage = "";
        private string m_NodeCommentReply = "";
        private int m_PrevId;
        protected AspNetPager Pager;
        protected Repeater RptCommentList;
        protected ExtendedSiteMapPath SmpNavigator;

        protected void BtnAllComment_Click(object sender, EventArgs e)
        {
            this.HdnSearchType.Value = "0";
            this.CommentBindData();
        }

        protected void BtnAuditedComment_Click(object sender, EventArgs e)
        {
            this.HdnSearchType.Value = "1";
            this.CommentBindData();
        }

        protected void BtnSubmit1_Click(object sender, EventArgs e)
        {
            if (Comment.Delete(base.Request.Form["CommentID"]))
            {
                AdminPage.WriteSuccessMsg("<li>删除指定评论成功!</li>", "CommentManage.aspx?" + this.commonlink);
            }
            else
            {
                AdminPage.WriteSuccessMsg("<li>删除指定评论失败!</li>");
            }
        }

        protected void BtnSubmit2_Click(object sender, EventArgs e)
        {
            if (Comment.SetStatus(base.Request.Form["CommentID"], true))
            {
                AdminPage.WriteSuccessMsg("<li>指定信息评论审核成功!</li>", "CommentManage.aspx?" + this.commonlink);
            }
        }

        protected void BtnSubmit3_Click(object sender, EventArgs e)
        {
            if (Comment.SetStatus(base.Request.Form["CommentID"], false))
            {
                AdminPage.WriteSuccessMsg("<li>已取消指定评论审核!</li>", "CommentManage.aspx?" + this.commonlink);
            }
        }

        protected void BtnUNAuditedComment_Click(object sender, EventArgs e)
        {
            this.HdnSearchType.Value = "2";
            this.CommentBindData();
        }

        private string CheckCommentPermissions(string nodeIds, string rolesNodeIds, string href)
        {
            string str = href;
            if (!this.m_Administrator && !RolePermissions.CheckNodePurview(nodeIds, rolesNodeIds))
            {
                str = " disabled='true'";
            }
            return str;
        }

        private void CommentBindData()
        {
            this.RptCommentList.DataSource = Comment.GetListByNodeId((this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize, this.Pager.PageSize, BasePage.RequestInt32("NodeID"), DataConverter.CLng(this.HdnSearchType.Value));
            this.Pager.RecordCount = Comment.GetTotalOfCommentInfo();
            this.RptCommentList.DataBind();
        }

        protected void InitComment()
        {
            int commentId = BasePage.RequestInt32("CommentID");
            string str = BasePage.RequestString("Action");
            if (str != null)
            {
                if (!(str == "DelAll"))
                {
                    if (str == "Del")
                    {
                        if (Comment.Delete(commentId))
                        {
                            AdminPage.WriteSuccessMsg("<li>删除指定评论成功!</li>", "CommentManage.aspx?" + this.commonlink);
                        }
                        else
                        {
                            AdminPage.WriteSuccessMsg("<li>删除指定评论失败!</li>");
                        }
                    }
                    else if (str == "CancelPassed")
                    {
                        if (Comment.SetStatus(commentId, false))
                        {
                            AdminPage.WriteSuccessMsg("<li>已取消指定评论审核!</li>", "CommentManage.aspx?" + this.commonlink);
                        }
                    }
                    else if (str == "SetPassed")
                    {
                        if (Comment.SetStatus(commentId, true))
                        {
                            AdminPage.WriteSuccessMsg("<li>指定信息评论审核成功!</li>", "CommentManage.aspx?" + this.commonlink);
                        }
                    }
                    else if (str == "DelReply")
                    {
                        CommentInfo commentInfo = Comment.GetCommentInfo(BasePage.RequestInt32("CommentID"));
                        commentInfo.Reply = "";
                        if (Comment.Update(commentInfo))
                        {
                            AdminPage.WriteSuccessMsg("<li>删除管理员回复成功!</li>", "CommentManage.aspx?" + this.commonlink);
                        }
                    }
                }
                else if (Comment.DeleteByGeneralId(BasePage.RequestInt32("GeneralID")))
                {
                    AdminPage.WriteSuccessMsg("<li>删除该信息的全部评论成功!</li>", "CommentManage.aspx?" + this.commonlink);
                }
                else
                {
                    AdminPage.WriteSuccessMsg("<li>删除指定信息的全部评论失败!</li>");
                }
            }
            this.SmpNavigator.CurrentNode = ShowNodeNavigation(BasePage.RequestInt32("NodeID"));
            this.CommentBindData();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (PEContext.Current.Admin.IsSuperAdmin)
            {
                this.m_Administrator = true;
            }
            if (!this.m_Administrator)
            {
                this.m_NodeCommentReply = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentReply);
                this.m_NodeCommentCheck = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentCheck);
                this.m_NodeCommentManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentManage);
                bool flag = false;
                int nodeId = BasePage.RequestInt32("NodeID");
                if (nodeId > 0)
                {
                    string str = nodeId.ToString();
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        str = str + "," + cacheNodeById.ParentPath;
                    }
                    if (RolePermissions.CheckNodePurview(this.m_NodeCommentManage, str))

⌨️ 快捷键说明

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