예제 #1
0
        // GET: Dish
        public ActionResult List(string group, int page = 1)
        {
            var lst   = repository.GetAll().Where(d => group == null || d.GroupName.Equals(group)).OrderBy(d => d.Calories);
            var model = PageListViewModel <Dish> .CreatePage(lst, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListPartial", model));
            }
            return(View(model));
        }
예제 #2
0
        public ActionResult Index(int page = 1)
        {
            var news  = _repoNews.GetAll();
            var model = PageListViewModel <News> .CreatePage(news, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_ListPartial", model));
            }
            return(View(model));
        }
예제 #3
0
        //public ActionResult List()
        //{
        //    return View(repsitory.GetAllAutoParts());
        //}

        //ЛБ4
        //public ActionResult List(int page = 1)
        //{
        //    var lst = repsitory.GetAllAutoParts().OrderBy(ap => ap.Weight);
        //    return View(PageListViewModel<AutoPart>.CreatePage(lst, page,pageSize));
        //}

        //ЛБ5
        public ActionResult List(string category, int page = 1)
        {
            var itemsList = repository.GetAllAutoParts()
                            .Where(d => category == null || d.GroupName.Equals(category))
                            .OrderBy(d => d.Weight);
            var model = PageListViewModel <AutoPart> .CreatePage(itemsList, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListViewPatial", model));
            }
            return(View(model));
        }
예제 #4
0
        // GET: Book
        public ActionResult List(string type, int page = 1)
        {
            //return View(books);
            var lst = repository.GetAll()
                      .Where(d => type == null || d.BookType.Equals(type))
                      .OrderBy(d => d.BookPrice);
            var model = PageListViewModel <Book> .CreatePage(lst, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListPartial", model));
            }
            return(View(model));
        }
예제 #5
0
        // GET: Book
        public ActionResult List(string genre, int page = 1)
        {
            var lst = repository.GetAll()
                      .Where(d => genre == null ||
                             d.GenreName.Equals(genre))
                      .OrderBy(d => d.Price);
            var model = PageListViewModel <Book> .CreatePage(lst, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListPartial", model));
            }
            return(View(PageListViewModel <Book> .CreatePage(lst, page, pageSize)));
        }
예제 #6
0
        public ActionResult Index(int page = 1)
        {
            RssRepository repository = new RssRepository();

            List <NewsItem> newsItems = repository.GetAllNews().ToList();

            var model = PageListViewModel <NewsItem> .CreatePage(newsItems, page, tableSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListViewPatial", model));
            }
            return(View(model));
        }
예제 #7
0
        // GET: Car
        public ActionResult List(string group, int page = 1)
        {
            var lst = _repository
                      .GetAll()
                      .Where(c => group == null || c.ClassType.Equals(group))
                      .OrderBy(c => c.Price);

            var model = PageListViewModel <Car> .CreatePage(lst, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListPartial", model));
            }
            return(View(model));
        }
예제 #8
0
        // GET: Book
        public ActionResult List(string category, int page = 1)
        {
            IEnumerable <Book> list = repository.GetAll().
                                      Where(x => category == null || x.CategoryName.Equals(category)).
                                      OrderBy(x => x.Price);

            PageListViewModel <Book> model = PageListViewModel <Book> .CreatePage(list, page, pageSize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("ListPartial", model));
            }

            return(View(model));
        }