Beispiel #1
0
        private async void btnLogin_Clicked(object sender, EventArgs e)
        {
            indProgress.IsRunning = true;
            User usuario = new User()
            {
                Email = txtEmail.Text,
                Senha = txtPassword.Text
            };
            bool loginSuccessful = await UsuarioViewModel.Login(usuario);

            indProgress.IsRunning = false;

            if (!loginSuccessful)
            {
                await DisplayAlert("Login", "Email ou senha inválidos, favor tentar novamente.", "Ok");

                return;
            }


            ListagemNoteView rootView = ((App.Current.MainPage as MasterDetailPage).Detail as NavigationPage).RootPage as ListagemNoteView;

            rootView.RefreshListSource(); // Atualiza a lista de notas antes de exibir para o usuário

            await App.NavigateToRoot();
        }
Beispiel #2
0
 private void btConfirmar_Click(object sender, RoutedEventArgs e)
 {
     if (ViewModelUsuario.Login(textBoxLogin.Text, textBoxSenha.Password))
     {
         Logado = true;
         SISMenu.JanelaLogin.Close();
     }
     else
     {
         MessageBox.Show("Login e/ou Senha Incorretos", "Erro no Login", MessageBoxButton.OK, MessageBoxImage.Error);
         textBoxLogin.Focus();
     }
 }