Esempio n. 1
0
        private async void OnActivate(object sender, EventArgs e)
        {
            var reservations = new Reservation
            {
                Id_Route = route.Id
            };

            IsBusy = true;
            await reservationsManager.DeleteReservationsAsync(reservations);

            usersLabel.Text          = "";
            activateButton.IsVisible = false;
            IsBusy = false;


            if (DateTime.Today.Add(TimeSpan.Parse(route.Depart_Time)).CompareTo(DateTime.Now) <= 0)
            {
                route.Depart_Date = DateTime.Today.Add(TimeSpan.Parse(route.Depart_Time)).AddDays(1);
            }
            else
            {
                route.Depart_Date = DateTime.Today.Add(TimeSpan.Parse(route.Depart_Time));
            }

            await routeManager.SaveRouteAsync(route);

            await DisplayAlert("Success", "Route activated", "Accept");

            LoadData();
        }