Exemple #1
0
        // GET: StoreManager/Create
        public ActionResult ProductCreate()
        {
            var categoryList = new CategoryLogic();

            ViewBag.CategoryId = categoryList.SetCategoryViewBag();

            return(View());
        }
Exemple #2
0
        // GET: StoreManager/Product/Edit/5
        public ActionResult ProductEdit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var     productService = new ProductLogic();
            Product product        = productService.FindProduct(id);

            if (product == null)
            {
                return(HttpNotFound());
            }
            var categoryList = new CategoryLogic();

            ViewBag.CategoryId = categoryList.SetCategoryViewBag(id);
            return(View(product));
        }