// Create our product// //Display the create page public ActionResult Create() { ProductManagerView viewModel = new ProductManagerView(); viewModel.Product = new Product(); viewModel.ProductCategories = productCategories.Collection(); // Product product = new Product();// return(View(viewModel)); }
//Edit a Product// public ActionResult Edit(string Id) { Product product = context.Find(Id); if (product == null) { return(HttpNotFound()); } else { ProductManagerView viewModel = new ProductManagerView(); viewModel.Product = product; viewModel.ProductCategories = productCategories.Collection(); return(View(viewModel)); } }
public ProductController() { companyManager = new CompanyManager(); company = companyManager.GetCompanyByID(CompanyID); productManagerView = new ProductManagerView(company); }