// 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)); }
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)); }
//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)); }
// 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)); }
// 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))); }
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)); }
// 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)); }
// 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)); }