Esempio n. 1
0
        public override void CopyFrom(BasicThread thread)
        {
            base.CopyFrom(thread);
            PollThreadV5 poll = (PollThreadV5)thread;

            this.AlwaysEyeable = poll.AlwaysEyeable;
            this.CreateDate    = poll.CreateDate;
            this.ExpiresDate   = poll.ExpiresDate;
            this.Multiple      = poll.Multiple;
            this.PollItems     = poll.PollItems;
            this.VotedUserIDs  = poll.VotedUserIDs;
        }
Esempio n. 2
0
        public override void CopyFrom(BasicThread thread)
        {
            base.CopyFrom(thread);

            PolemizeThreadV5 polemize = (PolemizeThreadV5)thread;

            this.AgainstCount     = polemize.AgainstCount;
            this.AgainstViewPoint = polemize.AgainstViewPoint;
            this.AgreeCount       = polemize.AgreeCount;
            this.AgreeViewPoint   = polemize.AgreeViewPoint;
            this.NeutralCount     = polemize.NeutralCount;
            this.ExpiresDate      = polemize.ExpiresDate;
        }
Esempio n. 3
0
        public override void CopyFrom(BasicThread thread)
        {
            base.CopyFrom(thread);

            QuestionThread question = (QuestionThread)thread;

            //if (question.BestPost != null)
            this.BestPost = question.BestPost;

            this.Rewards       = question.Rewards;
            this.Reward        = question.Reward;
            this.RewardCount   = question.RewardCount;
            this.AlwaysEyeable = question.AlwaysEyeable;
            this.ExpiresDate   = question.ExpiresDate;
            this.BestPostID    = question.BestPostID;
            this.UnusefulCount = question.UnusefulCount;
            this.UsefulCount   = question.UsefulCount;
        }
Esempio n. 4
0
        private BasicThread ProcessLastThread(BasicThread thread, string key)
        {
            if (thread.ThreadStatus == ThreadStatus.Recycled || thread.ThreadStatus == ThreadStatus.UnApproved)
            {
                //PostBOV5.Instance.ClearTopThreadsCache(ForumID);
                ThreadCachePool.ClearAllCache();
                ThreadCollectionV5 threads = PostBOV5.Instance.GetTopThreads(ForumID);
                if (threads != null && threads.Count > 0)
                {
                    thread       = threads[0];
                    LastThreadID = thread.ThreadID;
                }
                else
                {
                    LastThreadID = 0;
                    return(null);
                }
            }
            if (thread.ThreadType == ThreadType.Join || thread.ThreadType == ThreadType.Move)
            {
                int threadID;
                if (int.TryParse(thread.Subject.Substring(0, thread.Subject.IndexOf(',')), out threadID))
                {
                    thread = PostBOV5.Instance.GetThread(threadID);
                    if (thread == null)
                    {
                        return(null);
                    }
                }
                else
                {
                    return(null);
                }
            }
            if (thread != null)
            {
                PageCacheUtil.Set(key, thread);
            }

            return(thread);
        }
Esempio n. 5
0
 /// <summary>
 /// 从目标主题复制过来
 /// </summary>
 /// <param name="thread"></param>
 public virtual void CopyFrom(BasicThread thread)
 {
     this.CreateDate        = thread.CreateDate;
     this.ForumID           = thread.ForumID;
     this.IconID            = thread.IconID;
     this.IsClosed          = thread.IsClosed;
     this.IsLocked          = thread.IsLocked;
     this.IsValued          = thread.IsValued;
     this.JudgementID       = thread.JudgementID;
     this.KeywordVersion    = thread.KeywordVersion;
     this.LastPostID        = thread.LastPostID;
     this.LastReplyUserID   = thread.LastReplyUserID;
     this.LastReplyUsername = thread.LastReplyUsername;
     this.PostUserID        = thread.PostUserID;
     this.PostUsername      = thread.PostUsername;
     this.Price             = thread.Price;
     this.Rank                 = thread.Rank;
     this.SortOrder            = thread.SortOrder;
     this.Subject              = thread.Subject;
     this.SubjectStyle         = thread.SubjectStyle;
     this.ThreadCatalogID      = thread.ThreadCatalogID;
     this.ThreadID             = thread.ThreadID;
     this.ThreadLog            = thread.ThreadLog;
     this.ThreadStatus         = thread.ThreadStatus;
     this.ThreadType           = thread.ThreadType;
     this.TotalAttachments     = thread.TotalAttachments;
     this.TotalReplies         = thread.TotalReplies;
     this.TotalViews           = thread.TotalViews;
     this.UnApprovedPostsCount = thread.UnApprovedPostsCount;
     this.UpdateDate           = thread.UpdateDate;
     this.UpdateSortOrder      = thread.UpdateSortOrder;
     this.ShareCount           = thread.ShareCount;
     this.CollectionCount      = thread.CollectionCount;
     this.ContentID            = thread.ContentID;
     this.AttachmentType       = thread.AttachmentType;
     this.PostedCount          = thread.PostedCount;
     this.Words                = thread.Words;
     //this.ExtendData = thread.ExtendData;
 }
Esempio n. 6
0
        private PostCollectionV5 GetPostsFromDatabase(int pageNumber, int pageSize, bool getExtendedInfo)
        {
            IsGetFromDataBase = true;
            BasicThread thread;

            if (getExtendedInfo)
            {
                thread = this;
            }
            else//防止主题内容的被改了 导致attachment 等扩展信息变null了
            {
                thread = new BasicThread();
                thread.CopyFrom(this);
                thread.IsGetFromDataBase = true;
            }
            ThreadType       type = ThreadType;
            PostCollectionV5 posts;

            bool getContent;

            if ((this.ThreadType == ThreadType.Normal) &&
                pageNumber > 1)
            {
                getContent = false;
            }
            else
            {
                getContent = true;
            }

            //string info = "101;getContent:" + getContent.ToString() + ";getExtendedInfo:" + getExtendedInfo.ToString() + ";hasThreadContent";

            PostBOV5.Instance.GetPosts(ThreadID, true, pageNumber, pageSize, TotalReplies + 1, getExtendedInfo, false, getContent, false, ref thread, out posts, ref type);

            return(posts);
        }
Esempio n. 7
0
 // 通过ActionType获得动作名称
 public string ActionTypeName(BasicThread thread)
 {
     return(PostBOV5.Instance.GetActionName(ActionType, thread));
 }