Exemplo n.º 1
0
 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");
 }
Exemplo n.º 2
0
 public JsonResult SaveProduct(Product product)
 {
     ProductBO cls = new ProductBO();
     bool IsResult = cls.Save(product);
     return Json(new { IsOk = IsResult }, JsonRequestBehavior.AllowGet);
 }