Ejemplo n.º 1
0
 public string FormHistResponse(StatisticsRequest request)
 {
     var response = new StatisticsResponse
     {
         Labels = GetLabels(request.Year, request.StartMonth, request.EndMonth),
         VacationAbsenceData = GetTotalAbsenceValues(request, Reason.V),
         SickAbsenceData = GetTotalAbsenceValues(request, Reason.S),
         PersonalAbsenceData = GetTotalAbsenceValues(request, Reason.P)
     };
     return JsonConvert.SerializeObject(response);
 }
Ejemplo n.º 2
0
        private IEnumerable<int> GetTotalAbsenceValues(StatisticsRequest request, Reason reason)
        {
            var employees = request.ProjectId == null
                ? employeeService.GetAllViewModels()
                : projectService.GetSingle((int) request.ProjectId).CurrentEmployees;

            var totalList = new List<int>();

            for (var currentMonth = request.StartMonth; currentMonth < request.EndMonth + 1; currentMonth++)
            {
                totalList.Add(GetAbsenceValuesInSingleMonth(employees, reason, currentMonth, request.Year,
                    request.ProjectId));
            }
            return totalList;
        }
Ejemplo n.º 3
0
 public string GetData(StatisticsRequest request)
 {
     return statisticsService.FormHistResponse(request);
 }