public ActionResult AllSettings(DataSourceRequest command,
            Framework.Kendoui.Filter filter = null, Sort sort = null)
        {
            var settings = this._settingService.GetAllSettings().Select(x => new SettingModel
                                {
                                    Id = x.Id,
                                    Name = x.Name,
                                    Value = x.Value
                                }).AsQueryable()
                .Filter(filter)
                .Sort(sort);
            int total = settings.Count();


            var totalPages = total / command.PageSize;
            if (total % command.PageSize > 0)
                totalPages++;

            var gridModel = new DataSourceResult
            {
                Data = settings.PagedForCommand(command).ToList(),
                TotalRecords = total,
                TotalPages = totalPages

            };
            return Json(gridModel);
        }

 

posted on 2015-06-10 17:28  王洪洪  阅读(453)  评论(0编辑  收藏  举报