public ActionResult HistoryList(GridCommand command, int taskId) { var gridModel = new GridModel <ScheduleTaskHistoryModel>(); var history = _scheduleTaskService.GetHistoryEntries(command.Page - 1, command.PageSize, taskId); gridModel.Total = history.TotalCount; gridModel.Data = history.Select(x => _adminModelHelper.CreateScheduleTaskHistoryModel(x)).ToList(); return(new JsonResult { Data = gridModel }); }
public ActionResult HistoryList(GridCommand command, int taskId) { var gridModel = new GridModel <ScheduleTaskHistoryModel>(); if (Services.Permissions.Authorize(StandardPermissionProvider.ManageScheduleTasks)) { var history = _scheduleTaskService.GetHistoryEntries(command.Page - 1, command.PageSize, taskId); gridModel.Total = history.TotalCount; gridModel.Data = history.Select(x => _adminModelHelper.CreateScheduleTaskHistoryModel(x)).ToList(); } else { gridModel.Data = Enumerable.Empty <ScheduleTaskHistoryModel>(); NotifyAccessDenied(); } return(new JsonResult { Data = gridModel }); }