Exemplo n.º 1
0
        public bool SaveEmployee(IEmployee emloyee, out IList <CodeMessage> messages)
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
            }

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

            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.saveEmployeeAccount(request)), out messages));
        }