Exemple #1
0
        private async void ResumePreviousRoute(object sender, EventArgs e)
        {
            int curDay   = pickerDay.SelectedIndex;
            int curRoute = pickerRoute.SelectedIndex;

            // Set the day and route
            App.SetLastDay(curDay);
            App.SetLastRoute(curRoute);

            // Show the action sheet to see what type of route the user would like
            var action =
                await DisplayActionSheet("Route Options", "Cancel", null, "Start New Route", "Resume Previous Route");

            if (action == "Start New Route")
            {
                // One more time to make sure they want to do this
                bool answer =
                    await
                    DisplayAlert("Confirm",
                                 "Are you sure you would start a new route?  This will delete any previous route data.",
                                 "Yes", "No");

                if (answer == false)
                {
                    return;
                }

                // Show the page
                DisposalEntry entryForm = new DisposalEntry(DisposalEntry.RouteStatus.StartNew, curDay, curRoute);
                await Navigation.PushAsync(entryForm);
            }

            if (action == "Resume Previous Route")
            {
                // Show the page
                DisposalEntry entryForm = new DisposalEntry(DisposalEntry.RouteStatus.ResumePrevious, curDay, curRoute);
                await Navigation.PushAsync(entryForm);
            }
        }
Exemple #2
0
        /// <summary>
        /// Routine to clear out the route and start fresh
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void StartNewRoute(object sender, EventArgs e)
        {
            // Show a message to the user stating what is going on
            bool answer = await DisplayAlert("Confirm", "Are you sure you would like to start this route?  If there was any previous data on this route, that data will be erased", "Yes", "No");

            if (answer == false)
            {
                return;
            }

            // Get the day and route
            int curDay   = pickerDay.SelectedIndex;
            int curRoute = pickerRoute.SelectedIndex;

            // Set the day and route
            App.SetLastDay(curDay);
            App.SetLastRoute(curRoute);

            // Now move to the data entry form
            DisposalEntry entryForm = new DisposalEntry(DisposalEntry.RouteStatus.StartNew, curDay, curRoute);
            await Navigation.PushAsync(entryForm);
        }