Exemplo 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);
        }
Exemplo n.º 2
0
 private bool validarId()
 {
     if (string.IsNullOrEmpty(userIdTextBox.Text))
     {
         UsererrorProvider.SetError(userIdTextBox, "Ingresar el ID");
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 3
0
 public void Error(int N)
 {
     if (N == 0)
     {
         userIdTextBox.Enabled = true;
         MessageBox.Show("Este Id no contiene un usuario", "<- Busqueda Fallida ->", MessageBoxButtons.OK, MessageBoxIcon.Error);
         UsererrorProvider.Clear();
     }
     else
     if (N == 1)
     {
         userIdTextBox.Enabled = true;
         MessageBox.Show("Este Id esta desabilitado", "<- Busqueda Fallida ->", MessageBoxButtons.OK, MessageBoxIcon.Error);
         UsererrorProvider.Clear();
         Newbutton.PerformClick();
     }
 }
Exemplo n.º 4
0
 private bool ValidarTextbox()
 {
     if (string.IsNullOrEmpty(usuarioTextBox.Text))
     {
         UsererrorProvider.SetError(usuarioTextBox, "Username");
         return(false);
     }
     if (string.IsNullOrEmpty(passwordTextBox.Text))
     {
         UsererrorProvider.SetError(passwordTextBox, "Password");
         return(false);
     }
     if (string.IsNullOrEmpty(nameTextBox.Text))
     {
         UsererrorProvider.SetError(nameTextBox, "Name");
         return(false);
     }
     if (string.IsNullOrEmpty(apellidoTextBox.Text))
     {
         UsererrorProvider.SetError(apellidoTextBox, "LastName");
         return(false);
     }
     return(true);
 }