Ejemplo n.º 1
0
 private bool Validar()
 {
     if (string.IsNullOrWhiteSpace(nombresTextBox.Text))
     {
         NombresErrorProvider.SetError(nombresTextBox, "Por favor digite los nombres");
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
        private bool Validar()
        {
            bool retorno = true;

            if (string.IsNullOrWhiteSpace(nombresTextBox.Text))
            {
                NombresErrorProvider.SetError(nombresTextBox, "Por favor digite los nombres");
                retorno = false;
            }
            if (string.IsNullOrWhiteSpace(sueldoTextBox.Text))
            {
                NombresErrorProvider.SetError(sueldoTextBox, "Por favor digite el sueldo");
                retorno = false;
            }
            return(retorno);
        }