Exemplo n.º 1
0
        private async void Button_OnClicked(object sender, EventArgs e)
        {
            try
            {
                App.CurrentUser = null;
                if (string.IsNullOrWhiteSpace(LoginEntry.Text))
                {
                    await DisplayAlert("Error", "Preencha o login", "OK");

                    LoginEntry.Focus();
                    return;
                }

                if (string.IsNullOrWhiteSpace(PwdEntry.Text))
                {
                    await DisplayAlert("Error", "Preencha a senha", "OK");

                    PwdEntry.Focus();
                    return;
                }

                var isLogged = await CheckLogin(LoginEntry.Text, PwdEntry.Text);

                if (!isLogged)
                {
                    return;
                }

                await Navigation.PushAsync(new PurchaseOrderListPage());
            }
            catch (Exception ex)
            {
                await DisplayAlert("Error", ex.Message, "OK");
            }
        }
Exemplo n.º 2
0
        private void Entry_Completed(object sender, EventArgs e)
        {
            var entry = sender as LoginEntry;

            if (entry.Text == usernameEntry.Text)
            {
                passwordEntry.Focus();
            }
            else
            {
                entry.Unfocus();
            }
        }