Пример #1
0
        /// <summary>
        /// 显示由指定类型的影片列表(分页)
        /// </summary>
        public ActionResult Genre(string genre, int pageIndex = 1)
        {
            int recordCount;
            IEnumerable <GeneralMovieInfo> movies = this.ProductService.GetMoviesByGenre(genre, pageIndex, PagingInfo.PageSize, out recordCount)
                                                    .Select(p => GeneralMovieInfo.FromProduct(p));
            Func <int, UrlHelper, string> pageUrlAccessor = (currentPage, helper) => helper.RouteUrl("GenrePage", new { PageIndex = currentPage }).ToString();

            ViewBag.Title = genre;
            return(RenderMovieList(movies, recordCount, pageIndex, pageUrlAccessor));
        }
Пример #2
0
        /// <summary>
        /// 影片列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult Index(int pageIndex = 1)
        {
            ProductController.pageIndex = pageIndex;
            int recordCount;
            IEnumerable <GeneralMovieInfo> movies = this.ProductService
                                                    .GetMovies(pageIndex, PagingInfo.PageSize, out recordCount)
                                                    .Select(p => GeneralMovieInfo.FromProduct(p));
            var temp = movies.ToList();
            Func <int, UrlHelper, string> pageUrlAccessor = (CurrentPage, helper) =>
                                                            helper.RouteUrl("Page", new { PageIndex = CurrentPage }).ToString();

            ViewBag.Title = "Video Mall";

            return(RenderMovieList(movies, recordCount, pageIndex, pageUrlAccessor));
        }