protected async override void OnAppearing() { base.OnAppearing(); if (!appeared) { try { Subjects = await FirebaseHelper.GetSubjectsById(LoginPage.LoggedUser.SubjectsKeys); listviewSubjects.ItemsSource = Subjects; } catch (Exception ex) { await DisplayAlert("Error", "Problema al traer las asignaturas de firebase: " + ex, "OK"); //throw; } appeared = true; IsRefreshing = false; } }
/// <summary> /// Evento del click del boton LogIn /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public async void LogIn(object sender, EventArgs e) { StartLoadingIndicator(); if (String.IsNullOrEmpty(entryEmail.Text) && String.IsNullOrEmpty(entryPassword.Text)) { entryEmail.Text = "*****@*****.**"; entryPassword.Text = "estudiante"; } if (!String.IsNullOrEmpty(entryEmail.Text) && !String.IsNullOrEmpty(entryPassword.Text)) { try { Auth = await FirebaseHelper.AuthProvider.SignInWithEmailAndPasswordAsync(entryEmail.Text, entryPassword.Text); LoggedUser = await FirebaseHelper.GetStudentById(Auth.User.LocalId); if (LoggedUser == null) { throw new Exception(); } else { ShowHomePage(); } } catch (Exception ex) { StopLoadingIndicator(); await DisplayAlert("Error", "No es posible iniciar sesión :" + ex, "OK"); //throw ex; } } else { StopLoadingIndicator(); await DisplayAlert("Error", "Uno o mas campos vacios", "OK"); } }
protected async override void OnAppearing() { base.OnAppearing(); if (!appeared) { try { Partners = await FirebaseHelper.GetStudentsByIds(TheSubject.StudentsKeys); listviewPartners.ItemsSource = Partners; Evaluations = await FirebaseHelper.GetEvaluations(TheSubject.EvaluationsKeys); SetUpMyCalifications(); } catch (Exception ex) { await DisplayAlert("Error", "Problema al traer a los estudiantes de firebase, : " + ex, "OK"); //throw; } appeared = true; } }