Exemplo n.º 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            AddNavigationItem(ActionName);

            if (IsLogin == false)
            {
                ShowError("您还未登陆,请先登陆");
            }

            int pageNumber = _Request.Get<int>("page", Method.Get, 1);
            type = _Request.Get("type", Method.Get, "mythread").ToLower();
            try
            {
                myThreadType = (MyThreadType)Enum.Parse(typeof(MyThreadType), type, true);
            }
            catch
            {
                myThreadType = MyThreadType.MyThread;
            }

            int userID = MyUserID;

            switch (myThreadType)
            {
                case MyThreadType.MyUnapprovedThread:
                    //我的未审核主题
                    threadList = PostBOV5.Instance.GetMyThreads(MyUserID, false, pageNumber, BbsSettings.ThreadsPageSize, out totalThreads);
                    break;

                case MyThreadType.MyUnapprovedPostThread:
                    //我的未审核回复
                    threadList = PostBOV5.Instance.GetMyUnapprovedPostThreads(MyUserID, pageNumber, BbsSettings.ThreadsPageSize);
                    totalThreads = threadList.TotalRecords;
                    break;

                case MyThreadType.MyParticipantThread:
                    //我参与的主题
                    threadList = PostBOV5.Instance.GetMyParticipantThreads(MyUserID, pageNumber, BbsSettings.ThreadsPageSize, out totalThreads);
                    break;

                default:
                    //我发表的主题
                    threadList = PostBOV5.Instance.GetMyThreads(MyUserID, true, pageNumber, BbsSettings.ThreadsPageSize, out totalThreads);
                    break;
            }

            SetPager("list", null, pageNumber, BbsSettings.ThreadsPageSize, totalThreads);

            //SetAllForumsList("AllForumsList", null);
        }
Exemplo n.º 2
0
 public static string GetMyThreadsUrlForPager(MyThreadType myThreadType)
 {
     return BbsRouter.GetUrl("my/mythreads", "type=" + myThreadType.ToString() + "&page={0}");
 }
Exemplo n.º 3
0
        private void appendMyThreadTypeLink(StringBuilder sb, MyThreadType myThreadType, string name, string linkStyle, string currentLinkStyle, string separator)
        {
            if (string.IsNullOrEmpty(linkStyle))
                linkStyle = "<a href=\"{0}\">{1}</a>";

            if (string.IsNullOrEmpty(currentLinkStyle))
                currentLinkStyle = "<a href=\"{0}\" class=\"current\">{1}</a>";

            //if (string.IsNullOrEmpty(separator))
            //    separator = " | ";

            string url;
            string myThreadTypeString = myThreadType.ToString().ToLower();
            if (type == myThreadTypeString)
                url = currentLinkStyle;
            else
            {
                url = linkStyle;
            }
            sb.Append(string.Format(url, UrlHelper.GetMyThreadsUrl(myThreadTypeString), name) + separator);
        }
Exemplo n.º 4
0
 public static string GetMyThreadsUrl(MyThreadType myThreadType)
 {
     return GetMyThreadsUrl(myThreadType.ToString());
 }