public async void getFinishedItinerariesOfCustomer() { //reset Itinerary Global.GlobalData.itinearyList = new ItineraryList(); //send get request var result = await Request.RequestToServer.sendGetRequest("itineraries/customer/itinerary_status"); RootObject root = JsonConvert.DeserializeObject <RootObject>(result); //xu ly json foreach (Itinerary i in root.itineraries) { Itinerary2 i2 = new Itinerary2 { itinerary_id = i.itinerary_id, driver_id = i.driver_id, customer_id = Convert.ToInt32(i.customer_id), start_address = i.start_address, start_address_lat = i.start_address_lat, start_address_long = i.start_address_long, end_address = i.end_address, end_address_lat = i.end_address_lat, end_address_long = i.end_address_long, pick_up_address = i.pick_up_address, pick_up_address_lat = i.pick_up_address_lat, pick_up_address_long = i.pick_up_address_long, drop_address = i.drop_address, drop_address_lat = i.drop_address_lat, drop_address_long = i.drop_address_long, cost = i.cost, distance = i.distance, description = i.description, duration = i.duration, status = i.status, created_at = i.created_at, leave_date = i.leave_date, driver_license = i.driver_license, driver_license_img = i.driver_license_img, user_id = i.user_id, email = i.email, fullname = i.fullname, phone = i.phone, personalID = i.personalID, //convert base64 to image link_avatar = ImageConvert.ImageConvert.convertBase64ToImage(i.link_avatar), average_rating = i.average_rating }; if (i2.status == 4) { itinearyFinishedList.Add(i2); } else { //null } } //binding vao list longlistItinerariesFinished.ItemsSource = itinearyFinishedList; }
private void longlistItinerariesFinished_SelectionChanged(object sender, SelectionChangedEventArgs e) { Itinerary2 selectedItem = (Itinerary2)longlistItinerariesFinished.SelectedItem; MessageBox.Show("ss: " + selectedItem.itinerary_id); //luu tru tam thoi Global.GlobalData.selectedItinerary = selectedItem; //navigate sang details NavigationService.Navigate(new Uri("/Customer/ItineraryDetails.xaml", UriKind.RelativeOrAbsolute)); }
public static MapOverlay DrawItineraryMarker(GeoCoordinate point, Itinerary2 i) { //MapVieMode.Layers.Clear(); //MapLayer mapLayer = new MapLayer(); // Draw marker for current position // Draw markers for location(s) / destination(s) //DrawMapMarker(MyCoordinates[i], Colors.Red, mapLayer, parklist.parking_details[i].DestinationName); UCCustomPushPin _tooltip = new UCCustomPushPin(); _tooltip.Description = ""; _tooltip.DataContext = i; _tooltip.Menuitem.Click += Menuitem_Click; _tooltip.imgmarker.Tap += _tooltip_Tapimg; MapOverlay overlay = new MapOverlay(); overlay.Content = _tooltip; overlay.GeoCoordinate = point; overlay.PositionOrigin = new Point(0.0, 1.0); return overlay; }
public static MapOverlay DrawItineraryMarker(GeoCoordinate point, Itinerary2 i) { //MapVieMode.Layers.Clear(); //MapLayer mapLayer = new MapLayer(); // Draw marker for current position // Draw markers for location(s) / destination(s) //DrawMapMarker(MyCoordinates[i], Colors.Red, mapLayer, parklist.parking_details[i].DestinationName); UCCustomPushPin _tooltip = new UCCustomPushPin(); _tooltip.Description = ""; _tooltip.DataContext = i; _tooltip.Menuitem.Click += Menuitem_Click; _tooltip.imgmarker.Tap += _tooltip_Tapimg; MapOverlay overlay = new MapOverlay(); overlay.Content = _tooltip; overlay.GeoCoordinate = point; overlay.PositionOrigin = new Point(0.0, 1.0); return(overlay); }
public async void getFinishedItinerariesOfCustomer() { //reset Itinerary Global.GlobalData.itinearyList = new ItineraryList(); //send get request var result = await Request.RequestToServer.sendGetRequest("itineraries/driver/itinerary_status"); RootObject root = JsonConvert.DeserializeObject<RootObject>(result); //xu ly json foreach (Itinerary i in root.itineraries) { Itinerary2 i2 = new Itinerary2 { itinerary_id = i.itinerary_id, driver_id = i.driver_id, customer_id = Convert.ToInt32(i.customer_id), start_address = i.start_address, start_address_lat = i.start_address_lat, start_address_long = i.start_address_long, end_address = i.end_address, end_address_lat = i.end_address_lat, end_address_long = i.end_address_long, pick_up_address = i.pick_up_address, pick_up_address_lat = i.pick_up_address_lat, pick_up_address_long = i.pick_up_address_long, drop_address = i.drop_address, drop_address_lat = i.drop_address_lat, drop_address_long = i.drop_address_long, cost = i.cost, distance = i.distance, description = i.description, duration = i.duration, status = i.status, created_at = i.created_at, leave_date = i.leave_date, driver_license = i.driver_license, driver_license_img = i.driver_license_img, user_id = i.user_id, email = i.email, fullname = i.fullname, phone = i.phone, personalID = i.personalID, //convert base64 to image link_avatar = ImageConvert.ImageConvert.convertBase64ToImage(i.link_avatar), average_rating = i.average_rating }; if (i2.status == 4) { itinearyFinishedList.Add(i2); } else { //null } } //binding vao list longlistItinerariesFinished.ItemsSource = itinearyFinishedList; }