Esempio n. 1
0
 public void eliminarrLector(Libros u)
 {
     conetar();
     comando             = conexion.CreateCommand();
     comando.CommandText = " delete from Libros  where idLibro=@user";
     comando.Parameters.AddWithValue("@user", u.idlibro);
     comando.ExecuteNonQuery();
     desconectar();
 }
Esempio n. 2
0
 public void actualizarLector(Libros u)
 {
     conetar();
     comando             = conexion.CreateCommand();
     comando.CommandText = " update Libros set  nombre=@n2,editorial=@a1,autor=@a2,foto=@dir where idlibro=@n1";
     comando.Parameters.AddWithValue("@n1", u.idlibro);
     comando.Parameters.AddWithValue("@n2", u.titulo);
     comando.Parameters.AddWithValue("@a1", u.editorial);
     comando.Parameters.AddWithValue("@a2", u.autor);
     System.IO.MemoryStream ms = new System.IO.MemoryStream();
     u.portada.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
     comando.Parameters.AddWithValue("@dir", ms.GetBuffer());
     comando.ExecuteNonQuery();
     desconectar();
 }
Esempio n. 3
0
 public void registrarLector(Libros u)
 {
     conetar();
     comando             = conexion.CreateCommand();
     comando.CommandText = " INSERT INTO Libros values(@user,@n1,@n2,@a1,@dir)";
     comando.Parameters.AddWithValue("@user", u.idlibro);
     comando.Parameters.AddWithValue("@n1", u.titulo);
     comando.Parameters.AddWithValue("@n2", u.editorial);
     comando.Parameters.AddWithValue("@a1", u.autor);
     System.IO.MemoryStream ms = new System.IO.MemoryStream();
     u.portada.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
     comando.Parameters.AddWithValue("@dir", ms.GetBuffer());
     comando.ExecuteNonQuery();
     desconectar();
 }