public ActionResult Sizes() { SizesViewModel svm = new SizesViewModel(); var repo = new ProductsRepository(); svm.Sizes = repo.AllSizes().ToList(); svm.Categories = repo.AllCategories().ToList(); return(View(svm)); }
// GET: Products public ActionResult Index() { var pim = new ProductsIndexModel(); var repo = new ProductsRepository(); pim.Categories = repo.AllCategories().ToList(); pim.Products = repo.AllProducts().ToList(); return(View(pim)); }
public ActionResult JsonCategories() { var repo = new ProductsRepository(); var cats = repo.AllCategories(); var jsonCats = new List <Category>(); foreach (Category cat in cats) { Category c = new Category { CategoryID = cat.CategoryID, CategoryName = cat.CategoryName, CategoryDescription = cat.CategoryDescription, DeleteFlag = cat.DeleteFlag }; jsonCats.Add(c); } return(Json(jsonCats, JsonRequestBehavior.AllowGet)); }
public ActionResult Categories() { var repo = new ProductsRepository(); return(View(repo.AllCategories())); }