// GET: Products/Details/5 public ActionResult Details(int id) { ProductBLL product; try { using (ContextBll ctx = new ContextBll()) { product = ctx.FindProductByID(id); if (null == product) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(product)); }
public ActionResult Purchase(int id) { ProductBLL Product; try { using (ContextBll ctx = new ContextBll()) { Product = ctx.FindProductByID(id); if (null == Product) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } return(View(new PurchaseModel(Product))); }
// GET: Products/Edit/5 public ActionResult Edit(int id) { ProductBLL Product; try { using (ContextBll ctx = new ContextBll()) { Product = ctx.FindProductByID(id); if (null == Product) { return(View("ItemNotFound")); } } } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } ViewBag.Product = GetCategorieItems(); return(View(Product)); }