예제 #1
0
        public IActionResult GetReportingStructureByEmployeeId(String id)
        {
            _logger.LogDebug($"Received reporting structure get request for employee '{id}'");

            var reportingStructure = _reportingStructureService.GetByEmployeeId(id);

            if (reportingStructure == null)
            {
                return(NotFound());
            }

            return(Ok(reportingStructure));
        }
예제 #2
0
        public IActionResult GetEmployeeReportStructById(string id)
        {
            _logger.LogDebug($"Received ReportingStructure GET request for '{id}'");

            var strc = _reportingStructureService.GetByEmployeeId(id);

            if (strc == null)
            {
                return(NotFound());
            }

            return(Ok(strc));
        }
예제 #3
0
        public IActionResult Get(string id)
        {
            _logger.LogDebug($"Received Get Reporting Structure request for Employee [Id: {id}].");

            ReportingStructure reportingStructure;

            try
            {
                reportingStructure = _reportingStructureService.GetByEmployeeId(id);
            }
            catch (EmployeeNotFoundException e)
            {
                return(StatusCode((int)HttpStatusCode.NotFound, e.Message));
            }
            catch (Exception e)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
            }

            return(Ok(reportingStructure));
        }