Пример #1
0
 protected bool doFocus()
 {
     if (_cepEntry.IsEnabled && string.IsNullOrEmpty(_cepEntry.TextOnlyNumber))
     {
         return(_cepEntry.Focus());
     }
     else if (_logradouroEntry.IsEnabled && string.IsNullOrEmpty(_logradouroEntry.Text))
     {
         return(_logradouroEntry.Focus());
     }
     else if (_complementoEntry.IsEnabled && string.IsNullOrEmpty(_complementoEntry.Text))
     {
         return(_complementoEntry.Focus());
     }
     else if (_numeroEntry.IsEnabled && string.IsNullOrEmpty(_numeroEntry.Text))
     {
         return(_numeroEntry.Focus());
     }
     else if (_bairroEntry.IsEnabled && string.IsNullOrEmpty(_bairroEntry.Text))
     {
         return(_bairroEntry.Focus());
     }
     else if (_cidadeEntry.IsEnabled && string.IsNullOrEmpty(_cidadeEntry.Text))
     {
         return(_cidadeEntry.Focus());
     }
     else if (_ufEntry.IsEnabled && string.IsNullOrEmpty(_ufEntry.Text))
     {
         return(_ufEntry.Focus());
     }
     return(false);
 }
Пример #2
0
        protected virtual bool validar()
        {
            var usuario = this.Usuario;

            if (string.IsNullOrEmpty(_NomeEntry.Text))
            {
                DisplayAlert("Aviso", "Preencha o seu nome.", "Fechar");
                _NomeEntry.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(_EmailEntry.Text))
            {
                DisplayAlert("Aviso", "Preencha o seu email.", "Fechar");
                _EmailEntry.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(_TelefoneEntry.Text))
            {
                DisplayAlert("Aviso", "Preencha o seu celular.", "Fechar");
                _TelefoneEntry.Focus();
                return(false);
            }
            if (!(usuario != null && usuario.Id > 0))
            {
                if (string.IsNullOrEmpty(_SenhaEntry.Text))
                {
                    DisplayAlert("Aviso", "Preencha a senha.", "Fechar");
                    _SenhaEntry.Focus();
                    return(false);
                }
                if (string.IsNullOrEmpty(_ConfirmaEntry.Text))
                {
                    DisplayAlert("Aviso", "Preencha a confirmação de senha.", "Fechar");
                    _ConfirmaEntry.Focus();
                    return(false);
                }
                if (string.Compare(_SenhaEntry.Text, _ConfirmaEntry.Text) != 0)
                {
                    DisplayAlert("Aviso", "A senha não está batendo com a confirmação.", "Fechar");
                    _SenhaEntry.Focus();
                    return(false);
                }
            }
            return(true);
        }