Exemplo n.º 1
0
        public IList <ICompetencyManager> GetAllCompetencyManager()
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }

                EmsService.GetAllCompetencyManagerResponse response = _emsEndPointClient.getAllCompetencyManager(new EmsService.getAllCompetencyManagerRequest());

                IList <ICompetencyManager> listReturn = new List <ICompetencyManager>();
                foreach (EmsService.employeeInfoDTO item in response.list)
                {
                    ICompetencyManager manager = Translator.EmployeeToEntity <CompetencyManager>(item);

                    if (item.accountInfoDTO != null)
                    {
                        manager.PersonObject = Translator.PersonToEntity(DataIntegrationMapper.ToAccountInfoDto(item.accountInfoDTO));
                    }

                    if (item.careerLevel != null)
                    {
                        manager.CareerLevelObject = Translator.CareerLevelToEntity(item.careerLevel);
                    }

                    if (item.job != null)
                    {
                        manager.JobObject = Translator.JobToEntity(item.job);
                    }

                    listReturn.Add(manager);
                }

                return(listReturn);
            }
        }