// GET: Dinners
        public ActionResult Index(int?page)
        {
            const int pagesize = 5;

            var upcomingDinners  = dinnerRepository.FindUpcomingDinners();
            var paginatedDinners = new PaginatedList <Dinners>(upcomingDinners, page ?? 0, pagesize);

            return(View(paginatedDinners));
        }
示例#2
0
        // GET: Dinners

        /*public ActionResult Index()
         * {
         *  var dinners = dinnerRepository.FindAllDinners().ToList();
         *
         *  return View("Index", dinners);
         * }*/

        public ActionResult Index(int?page)
        {
            const int pageSize        = 10;
            var       upcomingDinners = dinnerRepository.FindUpcomingDinners();

            /*var paginatedDinners = upcomingDinners.Skip((page ?? 0) * pageSize)
             *                                          .Take(pageSize)
             *                                          .ToList();*/
            var paginatedDinners = new PaginatedList <Dinner>(upcomingDinners, page ?? 0, pageSize);

            return(View(paginatedDinners));
        }
示例#3
0
        //
        // GET: /Dinners/

        public ActionResult Index(int?page)
        {
            // inital test write
            //Response.Write("<h1>Coming Soon: Dinners</h1>");

            //var dinners = dinnerRepository.FindUpcomingDinners().ToList();

            const int pageSize = 10;

            var upcomingDinners = dinnerRepository.FindUpcomingDinners();

            var paginatedDinners = new PaginatedList <Dinner>(upcomingDinners, page ?? 0, pageSize);

            return(View(paginatedDinners));
        }
示例#4
0
    //
    // GET: /Dinners/

    public ActionResult Index()
    {
        var dinners = dinnerRepository.FindUpcomingDinners().ToList();

        return(View(dinners));
    }
示例#5
0
        //
        // GET: /Dinners/

        public void Index()
        {
            var dinners = dinnerRepository.FindUpcomingDinners().ToList();
        }
        public ActionResult Index(int?page)
        {
            var dinners = dinnerRepository.FindUpcomingDinners(page);

            return(View(dinners));
        }