Exemple #1
0
        public async Task <IActionResult> Get(int id)
        {
            var holiday = await _holidaysService.GetById(id);

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

            return(Ok(holiday));
        }
        private async Task ConfirmHoliday(int holidayId, int confirmerId)
        {
            var getHolidayDto = await _holidaysService.GetById(holidayId);

            var updateHolidayDto = _mapper.Map <UpdateHolidayDto>(getHolidayDto);

            updateHolidayDto.Status           = HolidayStatus.AdminConfirmed;
            updateHolidayDto.ConfirmerAdminId = confirmerId;
            await _holidaysService.Update(holidayId, updateHolidayDto);

            if (getHolidayDto.Type == HolidayType.DayForChildren)
            {
                await _employeeHolidaysConfirmationUpdater.UpdateDayForChildrenLeaves(getHolidayDto);
            }
            else if (getHolidayDto.Type == HolidayType.Annual)
            {
                await _employeeHolidaysConfirmationUpdater.UpdateEmployeesWorkdays(getHolidayDto);

                await _employeeHolidaysConfirmationUpdater.UpdateEmployeesOvertime(getHolidayDto);
            }
        }