Example #1
0
        public IbsHailResponse Hail(Guid orderId, int?providerId, int accountId, string passengerName, string phone, string email, int nbPassengers, int?vehicleTypeId, int?chargeTypeId, string note, DateTime pickupDateTime, IbsAddress pickup, IbsAddress dropoff, string accountNumber, int?customerNumber, string[] prompts, int?[] promptsLength, int defaultVehiculeTypeId, IEnumerable <IbsVehicleCandidate> vehicleCandidates, double?tipIncentive, int?tipPercent, Fare fare = default(Fare))
        {
            var order = CreateIbsOrderObject(providerId, accountId, passengerName, phone, email, nbPassengers, vehicleTypeId,
                                             chargeTypeId, note, pickupDateTime, pickup, dropoff, accountNumber, customerNumber, prompts,
                                             promptsLength, defaultVehiculeTypeId, tipIncentive, tipPercent, string.Empty, fare, orderId);

            var orderKey     = new TBookOrderKey();
            var vehicleComps = Mapper.Map <TVehicleComp[]>(vehicleCandidates);

            UseService(service =>
            {
                Logger.LogMessage("WebService Creating IBS Hail : " + JsonSerializer.SerializeToString(order, typeof(TBookOrder_12)));
                Logger.LogMessage("WebService Creating IBS Hail pickup : " + JsonSerializer.SerializeToString(order.PickupAddress, typeof(TWEBAddress)));
                Logger.LogMessage("WebService Creating IBS Hail dest : " + JsonSerializer.SerializeToString(order.DropoffAddress, typeof(TWEBAddress)));

                orderKey = service.SaveBookOrder_12(UserNameApp, PasswordApp, order, vehicleComps);
                Logger.LogMessage("WebService Create Hail, orderid received : " + orderKey.OrderID + ", orderGUID received : " + orderKey.GUID);
            });

            return(new IbsHailResponse
            {
                OrderKey = new IbsOrderKey
                {
                    TaxiHailOrderId = orderKey.GUID.HasValue() ? Guid.Parse(orderKey.GUID) : Guid.Empty,
                    IbsOrderId = orderKey.OrderID
                }
            });
        }
Example #2
0
        public int?CreateOrder(Guid orderId, int?providerId, int accountId, string passengerName, string phone, string email, int nbPassengers, int?vehicleTypeId, int?chargeTypeId, string note, DateTime pickupDateTime, IbsAddress pickup, IbsAddress dropoff, string accountNumber, int?customerNumber, string[] prompts, int?[] promptsLength, int defaultVehiculeTypeId, double?tipIncentive, int?tipPercent, string assignVehicleId, Fare fare = default(Fare))
        {
            var order = CreateIbsOrderObject(providerId, accountId, passengerName, phone, email, nbPassengers, vehicleTypeId,
                                             chargeTypeId, note, pickupDateTime, pickup, dropoff, accountNumber, customerNumber, prompts,
                                             promptsLength, defaultVehiculeTypeId, tipIncentive, tipPercent, assignVehicleId, fare, orderId);

            var orderKey = new TBookOrderKey();

            UseService(service =>
            {
                Logger.LogMessage("WebService Creating IBS Order : " + JsonSerializer.SerializeToString(order, typeof(TBookOrder_10)));
                Logger.LogMessage("WebService Creating IBS Order pickup : " + JsonSerializer.SerializeToString(order.PickupAddress, typeof(TWEBAddress)));
                Logger.LogMessage("WebService Creating IBS Order dest : " + JsonSerializer.SerializeToString(order.DropoffAddress, typeof(TWEBAddress)));

                orderKey.OrderID = service.SaveBookOrder_10(UserNameApp, PasswordApp, order);
                Logger.LogMessage("WebService Create Order, orderid received : " + orderKey.OrderID);
            });

            var result = new IbsHailResponse
            {
                OrderKey = new IbsOrderKey
                {
                    TaxiHailOrderId = orderKey.GUID.HasValue() ? Guid.Parse(orderKey.GUID) : Guid.Empty,
                    IbsOrderId      = orderKey.OrderID
                }
            };

            return(result.OrderKey.IbsOrderId);
        }