Exemplo n.º 1
0
 private void DtpFechaFacimiento_Leave(object sender, EventArgs e)
 {
     if (DtpFechaFacimiento.Value > DateTime.Now)
     {
         ErpMensaje.SetError(DtpFechaFacimiento,
                             "La fecha de nacimiento debe ser menor a la fecha del sistema");
     }
     else
     {
         ErpMensaje.SetError(DtpFechaFacimiento, null);
     }
 }
Exemplo n.º 2
0
 private void TxtNumeroDocumento_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (TxtNumeroDocumento.Text.Length <= 6)
     {
         ErpMensaje.SetError(TxtNumeroDocumento,
                             "El número de documento debe tener mas de 6 dígitos");
         e.Cancel = true;
     }
     else
     {
         ErpMensaje.SetError(TxtNumeroDocumento, null);
     }
 }
Exemplo n.º 3
0
 private void BtnEdad_Click(object sender, EventArgs e)
 {
     if (DtpFechaFacimiento.Value > DateTime.Now)
     {
         ErpMensaje.SetError(DtpFechaFacimiento,
                             "La fecha de nacimiento debe ser menor a la fecha del sistema");
         return;
     }
     else
     {
         ErpMensaje.SetError(DtpFechaFacimiento, null);
     }
     MessageBox.Show("La edad es: " +
                     Utilidad.ObtenerEdad(DtpFechaFacimiento.Value));
 }