protected void Page_Load(object sender, EventArgs e) { int threadID = _Request.Get <int>("ThreadID", Method.Get, 0); if (threadID <= 0) { ShowError(new InvalidParamError("ThreadID").Message); } BasicThread thread = PostBOV5.Instance.GetThread(threadID); if (thread is PollThreadV5) { } else { ShowError("该主题不是投票帖"); } poll = (PollThreadV5)thread; //SetPageTitle("投票详细情况"); if (!AllSettings.Current.ForumPermissionSet.Nodes.GetPermission(poll.ForumID).Can(My, ForumPermissionSetNode.Action.ViewPollDetail)) { ShowError("您所在的用户组没有权限查看详细投票情况!"); } if (thread == null) { ShowError("主题不存在!"); } if (MyUserID == thread.PostUserID || AllSettings.Current.ForumPermissionSet.Nodes.GetPermission(poll.ForumID).Can(My, ForumPermissionSetNode.Action.AlwaysViewContents) || poll.AlwaysEyeable || poll.IsVoted(MyUserID)) { } else { ShowError("需要投票后才能查看详细投票情况!"); } PollItemDetailList = PostBOV5.Instance.GetPollItemDetails(threadID); foreach (PollItem pi in poll.PollItems) { VoteTotalCount += pi.PollItemCount; } }
protected override void GetThread() { if (IsOnlyLookOneUser) { Response.Redirect(BbsUrlHelper.GetThreadUrl(CodeName, ThreadID, 1, LookUserID, PostBOV5.Instance.GetThreadTypeString(ThreadType.Normal), ForumListPage)); } if (IsUnapprovePosts) { BbsRouter.JumpToUrl(BbsUrlHelper.GetThreadUrl(CodeName, ThreadID, PostBOV5.Instance.GetThreadTypeString(ThreadType.Normal)), "type=" + Type); } int?total; if (string.IsNullOrEmpty(Type)) { ThreadType realThreadType; PostBOV5.Instance.GetPollWithReplies(ThreadID, PageNumber, PageSize, true, UpdateView, out m_PollThread, out m_PostList, out realThreadType); //如果不是 投票 则跳到相应的页面 if (realThreadType != ThreadType.Poll) { Response.Redirect(BbsUrlHelper.GetThreadUrl(CodeName, ThreadID, PostBOV5.Instance.GetThreadTypeString(realThreadType))); } } else { BasicThread thread; GetPosts(ThreadType.Poll, out m_TotalPosts, out thread, out m_PostList); m_PollThread = (PollThreadV5)thread; } PostBOV5.Instance.ProcessKeyword(m_PostList, ProcessKeywordMode.TryUpdateKeyword); //if (_Request.IsSpider == false) //{ //List<int> userIDs = new List<int>(); //foreach (PostV5 post in m_PostList) //{ // userIDs.Add(post.UserID); //} //UserBO.Instance.GetUsers(userIDs, GetUserOption.WithAll); UserBO.Instance.GetUsers(m_PostList.GetUserIds(), GetUserOption.WithAll); //} }
public abstract int Vote(IEnumerable <int> itemIDs, int threadID, int userID, string nickName, PollThreadV5 poll);