Ejemplo n.º 1
0
        public List<BrowserInfo> GetData(DataTableParameters dataTableParameters, out int TotalRecords, out int TotalDisplayRecords)
        {
            TotalRecords = browserInfoList.Count;
            TotalDisplayRecords = browserInfoList.Count;

            if (dataTableParameters.DisplayLength == 0)
                return browserInfoList;

            var query = browserInfoList
                        .Skip(dataTableParameters.DisplayStart)
                        .Take(dataTableParameters.DisplayLength);                        

            return query.ToList<BrowserInfo>();                        
        }
        public JsonResult GetJsonData()
        {
            DataTableParameters dataTableParameters = new DataTableParameters(Request.QueryString);
            DataTableResult dataTableResult = new DataTableResult();
            int iTotalRecords, iTotalDisplayRecords;

            dataTableResult.aaData = db.GetData(dataTableParameters, out iTotalRecords, out iTotalDisplayRecords).ToArray();

            dataTableResult.sEcho = dataTableParameters.Echo;
            dataTableResult.iTotalRecords = iTotalRecords;
            dataTableResult.iTotalDisplayRecords = iTotalDisplayRecords;

            return Json(dataTableResult, JsonRequestBehavior.AllowGet);
        }