public JsonResult IndexSource(DataTable.Request request)
        {
            var totalCount = 0;
            var list       = new List <Models.AppClientListModel>();

            foreach (var item in new Application.AppClient().Paging(request.PageIndex, request.PageSize, out totalCount))
            {
                var model = item.MapTo(new Models.AppClientListModel());
                model.IdDisplay = item.Id;
                list.Add(model);
            }
            return(Json(DataTable.Source(list, request, totalCount)));
        }
Ejemplo n.º 2
0
        public JsonResult IndexDataSource(DataTable.Request request)
        {
            var list = new List <Models.TableListModel>();

            foreach (var item in DataService.Instance.List())
            {
                var model = new Models.TableListModel
                {
                    Id   = item.Id,
                    Name = item.Name,
                };
                if (item.Avatar != null)
                {
                    model.Avatar = FileLocation.Create(item.Avatar.Name, item.Avatar.Type, string.Format("/File/Get/{0}", item.Id));
                }
                list.Add(model);
            }
            return(Json(DataTable.Source(list, request, list.Count)));
        }
Ejemplo n.º 3
0
        public JsonResult IndexDataSource(DataTable.Request request)
        {
            var list = GetDataSource().Skip((request.PageIndex - 1) * request.PageSize).Take(request.PageSize);

            return(Json(DataTable.Source(list, request, GetDataSource().Count)));
        }