Example #1
0
        // 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));
        }
Example #2
0
        //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));
            }
        }
Example #3
0
 public ProductController()
 {
     companyManager     = new CompanyManager();
     company            = companyManager.GetCompanyByID(CompanyID);
     productManagerView = new ProductManagerView(company);
 }