Example #1
0
        public async Task <ActionResult> MonitorList_Read(int?page, int?rows)
        {
            int ppage = Convert.ToInt32(page == null ? 1 : page);
            int prows = Convert.ToInt32(rows == null ? 1 : rows);
            IEnumerable <Monitor> imonitor = await MonitorRepository.FindAllAsync();

            IEnumerable <Monitor> imonitorByOrder = imonitor.OrderByDescending(i => i.MonitorDate).ToList();

            return(Json(new
            {
                total = imonitorByOrder.Count(),
                rows = imonitorByOrder.Skip((ppage - 1) * prows).Take(prows)
            }));
        }