private void btnConsRaLib_Click(object sender, EventArgs e) { try { Libros libro = new Cls_Libros().ConsultarLibro(Convert.ToInt32(txtCodLibro.Text)); txtCodLibro.Text = "" + libro.CodLibro; txtNomCli.Text = libro.Titulo; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
}//fin evento agregar private void btnConsultar_Click(object sender, EventArgs e) { using (TransactionScope scope = new TransactionScope()) { try { Libros libro = new Cls_Libros().ConsultarLibro(Convert.ToInt32(txtCodigo.Text)); txtISBN.Text = libro.ISBN; txtTitulo.Text = libro.Titulo; txtAutor.Text = libro.Autor; dtpPublicacion.Text = "" + libro.FechaPublicacion; existencias exis = new Cls_Existencias().Consultar(Convert.ToInt32(txtCodigo.Text)); txtCantidadEjemplares.Text = "" + exis.cantidad; scope.Complete(); } catch (Exception ex) { scope.Dispose(); MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }//fin de scope }