public ActionResult CreateProduct(int id) { ViewBag.ID = id; if (_session.IsLogin) { Product model = new Product(); if (id != -1) { ProductBO cls = new ProductBO(); model = cls.GetByID(id); if (model == null) { model = new Product(); } ViewBag.Image = model.ImageThumbnail; ViewBag.ImageLarge = model.ImageLarge; return(View(model)); } else { return(View(model)); } } else { return(RedirectToAction("index", "admin")); } }
public ActionResult CreateProduct(int id) { ViewBag.ID = id; if (_session.IsLogin) { Product model = new Product(); if (id != -1) { ProductBO cls = new ProductBO(); model = cls.GetByID(id); if (model == null) model = new Product(); ViewBag.Image = model.ImageThumbnail; ViewBag.ImageLarge = model.ImageLarge; return View(model); } else return View(model); } else return RedirectToAction("index", "admin"); }