예제 #1
0
        public ActionResult Sizes()
        {
            SizesViewModel svm  = new SizesViewModel();
            var            repo = new ProductsRepository();

            svm.Sizes      = repo.AllSizes().ToList();
            svm.Categories = repo.AllCategories().ToList();
            return(View(svm));
        }
예제 #2
0
        // 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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        public ActionResult Categories()
        {
            var repo = new ProductsRepository();

            return(View(repo.AllCategories()));
        }