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); } }
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); } } }
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); } }