Exemple #1
0
        public ActionResult Create()
        {
            ProductMangerViewModel viewModel = new ProductMangerViewModel();

            viewModel.product          = new Product();
            viewModel.productCategeory = productcategories.collection();
            return(View(viewModel));
        }
Exemple #2
0
        public ActionResult Edit(string Id)
        {
            Product product = context.Find(Id);

            if (product == null)
            {
                return(HttpNotFound());
            }
            else
            {
                ProductMangerViewModel viewModel = new ProductMangerViewModel();
                viewModel.product          = product;
                viewModel.productCategeory = productcategories.collection();
                return(View(viewModel));
            }
        }