Beispiel #1
0
        public ActionResult Index(string search, int?page)
        {
            FormsAuthentication.SignOut();
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search, 12, page)));     // the second parameter of the CreateModel() is the number of products in a page
        }
Beispiel #2
0
        public ActionResult Index(String search, int?page)

        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search, 4, page)));
        }
Beispiel #3
0
        public ActionResult ProductIndex(string search, int?page)
        {
            List <Product>         productList   = _db.Products.ToList();
            ProductListItem        productVM     = new ProductListItem();
            List <ProductListItem> productVMList = productList.Select(x => new ProductListItem
            {
                ProductName  = x.ProductName,
                CategoryId   = x.CategoryId,
                CategoryName = x.Category.CategoryName,
                Quantity     = x.Quantity,
                Price        = x.Price
            }).ToList();
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search, page, 10)));

            //    return View(model.CreateModel());
            //return View(productVMList);



            //    //return View(_db.Products.ToList());
            //}

            // *** use this code when database is null ***//
            //public ActionResult ProductInd()
            //{

            //    List<Product> productList = _db.Products.ToList();
            //    List<Product> orderedList = productList.OrderBy(prod => prod.ProductName).ToList();

            //    return View(orderedList);
        }
Beispiel #4
0
        public ActionResult Index(string search, int?page)
        {
            Session["session_cart"] = true;
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search, page, 4)));
        }
Beispiel #5
0
        public ActionResult Index(string searchTerm, int?page)
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            //ViewBag.Value = CartItemCount();

            return(View(model.CreateModel(searchTerm, 4, page)));
        }
Beispiel #6
0
        public ActionResult Index(string search, int?page)
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            //  page  page size
            return(View(model.CreateModel(search, page, 8)));

            ////// Use this code when not using IpagedList
            //HomeIndexViewModel model = new HomeIndexViewModel();
            //return View(model.CreateModel());
        }
Beispiel #7
0
 public ActionResult Index(string search, int?page)
 {
     if (Session["UserName"] == null)
     {
         return(RedirectToAction("Login", "Home"));
     }
     else
     {
         HomeIndexViewModel model = new HomeIndexViewModel();
         return(View(model.CreateModel(search, 4, page)));
     }
 }
Beispiel #8
0
        public ActionResult Index(string search)
        {
            if (search != null)
            {
                ViewBag.searchEmpty = false;
            }
            else
            {
                ViewBag.searchEmpty = true;
            }

            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search)));
        }
Beispiel #9
0
        public ActionResult Index(string search)
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search)));
        }
Beispiel #10
0
        // GET: Home
        public ActionResult Index()
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel()));
        }
        public ActionResult BrandProduct(string search, int?page)
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(search, 20, page)));
        }
Beispiel #12
0
        public ActionResult Index(int page = 1)
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(pageSize, page)));
        }
 public ActionResult Index(string Search)
 {
     return(View(hivm.CreateModel(Search)));
 }
Beispiel #14
0
        public ActionResult Index(string pesquisa, int?page)
        {
            HomeIndexViewModel viewModel = new HomeIndexViewModel();

            return(View(viewModel.CreateModel(pesquisa, 8, page)));
        }
Beispiel #15
0
        public ActionResult Index(string Search, int?Page)
        {
            HomeIndexViewModel model = new HomeIndexViewModel();

            return(View(model.CreateModel(Search, 3, Page)));
        }