private void button3_Click_1(object sender, EventArgs e) { this.Hide(); Administrador v = new Administrador(); v.Show(); }
public void ValidarUsuarioAdmin() { if (txtu.Text.Length == 0 || txtc.Text.Length == 0) { MessageBox.Show("Debe de llenar todos los datos."); } else { String contraseñaEn = Contraseña.EncriptarContraseña(txtc.Text); Conexion(); conexion.Open(); NpgsqlCommand cmd = new NpgsqlCommand("SELECT cedula,nombre,contraseña,tipo FROM usuario WHERE nombre = '" + txtu.Text + "'and contraseña='" + contraseñaEn + "'and tipo='" + Admin + "'", conexion); NpgsqlDataReader entra = cmd.ExecuteReader(); if (entra.Read()) { this.Hide(); Administrador a = new Administrador(); a.Show(); } else { MessageBox.Show("Los datos ingresados no coinsiden\n Intentelo nuevamente"); txtu.Clear(); txtc.Clear(); } } }