Exemplo n.º 1
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))
        }