Exemplo n.º 1
0
        /// <summary>
        /// 获取辩论信息
        /// </summary>
        public void GetDebateInfo(PostpramsInfo postpramsInfo)
        {
            debateexpand = Debates.GetDebateTopic(topicid);
            debateList   = Debates.GetPostDebateList(topicid);//通过TID得到帖子观点
            if (debateexpand.Terminaltime < DateTime.Now)
            {
                isenddebate = true;
            }

            int positivepostlistcount = Debates.GetDebatesPostCount(postpramsInfo, 1);
            int negativepostlistcount = Debates.GetDebatesPostCount(postpramsInfo, 2);

            positivepagecount = (positivepostlistcount % pagesize == 0) ? (positivepostlistcount / pagesize) : (positivepostlistcount / pagesize + 1);
            negativepagecount = (negativepostlistcount % pagesize == 0) ? (negativepostlistcount / pagesize) : (negativepostlistcount / pagesize + 1);

            positivepagenumbers = Utils.GetAjaxPageNumbers(1, positivepagecount, "showdebatepage('" + forumpath + "tools/ajax.aspx?t=getdebatepostpage&opinion=1&tid=" + topic.Tid + "&{0}'," + parseurloff + ", " + smileyoff + ", " + bbcodeoff + ",'" + isenddebate + "',1," + userid + "," + topicid + ")", 8);
            negativepagenumbers = Utils.GetAjaxPageNumbers(1, negativepagecount, "showdebatepage('" + forumpath + "tools/ajax.aspx?t=getdebatepostpage&opinion=2&tid=" + topic.Tid + "&{0}'," + parseurloff + ", " + smileyoff + ", " + bbcodeoff + ",'" + isenddebate + "',2," + userid + "," + topicid + ")", 8);

            //防止无人参与时0做除数
            if (debateexpand.Negativediggs + debateexpand.Positivediggs != 0)
            {
                positivepercent = (float)debateexpand.Positivediggs / (float)(debateexpand.Negativediggs + debateexpand.Positivediggs) * 100;
                negativepercent = 100 - positivepercent;
            }

            foreach (ShowtopicPagePostInfo postlistinfo in positivepostlist)
            {
                //设置POST的观点属性
                if (debateList != null && debateList.ContainsKey(postlistinfo.Pid))
                {
                    postlistinfo.Debateopinion = Convert.ToInt32(debateList[postlistinfo.Pid]);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取辩论信息
        /// </summary>
        public void GetDebateInfo()
        {
            debateexpand = Debates.GetDebateTopic(topicid);
            debateList   = Debates.GetPostDebateList(topicid);//通过TID得到帖子观点
            if (debateexpand.Terminaltime < DateTime.Now)
            {
                isenddebate = true;
            }

            foreach (ShowtopicPagePostInfo postlistinfo in postlist)
            {
                //设置POST的观点属性
                if (debateList != null && debateList.ContainsKey(postlistinfo.Pid))
                {
                    postlistinfo.Debateopinion = debateList[postlistinfo.Pid];
                }
            }
        }
Exemplo n.º 3
0
 public void GetDebateInfo()
 {
     this.debateexpand = Debate.FindByTid(this.topicid);
     this.debateList   = Debates.GetPostDebateList(this.topicid);
     if (this.debateexpand.Terminaled)
     {
         this.isenddebate = true;
         if (this.isenddebate)
         {
             this.canreply = false;
         }
     }
     foreach (var item in this.postlist)
     {
         if (this.debateList != null && this.debateList.ContainsKey(item.ID))
         {
             item.Debateopinion = this.debateList[item.ID];
         }
     }
 }