Ejemplo n.º 1
0
 private void TxtNumero_Validating(object sender, CancelEventArgs e)
 {
     if (string.IsNullOrEmpty((TxtNotaMin.Text)))
     {
         errorP1.SetError(TxtNotaMin, "Debe ingresar la nota minima.");
         TxtNotaMin.Focus();
     }
     else
     {
         errorP1.SetError(TxtNotaMin, "");
     }
 }
Ejemplo n.º 2
0
        public bool Validar()
        {
            bool retorno = true;

            if (string.IsNullOrEmpty((TxtNombre.Text)))
            {
                errorP1.SetError(TxtNombre, "Debe ingresar el nombre.");
                TxtNombre.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtNombre, "");
            }

            if (string.IsNullOrEmpty((TxtNotaMin.Text)))
            {
                errorP1.SetError(TxtNotaMin, "Debe ingresar la nota minima.");
                TxtNotaMin.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtNotaMin, "");
            }

            if (string.IsNullOrEmpty((TxtNotaMax.Text)))
            {
                errorP1.SetError(TxtNotaMax, "Debe ingresar la nota maxima.");
                TxtNotaMax.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtNotaMax, "");
            }

            return(retorno);
        }