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)); }
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); }