Exemple #1
0
        public ActionResult ProductListBYCategories(int Id, string sormet, int Page = 1)
        {
            var list = new HomeIndexTop
            {
                Paging = new ForPaging(Page)
            };

            switch (sormet)
            {
            case "low":
                list.GetAllProductsList = productservice.GetAllproduct(Id, list.Paging).OrderBy(x => x.UnitPrice);
                list.GetAllCategories   = categoryservice.GetCategoryList();
                break;

            case "high":
                list.GetAllProductsList = productservice.GetAllproduct(Id, list.Paging).OrderByDescending(x => x.UnitPrice);
                list.GetAllCategories   = categoryservice.GetCategoryList();
                break;

            default:
                list.GetAllProductsList = productservice.GetAllproduct(Id, list.Paging);
                list.GetAllCategories   = categoryservice.GetCategoryList();
                break;
            }
            return(PartialView(list));
        }
Exemple #2
0
        public ActionResult ProductList(string ProductName, string sormet, int Page = 1)
        {
            //ViewBag.low = sortOrder = "low";
            //ViewBag.high = sortOrder = "high";
            var list = new HomeIndexTop
            {
                Search = ProductName,
                Paging = new ForPaging(Page)
            };

            switch (sormet)
            {
            case "low":
                list.GetAllProductsList = productservice.GetSearchProductName(list.Search, list.Paging).OrderBy(x => x.UnitPrice);
                list.GetAllCategories   = categoryservice.GetCategoryList();
                break;

            case "high":
                list.GetAllProductsList = productservice.GetSearchProductName(list.Search, list.Paging).OrderByDescending(x => x.UnitPrice);
                list.GetAllCategories   = categoryservice.GetCategoryList();
                break;

            default:
                list.GetAllProductsList = productservice.GetSearchProductName(list.Search, list.Paging);
                list.GetAllCategories   = categoryservice.GetCategoryList();
                break;
            }
            return(View(list));
        }
        public ActionResult Index()
        {
            var list = new HomeIndexTop();

            list.ProductsList     = productservice.GetProductsList();
            list.MidProductsList  = productservice.GetProductsList().Take(4);
            list.DownProductsList = productservice.GetProductsList().Take(8);
            return(View(list));
        }
        public ActionResult MailUS()
        {
            var list = new HomeIndexTop();

            return(View(list));
        }