private void buttonBuscarLibro_Click(object sender, EventArgs e) { if (textBoxIdLibroBuscar.Text != "") { //try //{ ENBook book = new ENBook(); book = book.read(textBoxIdLibroBuscar.Text); textBoxAsignaturasLibroBuscar.Text = book.Subject.Name; textBoxCursosLibroBuscar.Text = book.Course.Courses; textBoxNombreLibroBuscar.Text = book.Name; textBoxEditorialBuscaLibro.Text = book.CIF; textBoxDescripcionBuscaLibro.Text = book.Description; pictureBoxImagenLibro.Image = Image.FromFile(book.Image); buttonEliminarLibro.Visible = true; /* } catch { MessageBox.Show("Inserte un libro correcto.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); }*/ } else MessageBox.Show("Inserte un curso.", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
private void buttonEliminarLibro_Click(object sender, EventArgs e) { ENBook book = new ENBook(); book = book.read(textBoxIdLibroBuscar.Text); book.delete(); buttonEliminarLibro.Visible = false; }