Exemplo n.º 1
0
        public IList <IDepartmentManager> GetAllDepartmentManager()
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
                EmsService.GetAllDepartmentManagerResponse response = _emsEndPointClient.getAllDepartmentManager(new EmsService.getAllDepartmentManagerRequest());

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

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

                    listReturn.Add(manager);
                }

                return(listReturn);
            }
        }