public JsonResult ManageJsonList(int pageIndex = 1, int pageSize = 20)
        {
            int _total;
            var _list = commonModelService.FindPageList(out _total, pageIndex, pageSize, "Consultation", string.Empty, 0, string.Empty, null, null, 0).ToList().Select(
                cm => new CommonModelViewModel()
            {
                CategoryID    = cm.CategoryID,
                CategoryName  = cm.Category.Name,
                DefaultPicUrl = cm.DefaultPicUrl,
                Hits          = cm.Hits,
                Inputer       = cm.Inputer,
                Model         = cm.Model,
                ModelID       = cm.ModelID,
                ReleaseDate   = cm.ReleaseDate,
                Status        = cm.Status,
                Title         = cm.Title
            });

            return(Json(new { total = _total, rows = _list.ToList() }));
        }
Esempio n. 2
0
        public ActionResult JsonList(string title, string input, Nullable <int> category, Nullable <DateTime> fromDate, Nullable <DateTime> toDate, int pageIndex = 1, int pageSize = 20)
        {
            if (category == null)
            {
                category = 0;
            }
            int _total;
            var rows = commomModelService.FindPageList(out _total, pageIndex, pageSize, "Article", title, (int)category, input, fromDate, toDate, 0).Select(
                cm => new CommonModelViewModel()
            {
                CategoryID    = cm.CategoryID,
                CategoryName  = cm.Category.Name,
                DefaultPicUrl = cm.DefaultPicUrl,
                Hits          = cm.Hits,
                Inputer       = cm.Inputer,
                Model         = cm.Model,
                ModelID       = cm.ModelID,
                ReleaseDate   = cm.ReleaseDate,
                Status        = cm.Status,
                Title         = cm.Title
            });

            return(Json(new { total = _total, rows = rows.ToList() }));
        }