Exemplo n.º 1
0
            public static ApiPagedList <ApiStory> GetUpcomingPageStories(int hostID, int pageNumber, int pageSize)
            {
                ApplyPageLimits(ref pageNumber, ref pageSize);
                PagedStoryCollection pagedCollection = new PagedStoryCollection();

                pagedCollection.Items = StoryCache.GetAllStories(false, hostID, pageNumber, pageSize);
                pagedCollection.Total = StoryCache.GetStoryCount(hostID, false);
                return(pagedCollection.ToApi());
            }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Paging.PageNumber = UrlParameters.PageNumber;
            this.Paging.PageSize   = UrlParameters.PageSize;

            if (this.UrlParameters.StoryListSortBy == Incremental.Kick.Common.Enums.StoryListSortBy.RecentlyPromoted)
            {
                this.UrlParameters.StoryListSortBy = Incremental.Kick.Common.Enums.StoryListSortBy.LatestUpcoming;
            }

            if (!this.UrlParameters.CategoryIdentifierSpecified)
            {
                this.StoryList.DataBind(StoryCache.GetAllStories(false, this.HostProfile.HostID, this.UrlParameters.PageNumber, this.UrlParameters.PageSize));
                this.Paging.RecordCount = StoryCache.GetStoryCount(this.HostProfile.HostID, false);
                this.Paging.BaseUrl     = UrlFactory.CreateUrl(UrlFactory.PageName.Home) + "/upcoming";
            }
            else
            {
                this.StoryList.DataBind(StoryCache.GetCategoryStories(this.UrlParameters.CategoryID, false, this.HostProfile.HostID, this.UrlParameters.PageNumber, this.UrlParameters.PageSize));
                this.Paging.RecordCount = StoryCache.GetCategoryStoryCount(this.UrlParameters.CategoryID, false, this.HostProfile.HostID);
                this.Paging.BaseUrl     = UrlFactory.CreateUrl(UrlFactory.PageName.ViewCategoryNewStories, this.UrlParameters.CategoryIdentifier);
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.UrlParameters.StoryListSortBy)
            {
            case StoryListSortBy.RecentlyPromoted:
                this.PopularStoryNavigator.DataBind(StoryCache.GetAllStories(true, this.HostProfile.HostID, this.UrlParameters.PageNumber, this.UrlParameters.PageSize), StoryCache.GetStoryCount(this.HostProfile.HostID, true));
                break;

            default:
                this.PopularStoryNavigator.DataBind(StoryCache.GetPopularStories(this.HostProfile.HostID, true, this.UrlParameters.StoryListSortBy, this.UrlParameters.PageNumber, this.UrlParameters.PageSize), StoryCache.GetPopularStoriesCount(this.HostProfile.HostID, true, this.UrlParameters.StoryListSortBy));
                break;
            }

            switch (this.UrlParameters.StoryListSortBy)
            {
            case StoryListSortBy.Today:
                this.PageName = UrlFactory.PageName.PopularToday;
                break;

            case StoryListSortBy.PastWeek:
                this.PageName = UrlFactory.PageName.PopularWeek;
                break;

            case StoryListSortBy.PastTenDays:
                this.PageName = UrlFactory.PageName.PopularTenDays;
                break;

            case StoryListSortBy.PastMonth:
                this.PageName = UrlFactory.PageName.PopularMonth;
                break;

            case StoryListSortBy.PastYear:
                this.PageName = UrlFactory.PageName.PopularYear;
                break;
            }

            //this.SubCaption = String.Format(@"<a href=""{0}"" class=""highlight"">View {1} >></a>", UrlFactory.CreateUrl(UrlFactory.PageName.NewStories), Strings.Pluralize(StoryCache.GetUpcomingStoryCount(this.HostProfile), "upcoming stories"));
            this.SubCaption = String.Format(@"<a href=""{0}"" class=""highlight"">View {1} >></a>", UrlFactory.CreateUrl(UrlFactory.PageName.NewStories), String.Format("{0:#,###}", StoryCache.GetUpcomingStoryCount(this.HostProfile)) + " upcoming stories");
            //String.Format("{0:#,###}", StoryCache.GetUpcomingStoryCount(this.HostProfile))
        }