Exemplo n.º 1
0
        public IList <IManager> GetAllManager()
        {
            using (new OperationContextScope((IContextChannel)_emsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
                EmsService.GetAllManagersResponse response = _emsEndPointClient.getAllManagers(new EmsService.getAllManagersRequest());

                IList <IManager> listReturn = new List <IManager>();

                if (response.list != null)
                {
                    foreach (EmsService.employeeInfoDTO item in response.list)
                    {
                        IManager manager = Translator.EmployeeToEntity <Manager>(item);
                        if (item.accountInfoDTO != null)
                        {
                            manager.PersonObject = Translator.PersonToEntity(DataIntegrationMapper.ToAccountInfoDto(item.accountInfoDTO));
                        }
                        listReturn.Add(manager);
                    }
                }

                return(listReturn);
            }
        }