示例#1
0
        public async Task <bool> RequestClientApproval(int holidayId)
        {
            var holiday = await _repositoryHolidays.GetById(holidayId);

            var employee = await _repositoryEmployees.GetById(holiday.EmployeeId);

            if (employee.ClientId == null)
            {
                await RequestAdminApproval(holidayId, EmployeeClientStatus.HAS_NO_CLIENT, null);

                return(true);
            }

            var client = await _repositoryClients.GetById(employee.ClientId.GetValueOrDefault());

            await _emailService.ConfirmHolidayWithClient(client, employee, holiday);

            return(true);
        }