Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public bool UpdateEmployee(IEmployee emloyee, out IList <CodeMessage> messages)
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
            }

            EmsService.updateEmployeeAccountRequest request = new EmsService.updateEmployeeAccountRequest();

            request.careerLevelId = emloyee.CareerLevelId;
            request.cmptncyGrpId  = emloyee.CompetencyGroupId;
            request.cmptncyId     = emloyee.CompetencyId;
            request.commissionPct = emloyee.CommisionPct;
            request.departmentId  = long.Parse(emloyee.DepartmentId);
            request.email         = emloyee.Email;
            request.empTypeId     = emloyee.EmployeeTypeId;
            request.managerId     = emloyee.ManagerId;
            request.phoneNumber   = emloyee.CompetencyGroupId;
            request.salary        = emloyee.Salary;

            if (emloyee.PersonObject != null)
            {
                IPerson person = emloyee.PersonObject;
                request.acctType    = person.PersonType;
                request.countryId   = person.CountryId;
                request.firstName   = person.FirstName;
                request.lastName    = person.LastName;
                request.sex         = person.Sex;
                request.smsNumber   = person.PrimaryNumber;
                request.socialSecNo = person.SocialSecurityNumber;
            }

            return(Utility.ResolveCodeMessage(DataIntegrationMapper.ToGenericResponse(_emsEndPointClient.updateEmployeeAccount(request)), out messages));
        }
Beispiel #4
0
        public bool SaveScoreCard(IList <IScoreCard> scoreCards, out IList <CodeMessage> messages)
        {
            using (new OperationContextScope((IContextChannel)_smsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
            }

            SmsService.saveScoreCardRequest request = new SmsService.saveScoreCardRequest();

            for (int counter = 0; counter <= scoreCards.Count; counter++)
            {
                SmsService.scoreCardDto requestItem = new SmsService.scoreCardDto();

                requestItem.updateReason = scoreCards[counter].CompetencyGroupId;

                long competencyGroupId = 0;
                if (long.TryParse(scoreCards[counter].CompetencyGroupId, out competencyGroupId))
                {
                    requestItem.competencyGroupId          = competencyGroupId;
                    requestItem.competencyGroupIdSpecified = true;
                }

                long competencyId = 0;
                if (long.TryParse(scoreCards[counter].CompetencyId, out competencyId))
                {
                    requestItem.competencyId          = competencyId;
                    requestItem.competencyIdSpecified = true;
                }

                long employeeId = 0;
                if (long.TryParse(scoreCards[counter].EmployeeId, out employeeId))
                {
                    requestItem.employeeId          = employeeId;
                    requestItem.employeeIdSpecified = true;
                }

                long personId = 0;
                if (long.TryParse(scoreCards[counter].PersonId, out personId))
                {
                    requestItem.personId          = personId;
                    requestItem.personIdSpecified = true;
                }

                long recordStatusId = 0;
                if (long.TryParse(scoreCards[counter].RecordStatusId, out recordStatusId))
                {
                    requestItem.recordStatusId          = recordStatusId;
                    requestItem.recordStatusIdSpecified = true;
                }

                int scoreLevel = 0;
                if (int.TryParse(scoreCards[counter].ScoreLevel, out scoreLevel))
                {
                    requestItem.scoreLevel          = scoreLevel;
                    requestItem.scoreLevelSpecified = true;
                }

                long technologyKnowledgeGroupId = 0;
                if (long.TryParse(scoreCards[counter].TechnologyKnowledgeGroupId, out technologyKnowledgeGroupId))
                {
                    requestItem.technologyKnowledgeGroupId          = technologyKnowledgeGroupId;
                    requestItem.technologyKnowledgeGroupIdSpecified = true;
                }

                int year = 0;
                if (int.TryParse(scoreCards[counter].Year, out year))
                {
                    requestItem.year          = year;
                    requestItem.yearSpecified = true;
                }

                request.scoreCards[counter] = requestItem;
            }

            return(Utility.ResolveCodeMessage(DataIntegrationMapper.ToGenericResponse(_smsEndPointClient.saveScoreCard(request)), out messages));
        }