Exemple #1
0
        public JsonResult GetEvents(DataTableAjaxPostModel model)
        {
            Pagination paginateModel = model.ToPagination();
            int        recordsTotal  = 0;

            List <EventsDto> eventsCollection = new List <EventsDto>();

            WCFProxy.Using((delegate(IEventsAndNewsService client)
            {
                eventsCollection = client.getEvents(1, paginateModel, out recordsTotal);
            }));

            return(Json(new
            {
                // this is what datatables wants sending back
                draw = model.draw,
                recordsTotal = recordsTotal,
                recordsFiltered = recordsTotal,
                data = eventsCollection
            }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetStudents(DataTableAjaxPostModel model)
        {
            Pagination        paginateModel     = model.ToPagination();
            int               recordsTotal      = 0;
            StudentCollection studentCollection = new StudentCollection();

            WCFProxy.Using((delegate(IClassSetupService client)
            {
                studentCollection = client.getStudent(1, 1, paginateModel);
            }));

            recordsTotal = studentCollection.TotalCount;
            var data = studentCollection.StudentList.Skip(paginateModel.Skip).Take(paginateModel.PageSize).ToList();

            return(Json(new
            {
                // this is what datatables wants sending back
                draw = model.draw,
                recordsTotal = recordsTotal,
                recordsFiltered = recordsTotal,
                data = data
            }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetHolidays(DataTableAjaxPostModel model)
        {
            Pagination         paginateModel = model.ToPagination();
            int                recordsTotal  = 0;
            List <HolidaysDto> holidaysList  = new List <HolidaysDto>();

            WCFProxy.Using((delegate(IClassSetupService client)
            {
                holidaysList = client.getHolidayDetail(1);
            }));

            recordsTotal = holidaysList.Count();
            var data = holidaysList.Skip(paginateModel.Skip).Take(paginateModel.PageSize).ToList();

            return(Json(new
            {
                // this is what datatables wants sending back
                draw = model.draw,
                recordsTotal = recordsTotal,
                recordsFiltered = recordsTotal,
                data = data
            }, JsonRequestBehavior.AllowGet));
        }