Exemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     Conexion bd = new Conexion();
     bd.consulta("DELETE FROM libros where id_libro = '" + idLibroAEliminar + "';");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 2
0
 private void modificar_Click(object sender, EventArgs e)
 {
     Conexion bd = new Conexion();
     bd.consulta("UPDATE  autores SET nombre='" + textBox1.Text + "', apellido='" + textBox2.Text + "' where id_autores = '" + idElegido + "';");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 3
0
 private void button3_Click(object sender, EventArgs e)
 {
     Conexion bd = new Conexion();
     bd.consulta("DELETE FROM usuario WHERE email = '" + email + "';");
     MessageBox.Show("Usuario eliminado correctamente.","Eliminar Usuario");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 4
0
 private void button2_Click(object sender, EventArgs e)
 {
     Conexion bd = new Conexion();
     bd.consulta("UPDATE  usuario SET nomYape='" + textBox2.Text + "', pass='******', direccion='" + textBox4.Text + "', fechaNac='" + textBox5.Text + "', telefono='" + textBox6.Text + "' where email = '" + elegido.getEmail() + "';");
     MessageBox.Show("Usuario modificado correctamente.","Modificacion Usuario");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     Conexion bd = new Conexion();
     bd.consulta("INSERT INTO usuario VALUES('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + 0 + "');");
     bd.cerrarConexion();
     MessageBox.Show("Usuario Creado Correctamente.","Creacion Usuario");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 6
0
        private void aceptar_Click(object sender, EventArgs e)
        {
            Conexion BD = new Conexion();
            string nom=nombre.Text;
            string apell = apellido.Text;

            BD.consulta("INSERT INTO autores VALUES (null,'"+nom+"','"+apell+"');");
            this.Hide();
            Autores_abm mer = new Autores_abm();
            mer.ShowDialog();
        }
Exemplo n.º 7
0
        private void aceptar_Click(object sender, EventArgs e)
        {
            Conexion bd = new Conexion();
            bd.consulta("INSERT INTO libros VALUES(NULL,'"+titulo.Text+"','"+categoria.Text+"','"+cant_hojas.Text+"','"+null+"','"+editorial.Text+"','"+precio.Text+"','"+año.Text+"','"+indice.Text+"','"+stock.Text+"');");
            List<string> lista = bd.consulta("SELECT id_libro FROM libros WHERE titulo='" + titulo.Text + "';");

            string id = lista[0];
            bd.consulta("INSERT INTO libroautor SET libros_id_libro='" + id + "',autores_id_autores='" + autor.getId() + "';");
            bd.cerrarConexion();
            this.Hide();
            Autores_abm mer = new Autores_abm();
            mer.ShowDialog();
        }
Exemplo n.º 8
0
 private void volver_Click(object sender, EventArgs e)
 {
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 9
0
 private void modificar_Click(object sender, EventArgs e)
 {
     Conexion bd = new Conexion();
     bd.consulta("UPDATE  libros SET titulo='" + titulo.Text + "', categoria='" + categoria.Text + "',cant_hojas='"+cant_hojas.Text+"',editorial='"+editorial.Text+"',precio='"+float.Parse(precio.Text)+"',año='"+año.Text+"',indice='"+indice.Text+"',stock='"+stock.Text+"' where id_libro = '" +id +"';");
     bd.consulta("UPDATE  libroautor SET autores_id_autores='" + autorElegido.getId() + "' where libros_id_libro = '" + id + "';");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }
Exemplo n.º 10
0
 private void eliminar_btn_Click_1(object sender, EventArgs e)
 {
     string[] splitted = comboBox2.Text.Split(':');
     Conexion bd = new Conexion();
     bd.consulta("DELETE FROM autores where id_autores = '" + splitted[0] + "';;");
     this.Hide();
     Autores_abm mer = new Autores_abm();
     mer.ShowDialog();
 }