Ejemplo n.º 1
0
        private void AddPKZone(XmlDocument xmlDoc)
        {
            int num = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//commentid"));

            if (num > 0)
            {
                CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo();
                commentPKZoneInfo.CommentId  = num;
                commentPKZoneInfo.Content    = GetNodeInnerText(xmlDoc, "//content");
                commentPKZoneInfo.Position   = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//position"));
                commentPKZoneInfo.IP         = this.GetClientIP();
                commentPKZoneInfo.UpdateTime = DateTime.Now;
                if (string.IsNullOrEmpty(PEContext.Current.User.UserName))
                {
                    commentPKZoneInfo.UserName = "******";
                }
                else
                {
                    commentPKZoneInfo.UserName = PEContext.Current.User.UserName;
                }
                CommentPKZone.Add(commentPKZoneInfo);
            }
            if (num > 0)
            {
                this.XmlResponseWriter.WriteElementString("status", "ok");
            }
            else
            {
                this.XmlResponseWriter.WriteElementString("status", "err");
            }
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         int    commentId = BasePage.RequestInt32("CommentID");
         string s         = BasePage.RequestString("Title");
         int    num2      = BasePage.RequestInt32("GeneralId");
         if (commentId == 0)
         {
             AdminPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?id=", num2, "&GeneralId=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) }));
         }
         else
         {
             string str5;
             if (((str5 = BasePage.RequestString("Action")) != null) && (str5 == "Delete"))
             {
                 CommentPKZone.Delete(BasePage.RequestInt32("PKId"));
                 AdminPage.WriteSuccessMsg("<li>删除该信息的辩论成功!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?id=", num2, "&GeneralId=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) }));
             }
             string      str2 = CommentPKZone.GetPKCount(commentId, 1).ToString();
             string      str3 = CommentPKZone.GetPKCount(commentId, -1).ToString();
             string      str4 = CommentPKZone.GetPKCount(commentId, 0).ToString();
             CommentInfo extendCommentInfo = Comment.GetExtendCommentInfo(commentId);
             this.LblTitle.Text             = s;
             this.LblUserName.Text          = extendCommentInfo.UserName;
             this.LblContent.Text           = extendCommentInfo.Content;
             this.LblTime.Text              = extendCommentInfo.UpdateDateTime.ToString();
             this.LblSustain.Text           = str2;
             this.LblOppose.Text            = str3;
             this.LblSustain2.Text          = str2;
             this.LblOppose2.Text           = str3;
             this.LblNeutralismNetizen.Text = str4;
             this.AgreePagerBindData();
             this.OpposePagerBindData();
             this.NeutralismPagerBindData();
             this.LblItemTitle.Text = s;
             if (extendCommentInfo.Content.Length > 30)
             {
                 this.LblItemContent.Text = extendCommentInfo.Content.Substring(0, 30) + "..";
             }
             else
             {
                 this.LblItemContent.Text = extendCommentInfo.Content;
             }
             if (!string.IsNullOrEmpty(PEContext.Current.Admin.UserName))
             {
                 this.LblState.Text = PEContext.Current.Admin.UserName;
             }
             else
             {
                 this.LblState.Text = "匿名发表";
             }
         }
     }
 }
        protected void OkButton_Click(object sender, EventArgs e)
        {
            int num  = BasePage.RequestInt32("CommentID");
            int num2 = BasePage.RequestInt32("ID");
            CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo();

            commentPKZoneInfo.CommentId  = num;
            commentPKZoneInfo.Title      = base.Request["ItemTitle"];
            commentPKZoneInfo.Content    = base.Request["ItemContent"];
            commentPKZoneInfo.Position   = DataConverter.CLng(base.Request["RadlPosition"]);
            commentPKZoneInfo.IP         = PEContext.Current.UserHostAddress;
            commentPKZoneInfo.UpdateTime = DateTime.Now;
            if (!string.IsNullOrEmpty(PEContext.Current.User.UserName))
            {
                commentPKZoneInfo.UserName = PEContext.Current.User.UserName;
            }
            else
            {
                commentPKZoneInfo.UserName = "******";
            }
            CommentPKZone.Add(commentPKZoneInfo);
            DynamicPage.WriteSuccessMsg("<li>添加辩论成功!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", num.ToString(), "&Title=", base.Server.UrlEncode(base.Request["Title"]) }));
        }
        protected void InitComment()
        {
            if (this.m_GeneralId == 0)
            {
                BaseUserControl.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>");
            }
            else
            {
                string s = BaseUserControl.RequestString("Title");
                this.LblTitle.Text = s;
                string returnurl = this.ViewFile + "?GeneralID=" + this.m_GeneralId.ToString() + "&title=" + base.Server.UrlEncode(s);
                int    commentId = BaseUserControl.RequestInt32("CommentID");
                switch (BaseUserControl.RequestString("Action"))
                {
                case "Delete":
                    if (Comment.Delete(commentId))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>删除指定信息评论成功!</li>", returnurl);
                    }
                    break;

                case "Audited":
                    if (Comment.SetStatus(commentId, true))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>指定信息评论审核成功!</li>", returnurl);
                    }
                    break;

                case "UnAudited":
                    if (Comment.SetStatus(commentId, false))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>已取消指定评论审核!</li>", returnurl);
                    }
                    break;

                case "Premier":
                    if (Comment.Elite(commentId, true))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>设定指定评论精华成功!</li>", returnurl);
                    }
                    break;

                case "UnPremier":
                    if (Comment.Elite(commentId, false))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>已取消指定评论精华!</li>", returnurl);
                    }
                    break;

                case "AddPKZone":
                {
                    CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo();
                    commentPKZoneInfo.CommentId  = commentId;
                    commentPKZoneInfo.Content    = base.Request["ItemContent"];
                    commentPKZoneInfo.Position   = DataConverter.CLng(base.Request["RadlPosition"]);
                    commentPKZoneInfo.IP         = PEContext.Current.UserHostAddress;
                    commentPKZoneInfo.UpdateTime = DateTime.Now;
                    commentPKZoneInfo.UserName   = "******";
                    CommentPKZone.Add(commentPKZoneInfo);
                    BaseUserControl.WriteSuccessMsg("<li>感谢您的参与,添加辩论成功!</li>", returnurl);
                    break;
                }
                }
                this.CommentBindData();
            }
        }
 protected void RptCommentContent_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         Label         label    = e.Item.FindControl("LblNum") as Label;
         Image         image    = e.Item.FindControl("ImgUserFace") as Image;
         Label         label2   = e.Item.FindControl("LblCommentContent") as Label;
         ExtendedLabel label3   = e.Item.FindControl("LblUserExp") as ExtendedLabel;
         Label         label4   = e.Item.FindControl("LblUserRegTime") as Label;
         ExtendedLabel label5   = e.Item.FindControl("LblReply") as ExtendedLabel;
         CommentInfo   dataItem = (CommentInfo)e.Item.DataItem;
         Label         label6   = e.Item.FindControl("LblSustain") as Label;
         Label         label7   = e.Item.FindControl("LblOppose") as Label;
         Label         label8   = e.Item.FindControl("LblNeutralismNetizen") as Label;
         Label         label9   = e.Item.FindControl("LblPKZone") as Label;
         Label         label10  = e.Item.FindControl("LblPKAgree") as Label;
         Label         label11  = e.Item.FindControl("LblPKOppose") as Label;
         Label         label12  = e.Item.FindControl("LblExcerpt") as Label;
         Label         label13  = e.Item.FindControl("LblRestore") as Label;
         Label         label14  = e.Item.FindControl("LblDelete") as Label;
         string        str      = "CommentID=" + dataItem.CommentId.ToString() + "&GeneralId=" + this.m_GeneralId.ToString() + "&Title=" + base.Server.UrlEncode(BaseUserControl.RequestString("Title"));
         this.m_floorNumber++;
         label6.Text = CommentPKZone.GetPKCount(dataItem.CommentId, 1).ToString();
         label7.Text = CommentPKZone.GetPKCount(dataItem.CommentId, -1).ToString();
         label8.Text = CommentPKZone.GetPKCount(dataItem.CommentId, 0).ToString();
         label.Text  = "第<span style='color:Red'>" + this.m_floorNumber.ToString() + "</span>楼";
         if (!string.IsNullOrEmpty(dataItem.UserFace))
         {
             image.Width    = Unit.Pixel(80);
             image.ImageUrl = DataSecurity.UrlEncode(dataItem.UserFace);
         }
         else
         {
             image.Width    = Unit.Pixel(80);
             image.Height   = Unit.Pixel(90);
             image.ImageUrl = this.Path + "/Images/Comment/01.gif";
         }
         Label label15 = e.Item.FindControl("LblContent") as Label;
         label15.Text = dataItem.Content;
         label2.Text  = "信息:" + dataItem.PassedItems;
         if (SiteConfig.SiteOption.EnablePointMoneyExp)
         {
             label3.Text   = "积分:" + dataItem.UserExp;
             label3.EndTag = "<br/>";
         }
         label4.Text = "时间:" + dataItem.UserRegTime.ToString("yyyy-MM-dd");
         if (!dataItem.ReplyIsPrivate && !string.IsNullOrEmpty(dataItem.Reply))
         {
             StringBuilder builder = new StringBuilder();
             builder.Append("<table class='Reply' cellspacing='0' cellpadding='6' width='95%' border='0'>");
             builder.Append("<tr>");
             builder.Append("  <td class='ReplyAdminTd' >");
             builder.Append("    <span class='ReplyAdmin'>管理员回复</span>:<br/>");
             StringBuilder builder2 = new StringBuilder();
             builder2.Append("<br/>");
             builder2.Append("<p align='right'>" + dataItem.ReplyDateTime.ToString() + "</span>");
             builder2.Append("</td>");
             builder2.Append("</tr>");
             builder2.Append("</table>");
             label5.BeginTag = builder.ToString();
             label5.Text     = dataItem.Reply;
             label5.EndTag   = builder2.ToString();
         }
         label9.Text  = " <a href='../Contents/CommentPKZoneManage.aspx?" + str.ToString() + "'> PK Zone</a>";
         label10.Text = " <a href='../Contents/CommentPKZoneManage.aspx?" + str.ToString() + "' onkeydown=\"return Agree(event);\" onmouseover=\"PopupArea(event, 'Agree" + dataItem.CommentId.ToString() + "')\" onmouseout = \"jsAreaMouseOut(event)\"> 支持</a>";
         label11.Text = " <a href='../Contents/CommentPKZoneManage.aspx?" + str.ToString() + "' onkeydown=\"return Oppose(event);\" onmouseover=\"PopupArea(event, 'Oppose" + dataItem.CommentId.ToString() + "')\" onmouseout = \"jsAreaMouseOut(event)\"> 反对</a>";
         label12.Text = " <a href='../Contents/CommentExcerpt.aspx?" + str.ToString() + "'> 信息引用</a>";
         label13.Text = " <a href='../Contents/CommentRestore.aspx?" + str.ToString() + "'> 回复</a>";
         if (!string.IsNullOrEmpty(PEContext.Current.Admin.UserName))
         {
             label14.Text = "<a href='" + this.ViewFile + "?Action=Delete&" + str + "' onclick=\"return confirm('确定要删除此评论吗?');\">删除</a>";
             Label label16 = e.Item.FindControl("LblAuditing") as Label;
             if (dataItem.Status)
             {
                 label16.Text = "<span style='color:green'><a href='" + BaseUserControl.AppendSecurityCode(this.ViewFile + "?Action=UnAudited&" + str) + "'>取消审核</a></span>";
             }
             else
             {
                 label16.Text = "<span style='color:blue'><a href='" + BaseUserControl.AppendSecurityCode(this.ViewFile + "?Action=Audited&" + str) + "'>通过审核</a></span>";
             }
             Label label17 = e.Item.FindControl("LblIsElite") as Label;
             if (dataItem.IsElite)
             {
                 label17.Text = "<span style='color:green'><a href='" + BaseUserControl.AppendSecurityCode(this.ViewFile + "?Action=UnPremier&" + str) + "'>取消精华</a></span>";
             }
             else
             {
                 label17.Text = "<span style='color:blue'><a href='" + BaseUserControl.AppendSecurityCode(this.ViewFile + "?Action=Premier&" + str) + "'>设置为精华</a></span>";
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string str5;

            this.Path = base.BasePath;
            this.Path = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + this.Path;
            int    commentId = BasePage.RequestInt32("CommentID");
            int    num2      = BasePage.RequestInt32("ID");
            string s         = base.Request["Title"];

            if (((str5 = BasePage.RequestString("Action")) != null) && (str5 == "AddPKZone"))
            {
                CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo();
                commentPKZoneInfo.CommentId  = commentId;
                commentPKZoneInfo.Content    = base.Request["ItemContent"];
                commentPKZoneInfo.Position   = DataConverter.CLng(base.Request["RadlPosition"]);
                commentPKZoneInfo.IP         = PEContext.Current.UserHostAddress;
                commentPKZoneInfo.UpdateTime = DateTime.Now;
                commentPKZoneInfo.UserName   = "******";
                CommentPKZone.Add(commentPKZoneInfo);
                DynamicPage.WriteSuccessMsg("<li>感谢您的参与,添加辩论成功!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) }));
            }
            if (!base.IsPostBack)
            {
                if (commentId == 0)
                {
                    DynamicPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) }));
                }
                else
                {
                    CommentInfo extendCommentInfo = Comment.GetExtendCommentInfo(commentId);
                    if (extendCommentInfo.IsNull)
                    {
                        DynamicPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) }));
                    }
                    else
                    {
                        string str2 = CommentPKZone.GetPKCount(commentId, 1).ToString();
                        string str3 = CommentPKZone.GetPKCount(commentId, -1).ToString();
                        string str4 = CommentPKZone.GetPKCount(commentId, 0).ToString();
                        this.LblTitle.Text             = "<a href='" + base.BasePath + "Item/" + BasePage.RequestInt32("ID").ToString() + ".aspx'>" + s + "</a>";
                        this.LblUserName.Text          = extendCommentInfo.UserName;
                        this.LblContent.Text           = extendCommentInfo.Content;
                        this.LblTime.Text              = extendCommentInfo.UpdateDateTime.ToString();
                        this.LblSustain.Text           = str2;
                        this.LblOppose.Text            = str3;
                        this.LblSustain2.Text          = str2;
                        this.LblOppose2.Text           = str3;
                        this.LblNeutralismNetizen.Text = str4;
                        this.AgreePagerBindData();
                        this.OpposePagerBindData();
                        this.NeutralismPagerBindData();
                        this.LblItemTitle.Text = s;
                        if (extendCommentInfo.Content.Length > 30)
                        {
                            this.LblItemContent.Text = extendCommentInfo.Content.Substring(0, 30) + "..";
                        }
                        else
                        {
                            this.LblItemContent.Text = extendCommentInfo.Content;
                        }
                        if (!string.IsNullOrEmpty(PEContext.Current.User.UserName))
                        {
                            this.LblState.Text = PEContext.Current.User.UserName;
                        }
                        else
                        {
                            this.LblState.Text = "匿名发表";
                        }
                    }
                }
            }
        }
 private void OpposePagerBindData()
 {
     this.RptOpposeNetizen.DataSource = CommentPKZone.GetList((this.OpposePager.CurrentPageIndex - 1) * this.OpposePager.PageSize, this.OpposePager.PageSize, BasePage.RequestInt32("CommentID"), -1);
     this.OpposePager.RecordCount     = CommentPKZone.GetTotalOfCommentPKZoneInfo(BasePage.RequestInt32("CommentID"), -1);
     this.RptOpposeNetizen.DataBind();
 }