Example #1
0
        public ActionResult GetAll()
        {
            var results = _mainobj.GetAll();

            if (results != null)
            {
                results = results.OrderByDescending(o => o.descriptionid).ToList();
                return(Json(new { data = results }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { data = new string[] { } }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
 public ActionResult GetAll()
 {
     try
     {
         var currentwebsite = "Brick Kiln,";
         var results        = _mainobj.GetAll();
         results = results.Where(w => (w.websitemodule != null && w.websitemodule.Contains(currentwebsite))).ToList();
         if (results != null)
         {
             var nresults = results.AsEnumerable().Select(p => new{
                 Title    = p.Title.titlename,
                 Category = p.Category.catname,
                 Video    = p.descvideolink,
             }).ToList();
             return(Json(new { data = nresults }, JsonRequestBehavior.AllowGet));
         }
     }
     catch { }
     return(Json(new { data = new string[] { } }, JsonRequestBehavior.AllowGet));
 }