Esempio n. 1
0
        public ActionResult Create()
        {
            var catalogManager = new CatalogManager();

            ViewBag.AllCatalogs = catalogManager.GetAllCatalogs();
            return(View());
        }
Esempio n. 2
0
        public ActionResult Edit([Bind(Include = "Id,Code,Description, CatalogId")] Product product)
        {
            if (!ModelState.IsValid)
            {
                var catalogManager = new CatalogManager();
                ViewBag.AllCatalogs = catalogManager.GetAllCatalogs();
                return(View(product));
            }
            var productManager = new ProductManager();

            productManager.SaveModifed(product);
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var catalogManager = new CatalogManager();

            ViewBag.AllCatalogs = catalogManager.GetAllCatalogs();

            var     productManager = new ProductManager();
            Product product        = productManager.GetProductById(id);

            if (product == null)
            {
                return(HttpNotFound());
            }
            return(View(product));
        }
Esempio n. 4
0
        public ActionResult Index()
        {
            var catalogManager = new CatalogManager();

            return(View(catalogManager.GetAllCatalogs()));
        }