Exemple #1
0
 private void TxtPrApellido_Validating(object sender, CancelEventArgs e)
 {
     if (string.IsNullOrEmpty((TxtPrApellido.Text)))
     {
         errorP1.SetError(TxtPrApellido, "Debe ingresar el primer apellido.");
         TxtPrApellido.Focus();
     }
     else
     {
         errorP1.SetError(TxtPrApellido, "");
     }
 }
        public bool ValidarPersona()
        {
            bool retorno = true;

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

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

            if (string.IsNullOrEmpty((TxtIdentificacion.Text)))
            {
                errorP1.SetError(TxtIdentificacion, "Debe ingresar la identificación.");
                TxtIdentificacion.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtIdentificacion, "");
            }


            return(retorno);
        }