public Editar(String idPokemon,Principal p) { this.SetDesktopLocation(p.DesktopLocation.X-298, p.DesktopLocation.Y); InitializeComponent(); padre = p; actuEditar(idPokemon); }
private void btnEntrar_Click(object sender, EventArgs e) { String sql = "select * from usuarios where nombreUsuario = '"+txtIDentrenador.Text+"' and pass = '******'"; try { db.consultaStr(sql, "usuarios"); if (db.consultaStr("SELECT tipo FROM usuarios WHERE nombreUsuario = '"+txtIDentrenador.Text+"'","usuarios") == "0") { Principal principal = new Principal(this); principal.Visible = true; this.Visible = false; if (registro!=null) { registro.Dispose(); } } else { PrincipalJugador principal = new PrincipalJugador(this, txtIDentrenador.Text); principal.Visible = true; this.Visible = false; if (registro != null) { registro.Dispose(); } } } catch (Exception a) { MessageBox.Show("Usuario o contraseña incorrecto."); } }
public Nuevo(String idPokemon, Principal p) { this.SetDesktopLocation(p.DesktopLocation.X + 334,p.DesktopLocation.Y); InitializeComponent(); padre = p; id = idPokemon; txtID.Text = idPokemon; db.IniciarConexion("pokedex.accdb"); sql = "SELECT max(id)+1 FROM pokedex"; ipd = db.consultaStr(sql, "pokedex"); txtID.Text = ipd; }