示例#1
0
 public JsonResult GetProduct()
 {
     if (_session.IsLogin)
     {
         string    jsonData = "[]";
         ProductBO _cls     = new ProductBO();
         var       data     = _cls.GetList(m => m.IsActive.Equals(true));
         if (data != null)
         {
             jsonData = new JavaScriptSerializer().Serialize(data);
         }
         return(Json(jsonData, JsonRequestBehavior.AllowGet));
     }
     else
     {
         RedirectToAction("index", "admin");
     }
     return(Json("[]", JsonRequestBehavior.AllowGet));
 }
示例#2
0
 public JsonResult GetProduct()
 {
     if (_session.IsLogin)
     {
         string jsonData = "[]";
         ProductBO _cls = new ProductBO();
         var data = _cls.GetList(m => m.IsActive.Equals(true));
         if (data != null)
             jsonData = new JavaScriptSerializer().Serialize(data);
         return Json(jsonData, JsonRequestBehavior.AllowGet);
     }
     else
         RedirectToAction("index", "admin");
     return Json("[]", JsonRequestBehavior.AllowGet);
 }