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 }
public ActionResult Index(String search, int?page) { HomeIndexViewModel model = new HomeIndexViewModel(); return(View(model.CreateModel(search, 4, page))); }
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); }
public ActionResult Index(string search, int?page) { Session["session_cart"] = true; HomeIndexViewModel model = new HomeIndexViewModel(); return(View(model.CreateModel(search, page, 4))); }
public ActionResult Index(string searchTerm, int?page) { HomeIndexViewModel model = new HomeIndexViewModel(); //ViewBag.Value = CartItemCount(); return(View(model.CreateModel(searchTerm, 4, page))); }
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()); }
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))); } }
public ActionResult Index(string search) { if (search != null) { ViewBag.searchEmpty = false; } else { ViewBag.searchEmpty = true; } HomeIndexViewModel model = new HomeIndexViewModel(); return(View(model.CreateModel(search))); }
public ActionResult Index(string search) { HomeIndexViewModel model = new HomeIndexViewModel(); return(View(model.CreateModel(search))); }
// 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))); }
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))); }
public ActionResult Index(string pesquisa, int?page) { HomeIndexViewModel viewModel = new HomeIndexViewModel(); return(View(viewModel.CreateModel(pesquisa, 8, page))); }
public ActionResult Index(string Search, int?Page) { HomeIndexViewModel model = new HomeIndexViewModel(); return(View(model.CreateModel(Search, 3, Page))); }