コード例 #1
0
        public ActionResult Create()
        {
            ProductMnagerViewModel viewModel = new ProductMnagerViewModel();

            viewModel.Product           = new Product();
            viewModel.ProductCategories = productCategories.Collection();
            return(View(viewModel));
        }
コード例 #2
0
        public ActionResult Edit(string Id)
        {
            Product product = context.Find(Id);

            if (product == null)
            {
                return(HttpNotFound());
            }
            else
            {
                ProductMnagerViewModel viewModel = new ProductMnagerViewModel();
                viewModel.Product           = product;
                viewModel.ProductCategories = productCategories.Collection();
                return(View(viewModel));
            }
        }