/// <summary> /// Invoked when the Sign Up button is clicked. /// </summary> /// <param name="obj">The Object</param> private async void SignUpClicked(object obj) { databaseConnector.Response response = App.backend.LogIn("Bob", password); if (response.status == databaseConnector.statuscode.OK) { await Shell.Current.GoToAsync("//login"); } }
/// <summary> /// Invoked when the Submit button is clicked. /// </summary> /// <param name="obj">The Object</param> private async void SubmitClicked(object obj) { // Do something databaseConnector.Response response = await App.backend.ChangePassword(newPassword, confirmPassword); if (response.status == databaseConnector.statuscode.OK) { //navigate or display to the user in some way, that the password has been changed. } else { //check the response.stats or response.message for details on the issue. } }
/// <summary> /// Invoked when the Submit button is clicked. /// </summary> /// <param name="obj">The Object</param> private async void OnSubmitTapped(object obj) { // Do something databaseConnector.Response response = await App.backend.AddEvent(new databaseConnector.Event()); // add the varibles from the page to the event object like Event(name, shared, start, end, day, location, [notes]) if (response.status == databaseConnector.statuscode.OK) { //navigate to whereever when sucess. } else { //find further info in response.stats, and response.message, then do things as appropriate. } }
/// <summary> /// Invoked when the Log In button is clicked. /// </summary> /// <param name="obj">The Object</param> private async void LoginClicked(object obj) { databaseConnector.Response response = await App.backend.LogIn(name, password); if (response.status == databaseConnector.statuscode.OK) { Preferences.Set("Saved_Login", ""); Preferences.Set("Saved_User", name); Preferences.Set("Saved_Pass", password); await Shell.Current.GoToAsync("//timetable"); } else if (response.status == databaseConnector.statuscode.ERROR) { //the login failed, change text / color this.Name = ""; this.Password = ""; this.Subcolor = "#FFD62F2F"; this.InvalidMessage = response.message; } }