Exemplo n.º 1
0
        private async Task <bool> ValidarControles()
        {
            bool   b_error = false;
            string s_msg   = "";

            if (string.IsNullOrEmpty(EmailEntry.Text))
            {
                s_msg   = "Debe Ingresar un usuario";
                b_error = true;
                EmailEntry.Focus();
            }

            if (string.IsNullOrEmpty(PasswordEntry.Text) && !b_error)
            {
                s_msg   = "Debe Ingresar una clave";
                b_error = true;
                PasswordEntry.Focus();
            }

            if (b_error)
            {
                await DisplayAlert("Error", s_msg, "Aceptar");
            }
            return(b_error);
        }
Exemplo n.º 2
0
 private void EmailEdit_Click(object sender, EventArgs e)
 {
     EmailEntry.Enabled = true;
     EmailEntry.Focus();
     button2.Visible   = true;
     EmailEdit.Visible = false;
 }
Exemplo n.º 3
0
        void Handle_Tapped(object sender, EventArgs e)
        {
            var name = ((Image)sender).ClassId;

            switch (name)
            {
            case "UserName":
                if (!UserNameEntry.IsFocused)
                {
                    UserNameEntry.Focus();
                }
                break;

            case "Email":
                if (!EmailEntry.IsFocused)
                {
                    EmailEntry.Focus();
                }
                break;

            case "DisplayName":
                //  if (!DisplayNameEntry.IsFocused)
                // DisplayNameEntry.Focus();
                break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
        public BookingCustomerPage()
        {
            InitializeComponent();

            NameEntry.Completed  += (s, e) => EmailEntry.Focus();
            EmailEntry.Completed += (s, e) => MobileEntry.Focus();
        }
Exemplo n.º 5
0
        public RegisterPage()
        {
            InitializeComponent();
            BindingContext = new RegisterViewModel(Navigation, Alert);

            DisplayNameEntry.ReturnCommand = new Command(() => EmailEntry.Focus());
            EmailEntry.ReturnCommand       = new Command(() => PasswordEntry.Focus());

            PasswordEntry.ReturnCommand        = new Command(() => ConfirmpasswordEntry.Focus());
            ConfirmpasswordEntry.ReturnCommand = new Command(() => Register.Focus());
        }
Exemplo n.º 6
0
        private async void Button_Login(object sender, EventArgs e)
        {
            // Verifica os campos
            if (VerificaCamposLogin())
            {
                // Verifica a conexão com a internet
                if (!CrossConnectivity.Current.IsConnected)
                {
                    bool answer = await DisplayAlert("Atenção",
                                                     "Não foi possivel conectar-se com a internet, verifique sua conexão e tente novamente!",
                                                     "Cancelar", "Tentar Novamente");

                    return;
                }
                // Chama o Popup de Loading
                await PopupNavigation.Instance.PushAsync(new LoadingPopUpView());

                // Chama a requisição
                var cliente = clienteService.RealizaLogin(EmailEntry.Text, SenhaEntry.Text);

                // Verifica a resposta
                if (cliente.Result == "ok")
                {
                    // Verifica definição de login automático
                    if (manterConectado.IsChecked)
                    {
                        // Salva definição
                        Preferences.Set("manterConectado", true);
                        Preferences.Set("email", EmailEntry.Text);
                        Preferences.Set("senha", SenhaEntry.Text);
                    }
                    //Chama a página Home
                    await Navigation.PushAsync(new Home());

                    // Fecha o Popup de Loading
                    await PopupNavigation.Instance.PopAsync();
                }
                else
                {
                    // Fecha o Popup de Loading
                    await PopupNavigation.Instance.PopAsync();

                    // Exibe o alerta
                    await DisplayAlert("Ops...", "Usúario ou Senha incorreto!", "Aceitar");

                    // Manda o foco para o campo de e-mail
                    EmailEntry.Focus();
                    // Quebra a função
                    return;
                }
            }
        }
Exemplo n.º 7
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (string.IsNullOrEmpty(EmailEntry.Text))
            {
                EmailEntry.Focus();
            }
            else if (string.IsNullOrEmpty(PasswordEntry.Text))
            {
                PasswordEntry.Focus();
            }
            else
            {
                LoginButton.Focus();
            }

            ViewModel.MessageLabel       = string.Empty;
            ViewModel.CanExecuteCommands = true;
        }
Exemplo n.º 8
0
        // Função responsável por válidar os campos de login
        private bool  VerificaCamposLogin()
        {
            if (string.IsNullOrEmpty(EmailEntry.Text) && string.IsNullOrEmpty(SenhaEntry.Text))
            {
                // Exibe o alerta
                DisplayAlert("Ops...", "Preencha os campos para realizar o Login", "Aceitar");
                // Manda o foco para o campo de e-mail
                EmailEntry.Focus();
                // Sai da função
                return(false);
            }

            // Verifica se o campo email foi preenchido
            if (string.IsNullOrEmpty(EmailEntry.Text))
            {
                // Exibe o alerta
                DisplayAlert("Ops...", "Preencha o campo de E-mail", "Aceitar");
                // Manda o foco para o campo de e-mail
                EmailEntry.Focus();
                // Sai da função
                return(false);
            }

            // Verifica se o campo de senha foi preenchido
            if (string.IsNullOrEmpty(SenhaEntry.Text))
            {
                // Exibe o alerta
                DisplayAlert("Ops...", "Preencha o campo de Senha", "Aceitar");
                // Manda o foco para o campo de e-mail
                SenhaEntry.Focus();
                // Sai da função
                return(false);
            }

            // Caso os campos estiverem corretos
            return(true);
        }
Exemplo n.º 9
0
 private void EmailFocus(Object sender, EventArgs args)
 {
     EmailEntry.Focus();
 }
Exemplo n.º 10
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     EmailEntry.Focus();
 }