Ejemplo n.º 1
0
 private bool ValidarDatos()
 {
     if (txtCorreo.Text.Trim() == "")
     {
         MessageBox.Show("El campo correo no debe ir vacío. Este dato se tomará para enviar el correo.", "GymCSY", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(false);
     }
     else
     {
         if (!CFuncionesGenerales.EsCorreoValido(txtCorreo.Text))
         {
             MessageBox.Show("El correo ingresado no es válido.", "GymCSY", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return(false);
         }
     }
     if (txtPass.Text.Trim() == "")
     {
         MessageBox.Show("El campo contraseña no debe ir vacío. Este dato se tomará para enviar el correo.", "GymCSY", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(false);
     }
     if (txtPuerto.Text.Trim() == "")
     {
         MessageBox.Show("El campo puerto no debe ir vacío. Este dato servirá para conectar con el servidor de correos.", "GymCSY", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(false);
     }
     if (txtHost.Text.Trim() == "")
     {
         MessageBox.Show("El campo host no puede ir vacío. Este dato servirá para conectar con el servidor de correos.", "GymCSY", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(false);
     }
     return(true);
 }