Beispiel #1
0
        public ListResultDto <VacationTypesListDto> GetVacationTypes(EmployeeDataInput input)
        {
            var          emp     = _employeeDataRepository.GetAll().ToList().Where(x => x.Id == input.SAPCode);
            EmployeeData empdata = new EmployeeData();

            empdata = emp.FirstOrDefault();

            if (empdata.EmployeeType == 1)
            {
                List <int> notindluceded = new List <int> {
                    1013, 1011, 1017, 1001, 1018, 1021, 1019
                };
                var vacationTypes = _vacationTypeRepository.GetAllIncluding(a => a.User)
                                    .ToList()
                                    .Where(x => !notindluceded.Contains(x.SAPCodeType));


                return(new ListResultDto <VacationTypesListDto>(ObjectMapper.Map <List <VacationTypesListDto> >(vacationTypes)));
            }
            else if (empdata.EmployeeType == 7)
            {
                List <int> notindluceded = new List <int> {
                    1013, 1011, 1006, 1017, 1014, 1019
                };
                var vacationTypes = _vacationTypeRepository.GetAllIncluding(a => a.User)
                                    .ToList()
                                    .Where(x => !notindluceded.Contains(x.SAPCodeType) && x.ServiceDeskId != 901);

                return(new ListResultDto <VacationTypesListDto>(ObjectMapper.Map <List <VacationTypesListDto> >(vacationTypes)));
            }

            List <VacationTypesListDto> EmptyTypes = new List <VacationTypesListDto>();

            return(new ListResultDto <VacationTypesListDto>(ObjectMapper.Map <List <VacationTypesListDto> >(EmptyTypes)));
        }
        public ListResultDto <EmployeeDto> GetEmployeeData(EmployeeDataInput input)
        {
            var emp = _employeeDataRepository.GetAll().ToList().Where(x => x.Id == input.SAPCode);

            return(new ListResultDto <EmployeeDto>(ObjectMapper.Map <List <EmployeeDto> >(emp)));
        }