Exemplo n.º 1
0
        public async Task <dto.FindAgentsResponse> GetAgentList(dto.FindAgentRequestData findAgentRequestData = null)
        {
            var signature = await _sessionBag.Signature();

            var requestData = findAgentRequestData != null?Mapper.Map <FindAgentRequestData>(findAgentRequestData)
                                  : new FindAgentRequestData
            {
                DomainCode       = _newskiesSettings.AgentDomain,
                OrganizationCode = await _sessionBag.OrganizationCode(),
                AgentName        = new Navitaire.WebServices.DataContracts.Common.ParentMessageBase.SearchString
                {
                    Value      = "",
                    SearchType = nskCommonEnum.SearchType.StartsWith
                },
                PageSize = 10
            };
            var response = await _client.FindAgentsAsync(new FindAgentsRequest
            {
                ContractVersion        = _navApiContractVer,
                MessageContractVersion = _navMsgContractVer,
                Signature = signature,
                EnableExceptionStackTrace = false,
                FindAgentRequestData      = requestData
            });

            var mappedResponse = Mapper.Map <dto.FindAgentsResponse>(response);

            return(mappedResponse);
        }
Exemplo n.º 2
0
        public async Task <dto.FindAgentsResponse> FindAgent(dto.FindAgentRequestData findAgentRequestData)
        {
            var signature = !string.IsNullOrEmpty(await _sessionBag.Signature())
                    ? await _sessionBag.Signature()
                    : await _userSessionService.GetAnonymousSharedSignature();

            var mappedRequest = Mapper.Map <FindAgentRequestData>(findAgentRequestData);
            var response      = await _client.FindAgentsAsync(new FindAgentsRequest
            {
                ContractVersion        = _navApiContractVer,
                MessageContractVersion = _navMsgContractVer,
                Signature = signature,
                EnableExceptionStackTrace = false,
                FindAgentRequestData      = mappedRequest
            });

            return(Mapper.Map <dto.FindAgentsResponse>(response));
        }