public ActionResult AjaxHandler(jQueryDataTableParam param) { if (param.todaysdate != null) { var clientDate = DateTime.Parse(param.todaysdate); var utcDate = TimeZoneInfo.ConvertTimeToUtc(clientDate, _clientTimeZoneInfo); param.todaysdate = utcDate.ToString(CultureInfo.InvariantCulture); } //Get all the records var vo = map.Map <jQueryDataTableParam, viewOptions>(param); dataTableResult <WorkAssignmentsList> was = waServ.GetIndexView(vo); MapperHelpers.ClientTimeZoneInfo = _clientTimeZoneInfo; var result = was.query .Select(e => map.Map <WorkAssignmentsList, ViewModel.WorkAssignmentsList>(e)) .AsEnumerable(); return(Json(new { param.sEcho, iTotalRecords = was.totalCount, iTotalDisplayRecords = was.filteredCount, aaData = result })); }
// GET api/values public IHttpActionResult Get() { var vo = new viewOptions(); vo.displayLength = 10; vo.displayStart = 0; dataTableResult <DTO.WorkAssignmentsList> list = serv.GetIndexView(vo); var result = list.query .Select( e => map.Map <DTO.WorkAssignmentsList, Web.ViewModel.Api.WorkAssignment>(e) ).AsEnumerable(); return(Json(new { data = result })); }
public ActionResult AjaxHandler(jQueryDataTableParam param) { //Get all the records var vo = map.Map <jQueryDataTableParam, viewOptions>(param); vo.CI = CI; dataTableResult <WorkAssignmentsList> was = waServ.GetIndexView(vo); var result = was.query .Select(e => map.Map <WorkAssignmentsList, ViewModel.WorkAssignmentsList>(e)) .AsEnumerable(); return(Json(new { param.sEcho, iTotalRecords = was.totalCount, iTotalDisplayRecords = was.filteredCount, aaData = result })); }