示例#1
0
        public ActionResult Create()
        {
            ProductManagerViewModel viewModel = new ProductManagerViewModel();

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

            return(View(viewModel));
        }
示例#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(p => p.Category == category).ToList();
            }
            ProductListViewModel model = new ProductListViewModel();

            model.Products          = products;
            model.Productcategories = categories;
            return(View(model));
        }
示例#3
0
        // GET: ProductManager
        public ActionResult Index()
        {
            List <Product> products = context.Collection().ToList();

            return(View(products));
        }
        // GET: ProductManager
        public ActionResult Index()
        {
            List <ProductCategory> productCategory = context.Collection().ToList();

            return(View(productCategory));
        }