Пример #1
0
        private GeneralFlightDto GetGeneralFlightDto(RequestToProvider request)
        {
            var generalFlight = new GeneralFlightDto()
            {
                BookFlight   = MapperT <RequestToProvider, BookFlightDto> .GetTMap(request),
                Flight       = MapperT <RequestToProvider, FlightDto> .GetTMap(request),
                SearchFlight = MapperT <RequestToProvider, SearchFlightDto> .GetTMap(request)
            };

            return(generalFlight);
        }
Пример #2
0
        /// <summary>
        /// Realiza una busqueda de transporte
        /// </summary>
        /// <param name="informationProv"></param>
        /// <param name="concreteDto"></param>
        /// <returns></returns>
        public async Task <GeneralFlightDto> GetResponseSearch(InformationProvider informationProv, GeneralFlightDto concreteDto)
        {
            var service = await GetService(informationProv);

            if (service != null)
            {
                var trip = await service.SearchFlight(concreteDto.SearchFlight);

                concreteDto.Trip = trip;
                return(concreteDto);
            }

            return(new GeneralFlightDto());
        }
Пример #3
0
        /// <summary>
        /// Reserva un transporte
        /// </summary>
        /// <param name="informationProv"></param>
        /// <param name="concreteDto"></param>
        /// <returns></returns>
        public async Task <GeneralFlightDto> GetResponseBook(InformationProvider informationProv, GeneralFlightDto concreteDto)
        {
            var service = await GetService(informationProv);

            if (service != null)
            {
                var book = await service.BookFlight(concreteDto.BookFlight);

                concreteDto.BookFlightResponse = book;
                return(concreteDto);
            }

            return(new GeneralFlightDto());
        }