Пример #1
0
        async void NextButtonTapped_Tapped(object sender, EventArgs e)
        {
            if (StripePayment())
            {
                ShoferAppST shoferBooking = ShoferAppST.Instance();
                shoferBooking.Booking.PaymentType  = selectedPaymentType.ToLower() == "shofarwallet" ? "wallet" : "Card";
                shoferBooking.Booking.CardNumber   = txtCardNumber.Text;
                shoferBooking.Booking.NameOnCard   = txtNameOnCard.Text;
                shoferBooking.Booking.ExpiryMointh = txtMonth.Text;
                shoferBooking.Booking.ExpiryYear   = txtYear.Text;
                shoferBooking.Booking.CVV          = txtCVV.Text;

                IsLoading = true;
                // do booking
                WebConnection service = new WebConnection();
                service.On_ResponseRecived += Service_On_ResponseRecived;
                await service.DoBooking(shoferBooking.Booking);
            }

            //await Navigation.PushAsync(new FullBookingInformation());
        }
Пример #2
0
        void FairEstimate_NextButton_Click()
        {
            Debug.WriteLine("Fair Estimate {0} {1}", pickupPosition.Latitude, pickupPosition.Longitude);
            var destinationPage = new DestinationPage();

            LoginResponse loginUser = Application.Current.Properties["userData"] as LoginResponse;


            if (LocationName == null && txtLocation.Text == "")
            {
                Application.Current.MainPage.DisplayAlert("Shofar", "Please choose correct location", "OK");
            }
            else if (LocationName != null && txtLocation.Text != "")
            {
                LocationName = txtLocation.Text;
            }
            else
            {
                LocationName = "Current Location";
            }

            // Create new booking
            ShoferAppST shoferBooking = ShoferAppST.Instance();

            shoferBooking.Booking = new BookingData();
            shoferBooking.Booking.PickupPosition     = pickupPosition;
            shoferBooking.Booking.PickupPositionName = LocationName;
            shoferBooking.Booking.VehicleType        = selectedCar;
            shoferBooking.Booking.DriverId           = "2";
            shoferBooking.Booking.UserId             = loginUser.id;
            shoferBooking.Booking.KMPrice            = Convert.ToDouble(selectedVechileInfo.per_km_charge);
            shoferBooking.Booking.BasePrice          = Convert.ToDouble(selectedVechileInfo.base_fare);

            destinationPage.pickupPosition = pickupPosition;
            Navigation.PushAsync(destinationPage);
        }
Пример #3
0
        public BookingDetailsPage()
        {
            InitializeComponent();

            var nextBtnClick = new TapGestureRecognizer();

            nextBtnClick.Tapped += NextBtnClick_Tapped;
            btnNext.GestureRecognizers.Add(nextBtnClick);

            // Create new booking
            //   ShoferAppST shoferBooking = ShoferAppST.Instance();
            ShoferAppST shoferBooking = ShoferAppST.Instance();

            txtPickup.Text = shoferBooking.Booking.PickupPositionName;

            txtDestination.Text = shoferBooking.Booking.DestinationPositionName;

            var bookingFare = shoferBooking.Booking.BasePrice + (shoferBooking.Booking.KMPrice * shoferBooking.Booking.Distance);

            txtDistance.Text = $"{shoferBooking.Booking.Distance : 00.00} Kms";  //380 kms";

            txtCodeword.Text  = shoferBooking.Booking.PinCode;
            txtFarePrice.Text = $"Rs. {bookingFare: 00.00}";
        }