//Zorgen dat het user ID gebruikt wordt voor het ophalen van de orders private async void GetOrderOnDateAsync(string Date) { orderslist.Clear(); //User ID aanpassen Orders = await UrlCalls.GetOrders("4", Date); if (Orders.Count > 0) { orderslist.Clear(); foreach (var Order in Orders) { orderslist.Add(new Order { id = (string)Order.id, order = (string)Order.order, chauffeur = (string)Order.chauffeur, date = (string)Order.date }); } lvOrders.ItemsSource = orderslist; } else { orderslist.Clear(); MessageBox("Er zijn geen orders op de geselecteerde dag"); } }
private async void GetOrderAsync() { rootObject = await UrlCalls.GetOrder(sOrder); OphaalAdress = new Ophaaladres() { id = rootObject.order.addresses.ophaaladres[0].id, plaats = rootObject.order.addresses.ophaaladres[0].plaats, straat = rootObject.order.addresses.ophaaladres[0].straat, huisnr = rootObject.order.addresses.ophaaladres[0].huisnr, postcode = rootObject.order.addresses.ophaaladres[0].postcode, telefoonnr = rootObject.order.addresses.ophaaladres[0].telefoonnr }; AfhaalAdress = new Afleveradres() { id = rootObject.order.addresses.afleveradres[0].id, plaats = rootObject.order.addresses.afleveradres[0].plaats, straat = rootObject.order.addresses.afleveradres[0].straat, huisnr = rootObject.order.addresses.afleveradres[0].huisnr, postcode = rootObject.order.addresses.ophaaladres[0].postcode, telefoonnr = rootObject.order.addresses.afleveradres[0].telefoonnr }; await PlaceOrderMarkersAsync(); }
private async void BtInloggen_ClickAsync(object sender, RoutedEventArgs e) { var test = await UrlCalls.GetUser(tbUser.Text, pbPass.Password); if (test.success == true) { this.Frame.Navigate(typeof(Pages.OptionPage)); } else { tbUser.Text = ""; pbPass.Password = ""; MessageBox("De inloggegevens zijn incorrect"); } }
private async System.Threading.Tasks.Task PlaceOrderMarkersAsync() { dynamic test = await UrlCalls.GetLangLong( rootObject.order.addresses.afleveradres[0].straat, rootObject.order.addresses.afleveradres[0].huisnr, rootObject.order.addresses.afleveradres[0].plaats, rootObject.order.addresses.afleveradres[0].postcode ); dynamic tester = test.results[0].geometry.location; location.lat = tester.lat; location.lng = tester.lng; MapIcon mapIconAflever = new MapIcon(); // Locate your MapIcon mapIconAflever.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/my-position.png")); // Show above the MapIcon mapIconAflever.Title = "Afhaal Adres"; // Setting up MapIcon location mapIconAflever.Location = new Geopoint(new BasicGeoposition() { //Latitude = geoposition.Coordinate.Latitude, [Don't use] //Longitude = geoposition.Coordinate.Longitude [Don't use] Latitude = location.lat, Longitude = location.lng }); // Positon of the MapIcon mapIconAflever.NormalizedAnchorPoint = new Point(0.5, 0.5); MapControl1.MapElements.Add(mapIconAflever); //rootObject = await UrlCalls.GetOrder(sOrder); dynamic test2 = await UrlCalls.GetLangLong( rootObject.order.addresses.ophaaladres[0].straat, rootObject.order.addresses.ophaaladres[0].huisnr, rootObject.order.addresses.ophaaladres[0].plaats, rootObject.order.addresses.ophaaladres[0].postcode); dynamic tester2 = test.results[0].geometry.location; location.lat = tester2.lat; location.lng = tester2.lng; MapIcon mapIconOphaal = new MapIcon(); // Locate your MapIcon mapIconOphaal.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/my-position.png")); // Show above the MapIcon mapIconOphaal.Title = "Ophaal Adres"; // Setting up MapIcon location mapIconOphaal.Location = new Geopoint(new BasicGeoposition() { //Latitude = geoposition.Coordinate.Latitude, [Don't use] //Longitude = geoposition.Coordinate.Longitude [Don't use] Latitude = location.lat, Longitude = location.lng }); // Positon of the MapIcon mapIconOphaal.NormalizedAnchorPoint = new Point(0.5, 0.5); MapControl1.MapElements.Add(mapIconOphaal); geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 50; try { Geoposition geoposition = await geolocator.GetGeopositionAsync( maximumAge : TimeSpan.FromMinutes(5), timeout : TimeSpan.FromSeconds(10)); Geopoint geopoint = new Geopoint(new BasicGeoposition() { //Latitude = geoposition.Coordinate.Latitude, [Don't use] //Longitude = geoposition.Coordinate.Longitude [Don't use] Latitude = geoposition.Coordinate.Point.Position.Latitude, Longitude = geoposition.Coordinate.Point.Position.Longitude }); DrawRoute(geopoint, mapIconOphaal.Location); } catch { } }