コード例 #1
0
        public async Task UpdateDayForChildrenLeaves(GetHolidayDto holidayDto)
        {
            var employee = await _repositoryEmployees.GetById(holidayDto.EmployeeId);

            var leaveTime   = _timeService.GetWorkDays(holidayDto.FromInclusive, holidayDto.ToInclusive);
            var currentTime = _timeService.GetCurrentTime();

            if (holidayDto.FromInclusive.Month != holidayDto.ToInclusive.Month)
            {
                var leaveTimeCurrentMonth = _timeService.GetRemainingMonthWorkDays(holidayDto.FromInclusive);
                var leaveTimeNextMonth    = leaveTime - leaveTimeCurrentMonth;
                employee.CurrentAvailableLeaves   -= leaveTimeCurrentMonth;
                employee.NextMonthAvailableLeaves -= leaveTimeNextMonth;
            }
            else if (holidayDto.FromInclusive.Month == currentTime.Month)
            {
                employee.CurrentAvailableLeaves -= leaveTime;
            }
            else
            {
                employee.NextMonthAvailableLeaves -= leaveTime;
            }

            await _repositoryEmployees.Update(employee);
        }
コード例 #2
0
        public async Task UpdateEmployeesOvertime(GetHolidayDto holidayDto)
        {
            var employee = await _repositoryEmployees.GetById(holidayDto.EmployeeId);

            var requestedOvertimeHours = _overtimeUtility.ConvertOvertimeDaysToHours(holidayDto.OvertimeDays);

            employee.OvertimeHours -= requestedOvertimeHours;
            await _repositoryEmployees.Update(employee);
        }
コード例 #3
0
        public async Task UpdateEmployeesWorkdays(GetHolidayDto holidayDto)
        {
            var workdays = _timeService.GetWorkDays(holidayDto.FromInclusive, holidayDto.ToInclusive);

            workdays -= holidayDto.OvertimeDays;
            var employee = await _repositoryEmployees.GetById(holidayDto.EmployeeId);

            employee.FreeWorkDays -= workdays;
            await _repositoryEmployees.Update(employee);
        }
コード例 #4
0
ファイル: HolidaysService.cs プロジェクト: MatZil/Testing
        public async Task <string> GetConfirmerFullName(GetHolidayDto holidayDto)
        {
            var confirmerFullName = string.Empty;

            if (holidayDto.ConfirmerAdminId > 0)
            {
                confirmerFullName = await GetEmployeeFullName(holidayDto.ConfirmerAdminId);
            }
            else if (holidayDto.ConfirmerClientId > 0)
            {
                confirmerFullName = await GetClientFullName(holidayDto.ConfirmerClientId);
            }

            return(confirmerFullName);
        }
コード例 #5
0
ファイル: HolidaysService.cs プロジェクト: MatZil/Testing
 private GetHolidayDto AddOvertimeDetails(GetHolidayDto holiday)
 {
     return(_overtimeUtility.AddOvertimeDetailsToHoliday(holiday));
 }
コード例 #6
0
ファイル: OvertimeUtility.cs プロジェクト: MatZil/Testing
        public GetHolidayDto AddOvertimeDetailsToHoliday(GetHolidayDto holiday)
        {
            holiday.OvertimeHours = Math.Round(ConvertOvertimeDaysToHours(holiday.OvertimeDays), 2);

            return(holiday);
        }