Пример #1
0
 public HomePayment()
 {
     InitializeComponent();
     if (tNetTripData.Contains("CompleteTripBill"))
     {
         completeTrip = new DriverCompleteTrip();
         completeTrip = (DriverCompleteTrip)tNetTripData["CompleteTripBill"];
         myPassword = (string)tNetUserLoginData["PasswordMd5"];
     }
 }
Пример #2
0
        /// <summary>
        /// Hàm này để đặt lại mọi trạng thái điều kiện
        /// </summary>
        private void ResetFlag()
        {
            //For Router        
            driverGeocodeQuery = null;
            driverQuery = null;
            driverMapRoute = null;
            driverRoute = null;

            //For get Current Location
            driverFirstGeolocator = null;
            driverFirstGeoposition = null;
            driverMapOverlay = null;
            driverMapLayer = null;

            //For Router        
            driverGeocodeQuery = null;
            driverQuery = null;
            driverMapRoute = null;
            driverRoute = null;

            //For get Current Location
            driverFirstGeolocator = null;
            driverFirstGeoposition = null;
            driverMapOverlay = null;
            driverMapLayer = null;

            //Rider Destination Icon Overlay
            driverDestinationIconOverlay = null;

            //For Update Current Location
            currentLat = 0;
            currentLng = 0;
            countForUpdateLocation = 0;

            //For trip
            newTrip = null;
            myTrip = null;

            //For Trip Complete
            startLatitude = 0;
            startLongitude = 0;
            endLatitude = 0;
            endLongitude = 0;
            isTrack = false;
            estimateCost = 0;
            totalFare = 0;

            //For Distance
            distanceKm = 0;

            //mySelectedVehicle = null;
            if (tNetTripData != null)
            {
                tNetTripData = null;
            }

            //for complete trip
            completeTrip = null;

            //For continous tracking on map
            fiveStepBeforeLat = 0;
            fiveStepBeforeLng = 0;
            fiveStepAfterLat = 0;
            fiveStepAfterLng = 0;
            //driverMapTrackerQuery = null;
            //driverMapTrackerRoute = null;
            isTrackingRoute = false;
            countTracking = 0;
            //driverMapTrakerLayer = null;
            //driverMapTrackerOverlay = null;

            isCalculateFare = false;

            realDistance = 0;
            realFare = 0;
            isFinishTrip = false;

            isTrakingStated = false;

            txt_DistanceKm.Text = "0.0 (km)";
            txt_PricePerDistance.Text = "0.000 (đ)";
            txt_TotalPrice.Text = "0.000 (đ)";            
        }
Пример #3
0
        private async void TapToPay()
        {
            //Thông báo là đã kết thúc chuyến đi rồi
            isFinishTrip = true;

            //Khai báo điểm cuối hành trình
            SetEndCoordinateOfTrip(currentLat, currentLng);

            //Hiện loading grid screen
            ShowTapToPayLoadingScreen();

            //Chuyển đổi tọa độ qua địa chỉ
            var endAddressString = await GoogleAPIFunctions.ConvertLatLngToAddress(endLatitude, endLongitude);
            var endAddress = JsonConvert.DeserializeObject<GoogleAPIAddressObj>(endAddressString);
            var startAddressString = await GoogleAPIFunctions.ConvertLatLngToAddress(startLatitude, startLongitude);
            var startAddress = JsonConvert.DeserializeObject<GoogleAPIAddressObj>(startAddressString);

            //Tạo obj Complete Trip //
            completeTrip = new DriverCompleteTrip
            {
                uid = userId,
                pw = "",
                tid = newTrip.tid,
                eAdd = endAddress.results[0].formatted_address.ToString(),//Cái này để lấy địa chỉ từ tọa độ
                eCityName = endAddress.results[0].address_components[endAddress.results[0].address_components.Count - 2].long_name, //"Hà Nội"
                eLat = endLatitude,
                eLng = endLongitude,
                dis = 0, //Cập nhật Discount vào đây
                fare = estimateCost,
                lmd = tlmd,
                eCityId = GetCityCodeFromCityName(endAddress.results[0].address_components[endAddress.results[0].address_components.Count - 2].long_name)
            };

            //Sau cùng, Hiện grid Thanh toán
            ShowBillDetailGrid();

            //Hiện thông tin lên bill
            txt_BD_RiderName.Text = newTrip.rName;
            txt_BD_Mobile.Text = newTrip.mobile;
            txt_BD_From.Text = startAddress.results[0].formatted_address.ToString();//Cái này để lấy địa chỉ từ tọa độ
            txt_BD_To.Text = endAddress.results[0].formatted_address.ToString();//Cái này để lấy địa chỉ từ tọa độ
            txt_BD_Route.Text = realDistance.ToString();
            txt_BD_Cost.Text = string.Format("{0:#,##0}", DriverFunctions.RoundMoney(realFare, -3));
            txt_BD_Discount.Text = "0.0";
            txt_BD_TotalCost.Text = string.Format("{0:#,##0}", DriverFunctions.RoundMoney(realFare, -3));
        }