private void _ingresar() { if (!_validar()) { return; } if (Usuario.Ingresar(ref _modelo)) { ModuloGeneral.UsuarioActivo = _modelo; ModuloGeneral.FrmLogin = this; TxtNombreUsuario.Focus(); TxtNombreUsuario.Clear(); TxtPassword.Clear(); FrmMDI frmMDI = new FrmMDI(); ModuloGeneral.FrmMDI = frmMDI; frmMDI.Show(); Visible = false; } else { MessageBox.Show(BaseDeDatos.Core.ConexionBaseDeDatos.Error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public bool ValidarObjetos() { try { bool Bsi_datosNull = false; if (txtidCuenta.Text == "") { ErrProvider.SetError(txtidCuenta, "Falta Cuenta"); txtidCuenta.Focus(); Bsi_datosNull = true; } if (txtdirecioncorreoElectronico.Text == "") { ErrProvider.SetError(txtdirecioncorreoElectronico, "Ingrese Correo"); txtdirecioncorreoElectronico.Focus(); Bsi_datosNull = true; } if (TxtNombreUsuario.Text == "") { ErrProvider.SetError(TxtNombreUsuario, "Ingrese Su Usuario"); TxtNombreUsuario.Focus(); Bsi_datosNull = true; } if (TxtContraseña.Text == "") { ErrProvider.SetError(TxtContraseña, "Ingrese Pasword"); TxtContraseña.Focus(); Bsi_datosNull = true; } if (txtSuNombre.Text == "") { ErrProvider.SetError(txtSuNombre, "Ingrese Su Nombre"); txtSuNombre.Focus(); Bsi_datosNull = true; } if (TxtServidorEntrante.Text == "") { ErrProvider.SetError(TxtServidorEntrante, "Ingrese nombre Servidor Correo"); TxtServidorEntrante.Focus(); Bsi_datosNull = true; } if (TxtServidorSaliente.Text == "") { ErrProvider.SetError(TxtServidorSaliente, "Ingrese nombre Servidor de Correo");//cmbtipoCuenta TxtServidorSaliente.Focus(); Bsi_datosNull = true; } if (cmbtipoCuenta.Text == "") { ErrProvider.SetError(cmbtipoCuenta, "Escoga un tipo de Cuenta");// cmbtipoCuenta.Focus(); Bsi_datosNull = true; } if (cmbtiposeguridad.Text == "") { ErrProvider.SetError(cmbtiposeguridad, "Escoga un tipo del Servidor");// cmbtiposeguridad.Focus(); Bsi_datosNull = true; } return Bsi_datosNull; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); BusSisLog.Log_Error(ex.Message.ToString(), eTipoError.ERROR, this.ToString()); return false; } }