コード例 #1
0
ファイル: LookupIntegration.cs プロジェクト: odchie/PMS
        public IList <IStaffManager> GetAllStaffManager()
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }

                EmsService.GetAllStaffManagersResponse response = _emsEndPointClient.getAllStaffManagers(new EmsService.getAllStaffManagersRequest());

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

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

                    listReturn.Add(manager);
                }

                return(listReturn);
            }
        }
コード例 #2
0
ファイル: LookupIntegration.cs プロジェクト: odchie/PMS
        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);
            }
        }
コード例 #3
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);
        }
コード例 #4
0
        public IEmployee GetEmployeeAccount(string key, string value, out IList <CodeMessage> messages)
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }

                EmsService.GetEmployeeAccountResponse response = _emsEndPointClient.getEmployeeAccount(new EmsService.getEmployeeAccountRequest()
                {
                    key = key, value = value
                });

                if (Helper.Utility.ResolveCodeMessage(response, out messages))
                {
                    IEmployee employee = Translator.EmployeeToEntity <Employee>(DataIntegrationMapper.ToEmployeeDto(response));

                    if (response.person != null)
                    {
                        employee.FirstName    = response.person.firstName;
                        employee.MiddleName   = response.person.middleName;
                        employee.LastName     = response.person.lastName;
                        employee.PersonId     = response.person.id.ToString();
                        employee.PersonObject = Translator.PersonToEntity(DataIntegrationMapper.ToAccountInfoDto(response.person));
                    }

                    if (response.careerlevel != null)
                    {
                        employee.CareerLevelId     = response.careerlevel.id.ToString();
                        employee.CareerLevelObject = Translator.CareerLevelToEntity(response.careerlevel);
                    }

                    if (response.job != null)
                    {
                        employee.JobId     = response.job.id.ToString();
                        employee.JobObject = Translator.JobToEntity(response.job);
                    }

                    return(employee);
                }
                else
                {
                    return(null);
                }
            }
        }
コード例 #5
0
        public IPerson GetAccount(string key, string value)
        {
            using (new OperationContextScope((IContextChannel)_umsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }

                UmsService.GetAccountResponse response = _umsEndPointClient.getAccount(new UmsService.getAccountRequest()
                {
                    key = key, value = value
                });
                IPerson person = Translator.PersonToEntity(DataIntegrationMapper.ToAccountInfoDto(response));
                //Helper.Translator.PersonToEntity(
                //Person Person = new Person()
                //{
                //    FullName = Common.Helper.Utility.GenerateFullName(response.firstName, response.middleName, response.lastName),
                //    PersonId = response.id,
                //    ActivationToken = response.activationToken,
                //    Age = response.age,
                //    Birthday = response.birthday,
                //    BirthdaySpecified = response.birthdaySpecified,
                //    CountryId = response.country,
                //    CreateDate = response.createDate,
                //    CreateDateSpecified = response.createDateSpecified,
                //    ExternalEmail = response.email,
                //    FirstName = response.firstName,
                //    LastName = response.lastName,
                //    MiddleName = response.middleName,
                //    Reason = response.reason,
                //    Sex = response.sex,
                //    SocialSecurityNumber = response.socialSecNumber,
                //    StatusChangeBy = response.statusChangeBy,
                //    StatusChangeReason = response.statusChangeReason,
                //    StatusChangeTime = response.statusChangeTime,
                //    StatusChangeTimeSpecified = response.statusChangeTimeSpecified,
                //    UpdateDate = response.updateDate,
                //    UpdateDateSpecified = response.updateDateSpecified,
                //};

                return(person);
            }
        }
コード例 #6
0
ファイル: LookupIntegration.cs プロジェクト: odchie/PMS
        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);
            }
        }
コード例 #7
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));
        }
コード例 #8
0
ファイル: LookupIntegration.cs プロジェクト: odchie/PMS
        public IList <IDepartment> GetAllDepartment()
        {
            using (new OperationContextScope((IContextChannel)_cmsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
                CmsService.RetrieveAllDepartmentResponse response = _cmsEndPointClient.getAllDepartments(new CmsService.getAllDepartmentsRequest());

                IList <IDepartment> listReturn = new List <IDepartment>();
                foreach (CmsService.departmentInfoDTO item in response.departmentList)
                {
                    IDepartment itemToTransform = Translator.BaseToEntity <Department>(DataIntegrationMapper.ToServiceBase <CmsService.departmentInfoDTO>(item));
                    //IDepartment department = Translator.LookupToEntity<Department>(DataIntegrationMapper.ToOfficeLocationDto(item));
                    itemToTransform.Status     = item.status.ToString();
                    itemToTransform.LocationId = item.locationId.ToString();
                    itemToTransform.ManagerId  = item.managerId.ToString();
                    listReturn.Add(itemToTransform);
                }

                return(listReturn);
            }
        }
コード例 #9
0
ファイル: LookupIntegration.cs プロジェクト: odchie/PMS
        public IList <ICareerLevel> GetAllCareerLevel()
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
                EmsService.SearchAccountResponse response = _emsEndPointClient.getAllCareerLevels(new EmsService.getAllCareerLevelsRequest());

                IList <ICareerLevel> listReturn = new List <ICareerLevel>();
                foreach (EmsService.careerLevelDTO item in response.careerLevels)
                {
                    ICareerLevel itemToTransform = Translator.BaseToEntity <CareerLevel>(DataIntegrationMapper.ToServiceBase <EmsService.careerLevelDTO>(item));

                    itemToTransform.CareerLevelId      = item.id.ToString();
                    itemToTransform.CareerLevelGroupId = item.careerLvlGrp.ToString();
                    itemToTransform.CareerTitle        = item.careerTitle;
                    itemToTransform.IndustryExperience = item.indExp;
                    itemToTransform.RoleExperience     = item.roleExp;
                    itemToTransform.Route = item.route;
                    listReturn.Add(itemToTransform);
                }

                return(listReturn);
            }
        }
コード例 #10
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));
        }