Пример #1
0
        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)));
        }
Пример #2
0
        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)));
        }
Пример #3
0
        // 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)));
        }
Пример #4
0
        // 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));
        }