public IList <ICountry> GetAllCountry() { using (new OperationContextScope((IContextChannel)_cmsEndPointClient.InnerChannel)) { if (ServiceHeaders != null) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders); } CmsService.GetAllCountriesResponse response = _cmsEndPointClient.getAllCountries(new CmsService.getAllCountriesRequest()); IList <ICountry> listReturn = new List <ICountry>(); foreach (CmsService.countryDTO item in response.countries) { ICountry itemToTransform = Translator.LookupToEntity <Country>(DataIntegrationMapper.ToServiceLookup <CmsService.countryDTO>(item)); itemToTransform.Id = item.id.ToString(); itemToTransform.RegionId = item.regionId.ToString(); listReturn.Add(itemToTransform); } return(listReturn); } }
public IList <ICompetency> GetAllCompetency(out IList <CodeMessage> messages) { using (new OperationContextScope((IContextChannel)_smsEndPointClient.InnerChannel)) { if (ServiceHeaders != null) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders); } SmsService.GetAllCompetenciesResponse response = _smsEndPointClient.getAllCompetencies(new SmsService.getAllCompetenciesRequest()); IList <ICompetency> listReturn = new List <ICompetency>(); if (Utility.ResolveCodeMessage(DataIntegrationMapper.ToGenericResponse(response), out messages)) { foreach (SmsService.competencyDto competency in response.comptencies) { ICompetency competencyEntity = Helper.Translator.BaseToEntity <Competency>(DataIntegrationMapper.ToServiceLookup <SmsService.competencyDto>(competency)); competencyEntity.CompetencyId = competency.comeptencyId.ToString(); competencyEntity.Description = competency.comeptencyDescription; competencyEntity.Name = competency.comeptencyName; competencyEntity.ManagerId = competency.competencyManagerId.ToString(); competencyEntity.ManagerIdSpecified = competency.competencyManagerIdSpecified; competencyEntity.RecordStatusId = competency.recordStatusId.ToString(); competencyEntity.RecordStatusIdSpecified = competency.recordStatusIdSpecified; competencyEntity.Description = competency.comeptencyDescription; listReturn.Add(competencyEntity); } } return(listReturn); } }
public IList <IScoreCard> GetScoreCard(string employeeId, string competencyId, out IList <CodeMessage> messages) { using (new OperationContextScope((IContextChannel)_smsEndPointClient.InnerChannel)) { if (ServiceHeaders != null) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders); } } SmsService.GetScoreCardResponse response = _smsEndPointClient.getScoreCard(new SmsService.getScoreCardRequest() { employeeId = long.Parse(employeeId), competencyId = long.Parse(competencyId) }); IList <IScoreCard> listReturn = new List <IScoreCard>(); if (Utility.ResolveCodeMessage(DataIntegrationMapper.ToGenericResponse(response), out messages)) { foreach (SmsService.scoreCardViewDto scoreCard in response.scoreCards) { IScoreCard scoreCardEntity = Helper.Translator.BaseToEntity <ScoreCard>(DataIntegrationMapper.ToServiceLookup <SmsService.scoreCardViewDto>(scoreCard)); scoreCardEntity.CompetencyGroupId = scoreCard.competencyGroupId.ToString(); scoreCardEntity.CompetencyGroupIdSpecified = scoreCard.competencyGroupIdSpecified; scoreCardEntity.CompetencyId = scoreCard.competencyId.ToString(); scoreCardEntity.CompetencyIdSpecified = scoreCard.competencyIdSpecified; scoreCardEntity.EmployeeId = scoreCard.employeeId.ToString(); scoreCardEntity.EmployeeIdSpecified = scoreCard.employeeIdSpecified; scoreCardEntity.ScoreLevel = scoreCard.scoreLevel.ToString(); scoreCardEntity.ScoreLevelSpecified = scoreCard.scoreLevelSpecified; scoreCardEntity.TechnologyKnowledgeGroupId = scoreCard.technologyKnowledgeGroupId.ToString(); scoreCardEntity.TechnologyKnowledgeGroupIdSpecified = scoreCard.technologyKnowledgeDetailIdSpecified; scoreCardEntity.TechnologyKnowlegeDetailId = scoreCard.technologyKnowledgeDetailId.ToString(); scoreCardEntity.TechnologyKnowlegeDetailIdSpecified = scoreCard.technologyKnowledgeDetailIdSpecified; scoreCardEntity.Year = scoreCard.year.ToString(); scoreCardEntity.YearSpecified = scoreCard.yearSpecified; if (scoreCard.personIdSpecified) { scoreCardEntity.PersonId = scoreCard.personId.ToString(); scoreCardEntity.PersonObject = new Person() { PersonId = scoreCard.personId.ToString(), FirstName = scoreCard.firstName, LastName = scoreCard.lastName }; } listReturn.Add(scoreCardEntity); } } return(listReturn); }