Example #1
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 (đ)";            
        }
Example #2
0
        private void ShowNotificationUpdateTrip()
        {
            var input = notificationReceivedString;
            myTrip = new DriverNotificationUpdateTrip();
            try
            {
                myTrip = JsonConvert.DeserializeObject<DriverNotificationUpdateTrip>(input);//Tạo đối tượng UpdateTrip từ Json Input                

                ///1. Update LMD để có thể cancel chuyến
                ///2. Kiểm tra mã Notification để hiện thông báo cho khách hàng
                ///2.1 RJ - Reject
                ///2.2 PD - Picked
                ///2.3 PI - Picking
                ///2.4 CA - Cancelled
                ///2.5 TA - Trip Complete
                tlmd = myTrip.lmd;

                switch (myTrip.tStatus) //<<<<< Cái này trả về thông tin bên ông Driver. vd: Nếu nhấn Start thì status là PI
                {
                    case ConstantVariable.tripStatusPicking: //Nếu là "PI" thì sẽ chạy hàm thông báo "Xe đang tới"
                        SwitchToPikingStatus();
                        break;
                    case ConstantVariable.tripStatusReject: //Nếu là "RJ" thì sẽ chạy hàm Thông báo xe bị hủy
                        SwitchToRejectStatus();
                        break;
                    case ConstantVariable.tripStatusCancelled: //Nếu là "CA" thì sẽ chạy hàm Thông báo hủy chuyến
                        SwitchToCanceledStatus();
                        break;
                    case ConstantVariable.tripStatusComplete: //Nếu là "TC" thì sẽ chạy hàm Hoàn thành chuyến đi
                        SwitchToCompletedStatus();
                        break;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("(Mã lỗi 403) " + ConstantVariable.errHasErrInProcess);
            }
        }
Example #3
0
 private void DeleteTrip()
 {
     Debug.WriteLine("Đã xóa dữ liệu chuyến đi");
     myTrip = null;
     newTrip = null;
 }