コード例 #1
0
 public IActionResult GetYears()
 {
     try {
         return(Ok(_year.GetAll()));
     } catch (Exception e) {
         return(NotFound(e));
     }
 }
コード例 #2
0
        public IActionResult GetReport()
        {
            try {
                List <Employee>   employees   = _employee.GetAll().ToList();
                List <Attendance> attendances = _attendance.GetAll().ToList();

                if (employees != null && attendances != null)
                {
                    return(Ok(new ReportResult(employees, attendances)));
                }
                else
                {
                    return(null);
                }
            } catch (Exception e) {
                return(BadRequest(e));
            }
        }
コード例 #3
0
        public IActionResult GetBreakDownReport([FromRoute] int id)
        {
            try {
                List <BreakDownHours> breakDownHours = _breakdown.GetAll().Where(b => b.AttendanceId == id).ToList();
                List <Site>           sites          = _site.GetAll().ToList();
                List <OvertimeType>   overtimeType   = _overtimeType.GetAll().ToList();

                return(Ok(new BreakdownReport(sites, overtimeType, breakDownHours)));
            } catch (Exception e) {
                return(BadRequest(e));
            }
        }