public ActionResult ManageFavorites()
 {
     try
     {
         ReadDataFromRouteData();
         string homeText = Utilities.getModuleText(headerVM, "home");
         FavoritesViewModel favVM = new FavoritesViewModel();
         BreadcrumbViewModel BreadcrumbViewModel = new BreadcrumbViewModel();
         BreadcrumbViewModel.NavigationList = new List<SelectListItem>();
         BreadcrumbViewModel.NavigationList.Add(new SelectListItem() { Text = homeText, Value = "home", Selected = false });
         BreadcrumbViewModel.NavigationList.Add(new SelectListItem() { Text = Utilities.GetResourceText(resources, "MANAGEMYFAVORITES"), Value = "", Selected = true });
         favVM.BreadcrumbViewModel = BreadcrumbViewModel;
         favVM.portalId = portalId;
         favVM.clientId = clientId;
         favVM.showBreadcrumb = _portal.Configuration.ShowBreadcrumbs;
         favVM.Resources = resources;
         return View("ManageFavs", favVM);
         //managemyfavorites
     }
     catch (Exception ex)
     {
         logger.ErrorException("Error:" + " " + ex.Message, ex);
         throw ex;
     }
 }
        public JsonResult GetFavJsondata(int page, int rows, string search, string sidx, string sord)
        {
            ReadDataFromRouteData();
            int maxCount = -1;
            if (rows > 0)
            {
                maxCount = rows;
            }
            FavoritesViewModel favVM = new FavoritesViewModel();
            favVM.portalId = portalId;
            favVM.clientId = clientId;
            favVM.showBreadcrumb = _portal.Configuration.ShowBreadcrumbs;
            if (page > 0 && rows > 0)
            {
                favVM.ContentList = this._articleManager.GetFavorites(
                                                           n: -1,
                                                           dayCount: -1);
            }
            else
            {
                favVM.ContentList = this._articleManager.GetFavorites(
                                                           n: maxCount,
                                                           dayCount: -1);
            }
            var data = favVM.ContentList;
            if (page > 0 && rows > 0)
            {
                int count = page - 1;
                data = favVM.ContentList.Skip(rows * count).Take(rows).ToList();
            }

            var totalPages = 1;

            var jsondata = new
            {
                total = totalPages,
                page = maxCount,
                records = rows,

                rows = (
                           from m in data
                           select new
                           {
                               id = m.FavoriteId,
                               cell = new object[]{      m.ArticleBase.Id,
                                   m.ArticleBase.Title,
                                m.FavoriteOrder ,
                              String.Format("{0:MM/dd/yyyy}", m.LikeDate),
                              String.Format("{0:MM/dd/yyyy}", m.ViewDate),
                                m.ViewCount
                             }

                           }).ToArray()
            };
            return Json(jsondata, JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetFavJsondata()
        {
            ReadDataFromRouteData();
            int maxCount=-1;
            FavoritesViewModel favVM = new FavoritesViewModel();
            favVM.portalId = portalId;
            favVM.clientId = clientId;
            favVM.showBreadcrumb = _portal.Configuration.ShowBreadcrumbs;
            favVM.ContentList = this._articleManager.GetFavorites(
                                                       n: maxCount,
                                                       dayCount: -1);
            var data = favVM.ContentList;
            var totalPages = 1;

            var jsondata = new
            {
                total = totalPages,
                page = 1,
                records = 4,

                rows = (
                           from m in data
                           select new
                           {
                               id = m.FavoriteId,
                               cell = new object[]{      m.ArticleBase.Id,
                                   m.ArticleBase.Title,
                                m.FavoriteOrder ,
                              String.Format("{0:MM/dd/yyyy}", m.LikeDate),
                              String.Format("{0:MM/dd/yyyy}", m.ViewDate),
                                m.ViewCount
                             }

                           }).ToArray()
            };
            return Json(jsondata, JsonRequestBehavior.AllowGet);
        }