public ActionResult Popular(string urlName, int?page) { DefCookie.SetDefCookie(); Category category = new Category(); ViewBag.Category = category.GetCategories(); ViewBag.ActiveProduct = "nav__link--current"; string categoryName = Category.GetCategoryName(urlName); ViewBag.EngCategoryName = Category.GetEngCategoryName(); ViewBag.CategoryName = categoryName; ViewBag.SortRu = "Поуплярные"; ViewBag.SortUa = "Популярнi"; ViewBag.SortEn = "Popular"; Sort sort = new Sort(); var data = sort.SortItemByPopularity(categoryName); int pageSize = 10; int pageNumber = (page ?? 1); return(View(data.ToPagedList(pageNumber, pageSize))); }
public ActionResult Low(string urlName, int?page) { DefCookie.SetDefCookie(); Category category = new Category(); ViewBag.Category = category.GetCategories(); ViewBag.ActiveProduct = "nav__link--current"; string categoryName = Category.GetCategoryName(urlName); ViewBag.EngCategoryName = Category.GetEngCategoryName(); ViewBag.CategoryName = categoryName; ViewBag.SortRu = "От дешёвых к дорогим"; ViewBag.SortUa = "Вiд дешевих до дорогих"; ViewBag.SortEn = "Low to high"; Sort sort = new Sort(); var data = sort.SortItemByPriceLow(categoryName); int pageSize = 10; int pageNumber = (page ?? 1); return(View(data.ToPagedList(pageNumber, pageSize))); }
// GET: Products public ActionResult Index(string urlName, int?page) { DefCookie.SetDefCookie(); Category category = new Category(); ViewBag.Category = category.GetCategories(); ViewBag.ActiveProduct = "nav__link--current"; string categoryName = Category.GetCategoryName(urlName); ViewBag.EngCategoryName = Category.GetEngCategoryName(); ViewBag.CategoryName = categoryName; ViewBag.SortRu = "Новинки"; ViewBag.SortUa = "Новинки"; ViewBag.SortEn = "Latest"; Products product = new Products(); var data = product.GetItems(categoryName); int pageSize = 10; int pageNumber = (page ?? 1); return(View(data.ToPagedList(pageNumber, pageSize))); }
// GET: Cart public ActionResult Index() { DefCookie.SetDefCookie(); Category category = new Category(); ViewBag.Category = category.GetCategories(); var cartItems = cart.ShowCart(); CartList cartList = new CartList(); ViewBag.Price = cartList.TotalPrice(); return(View(cartItems)); }