Exemplo n.º 1
0
        public ActionResult Create()
        {
            ProductManagerViewModel viewModel = new ProductManagerViewModel();

            viewModel.Product           = new Product();
            viewModel.ProductCategories = productCategories.Collection();

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public ActionResult Index(string Category = null)
        {
            List <Product>         products;
            List <ProductCategory> categories = productCategories.Collection().ToList();

            if (Category == null)
            {
                products = context.Collection().ToList();
            }
            else
            {
                products = context.Collection().Where(x => x.Category == Category).ToList();
            }

            ProductListViewModel model = new ProductListViewModel();

            model.Product           = products;
            model.ProductCategories = categories;


            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            List <ProductCategory> productCategories = context.Collection().ToList();

            return(View(productCategories));
        }