Ejemplo n.º 1
0
 public ActionResult CreateNews(int id)
 {
     ViewBag.ID = id;
     if (_session.IsLogin)
     {
         News model = new News();
         if (id != -1)
         {
             NewsBO cls = new NewsBO();
             model = cls.GetNews(id);
             if (model == null)
                 model = new News();
             return View(model);
         }
         else
             return View(model);
     }
     else
         return RedirectToAction("index", "admin");
 }
Ejemplo n.º 2
0
 public JsonResult SaveNews(News news)
 {
     NewsBO cls = new NewsBO();
     bool IsResult = cls.Save(news);
     return Json(new { IsOk = IsResult }, JsonRequestBehavior.AllowGet);
 }