Exemplo n.º 1
0
        public override Gateway.DispatchTripResponse DispatchTrip(Gateway.DispatchTripRequest request)
        {
            Logger.BeginRequest("DispatchTrip sent to " + name, request);
            GatewayService.Dispatch dispatch = new GatewayService.Dispatch
            {
                access_token  = AccessToken,
                PassengerId   = request.passengerID,
                PassengerName = request.passengerName,
                Luggage       = request.luggage,
                Persons       = request.persons,
                PickupLat     = request.pickupLocation.Lat,
                PickupLng     = request.pickupLocation.Lng,
                PickupTime    = request.pickupTime,
                DropoffLat    = request.dropoffLocation == null ? (double?)null : request.dropoffLocation.Lat,
                DropoffLng    = request.dropoffLocation == null ? (double?)null : request.dropoffLocation.Lng,
                PaymentMethod = request.paymentMethod,
                VehicleType   = request.vehicleType,
                MaxPrice      = request.maxPrice,
                MinRating     = request.minRating,
                PartnerId     = request.partnerID,
                FleetId       = request.fleetID,
                DriverId      = request.driverID,
                TripId        = request.tripID
            };
            JsonServiceClient client = new JsonServiceClient(RootUrl);

            GatewayService.DispatchResponse resp     = client.Get <GatewayService.DispatchResponse>(dispatch);
            Gateway.DispatchTripResponse    response = new Gateway.DispatchTripResponse
            {
                result = resp.ResultCode,
            };
            Logger.EndRequest(response);
            return(response);
        }
Exemplo n.º 2
-1
 public override Gateway.DispatchTripResponse DispatchTrip(Gateway.DispatchTripRequest request)
 {
     Logger.BeginRequest("DispatchTrip sent to " + name, request);
     GatewayService.Dispatch dispatch = new GatewayService.Dispatch
     {
         access_token = AccessToken,
         PassengerId = request.passengerID,
         PassengerName = request.passengerName,
         Luggage = request.luggage,
         Persons = request.persons,
         PickupLat = request.pickupLocation.Lat,
         PickupLng = request.pickupLocation.Lng,
         PickupTime = request.pickupTime,
         DropoffLat = request.dropoffLocation == null ? (double?) null : request.dropoffLocation.Lat,
         DropoffLng = request.dropoffLocation == null ? (double?) null : request.dropoffLocation.Lng,
         PaymentMethod = request.paymentMethod,
         VehicleType = request.vehicleType,
         MaxPrice = request.maxPrice,
         MinRating = request.minRating,
         PartnerId = request.partnerID,
         FleetId = request.fleetID,
         DriverId = request.driverID,
         TripId = request.tripID
     };
     JsonServiceClient client = new JsonServiceClient(RootUrl);
     GatewayService.DispatchResponse resp = client.Get<GatewayService.DispatchResponse>(dispatch);
     Gateway.DispatchTripResponse response = new Gateway.DispatchTripResponse
     {
         result = resp.ResultCode,
     };
     Logger.EndRequest(response);
     return response;
 }