Пример #1
0
        public ActionResult GetData(int page = 1, int rows = 10, string sort = "Id", string order = "asc", string filterRules = "")
        {
            var filters    = JsonConvert.DeserializeObject <IEnumerable <filterRule> >(filterRules);
            int totalCount = 0;
            //int pagenum = offset / limit +1;
            var processnodes = _processNodeService.Query(new ProcessNodeQuery().Withfilter(filters)).OrderBy(n => n.OrderBy(sort, order)).SelectPage(page, rows, out totalCount);
            var datarows     = processnodes.Select(n => new { Id = n.Id, Order = n.Order, Name = n.Name, MachineModel = n.MachineModel, Node = n.Node, Description = n.Description }).ToList();
            var pagelist     = new { total = totalCount, rows = datarows };

            return(Json(pagelist, JsonRequestBehavior.AllowGet));
        }