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 PollItemDetailsCollectionV5 GetPollItemDetails(int itemID) { PollItemDetailsCollectionV5 details; if (pollItemDetails.TryGetValue(itemID, out details) == false) { details = new PollItemDetailsCollectionV5(); foreach (PollItemDetailsV5 detail in PollItemDetailList) { if (detail.ItemID == itemID) { details.Add(detail); } } pollItemDetails.Add(itemID, details); } return(details); }
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 PollItemDetailsCollectionV5 GetPollItemDetails(int itemID) { PollItemDetailsCollectionV5 details; if (pollItemDetails.TryGetValue(itemID, out details) == false) { details = new PollItemDetailsCollectionV5(); foreach (PollItemDetailsV5 detail in PollItemDetailList) { if (detail.ItemID == itemID) { details.Add(detail); } } pollItemDetails.Add(itemID, details); } return details; }