Ejemplo n.º 1
0
        // GET: Product/Delete/5
        public ActionResult Delete(int id)
        {
            ProductDetailsViewModel model = new ProductDetailsViewModel();
            model.Product = bm.GetProductById(id);

            return View(model);
        }
Ejemplo n.º 2
0
        // GET: Product/Details/5
        public ActionResult Details(int id)
        {
            ProductDetailsViewModel model = new ProductDetailsViewModel();
            model.Product = bm.GetProductById(id);
            model.Category = bm.GetCategoryById(model.Product.CategoryId);

            return View(model);
        }
Ejemplo n.º 3
0
        public ActionResult Delete(int id, ProductDetailsViewModel model)
        {
            try
            {
                bm.DeleteProduct(model.Product.Id);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }