Esempio n. 1
0
        public bool ValidarTextbox()
        {
            if (string.IsNullOrEmpty(UserNametextBox.Text) && string.IsNullOrEmpty(PasstextBox.Text))
            {
                UsererrorProvider.SetError(UserNametextBox, "Favor ingresar el nombre de Usuario");
                PasserrorProvider.SetError(PasstextBox, "Favor ingresar la contraseña del usuario");
                MessageBox.Show("Favor llenar todos los campos obligatorios");
            }
            if (string.IsNullOrEmpty(UserNametextBox.Text))
            {
                UsererrorProvider.SetError(UserNametextBox, "Favor ingresar el nombre de Usuario");
                return(false);
            }

            if (string.IsNullOrEmpty(PasstextBox.Text))
            {
                UsererrorProvider.Clear();
                PasserrorProvider.SetError(PasstextBox, "Favor ingresar la contraseña del usuario");
                return(false);
            }



            return(true);
        }
 private void limpiarErrores()
 {
     NombreUsuarioerrorProvider.Clear();
     PasserrorProvider.Clear();
     ConfPassTextBox.Clear();
     BuscarerrorProvider.Clear();
 }
Esempio n. 3
0
 private void txtPass_Validated(object sender, EventArgs e)
 {
     if (!VisaTask.IsValidPassword(txtPass.Text))
     {
         PasserrorProvider.SetError(txtPass, "Пароль должен содержать не менее 8 символов");
     }
     else
     {
         PasserrorProvider.SetError(txtPass, string.Empty);
     }
 }
        private bool ValidarTextbox()
        {
            if (string.IsNullOrEmpty(UserNameTextBox.Text) && string.IsNullOrEmpty(PassTextBox.Text) && string.IsNullOrEmpty(ConfPassTextBox.Text))
            {
                NombreUsuarioerrorProvider.SetError(UserNameTextBox, "Favor ingresar el nombre de Usuario");
                PasserrorProvider.SetError(PassTextBox, "Favor ingresar la contraseña del usuario");
                ConfPasserrorProvider.SetError(ConfPassTextBox, "Favor confirmar comtraseña");
                MessageBox.Show("Favor llenar todos los campos obligatorios");
            }
            if (string.IsNullOrEmpty(UserNameTextBox.Text))
            {
                NombreUsuarioerrorProvider.SetError(UserNameTextBox, "Favor ingresar el nombre de Usuario");
                return(false);
            }

            if (string.IsNullOrEmpty(PassTextBox.Text))
            {
                NombreUsuarioerrorProvider.Clear();
                PasserrorProvider.SetError(PassTextBox, "Favor ingresar la contraseña del usuario");
                return(false);
            }

            if (string.IsNullOrEmpty(ConfPassTextBox.Text))
            {
                NombreUsuarioerrorProvider.Clear();
                PasserrorProvider.Clear();
                ConfPasserrorProvider.SetError(ConfPassTextBox, "Favor confirmar comtraseña");
                return(false);
            }

            if (ConfPassTextBox.Text != PassTextBox.Text)
            {
                NombreUsuarioerrorProvider.Clear();
                PasserrorProvider.Clear();
                ConfPassTextBox.Clear();
                ConfPasserrorProvider.SetError(ConfPassTextBox, "La contraseña no coincide");
                return(false);
            }



            return(true);
        }