Пример #1
0
 private void ButtonClicked(object sender, EventArgs e)
 {
     //decide which button was pressed
     if ((sender as Button) == bDelete)
     {
         //double check to make sure the user wants to delete
         Popup.Double("WARNING", "Are you SURE you want to delete the ENTIRE database (all events, matches, files, etc?", "Yes", "CANCEL", this, yes1);
         void yes1()
         {
             Popup.Double("WARNING", "Are you ABSOLUTELY sure?", "Yes, I'm sure", "CANCEL", this, yes2);
             void yes2()
             {
                 //delete database and go back to the main page
                 DeleteDatabase(SQLite_android.getDatabasePath());
                 StartActivity(typeof(MainActivity));
                 Finish();
             }
         }
     }
     //go to editevents page
     else if ((sender as Button) == bEditEvent)
     {
         StartActivity(typeof(EditEvents));
     }
 }
Пример #2
0
 private void ButtonClicked(object sender, EventArgs e)
 {
     //decide which button was clicked
     if ((sender as Button) == bDeleteData)
     {
         Popup.Double("Alert", "Are you sure you want to delete the compiled data for '" + currentCompiled.officialName + "'", "Yes", "CANCEL", this, ifYes);
         void ifYes()
         {
             eData.DeleteCompiledEventData(currentCompiled.cID);
             Finish();
             StartActivity(typeof(SelectEventCompiled));
         }
     }
 }
Пример #3
0
 private void ButtonClicked(object sender, EventArgs e)
 {
     //decide which button was pressed
     if ((sender as Button) == bDeleteMatch)
     {
         Popup.Double("Alert", "Are you sure you want to delete match " + currentMatch.matchNumber + "?", "Yes", "CANCEL", this, Delete);
         void Delete()
         {
             eData.DeleteMatchData(currentMatch.ID);
             StartActivity(typeof(ScoutLandingPage));
             Finish();
         }
     }
     else if ((sender as Button) == bEditMatch)
     {
         StartActivity(typeof(ScoutFormEdit));
     }
 }
Пример #4
0
 private void ButtonClicked(object sender, EventArgs e)
 {
     try
     {
         //decide which button was pressed
         if ((sender as Button) == bDeleteEvent)
         {
             Popup.Double("Alert", "Are you sure you want to delete the event '" +
                          selectedEvent.eventName + "' AND all associated matches?", "Yes", "CANCEL", this, Delete);
             //if user presses delete
             void Delete()
             {
                 eData.DeleteEvent(selectedEvent.eventID);
                 eData.DeleteMatchDataForEvent(selectedEvent.eventID);
                 Popup.Single("Alert", "Event Deleted", "OK", this);
             }
         }
         else if ((sender as Button) == bEditID)
         {
             //set current event so it can be accessed by the next activity
             eData.SetCurrentEvent(selectedEvent.eventID);
             Finish();
             StartActivity(typeof(EventID));
         }
         else if ((sender as Button) == bRefresh)
         {
             //refresh
             Recreate();
         }
     }
     //if no event is selected, selected event will be null and throw an exception
     catch
     {
         Popup.Single("Alert", "Please select an event to edit", "OK", this);
     }
 }