Example #1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            EdicionLibro frm = new EdicionLibro();

            frm.ShowDialog();
            CargarDatos();
        }
Example #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            EdicionLibro frm = new EdicionLibro();

            frm.txtIDLibro.Text             = dtgRegistros.CurrentRow.Cells["IDLibro"].Value.ToString();
            frm.txtTitulo.Text              = dtgRegistros.CurrentRow.Cells["Titulo"].Value.ToString();
            frm.cmbAutores.SelectedItem     = dtgRegistros.CurrentRow.Cells["IDAutor"].Value.ToString();
            frm.cmbEditoriales.SelectedItem = dtgRegistros.CurrentRow.Cells["IDEditorial"].Value.ToString();
            frm.cmbCategorias.SelectedItem  = dtgRegistros.CurrentRow.Cells["IDCategoria"].Value.ToString();
            frm.txtEdicion.Text             = dtgRegistros.CurrentRow.Cells["Edicion"].Value.ToString();
            frm.txtContenidos.Text          = dtgRegistros.CurrentRow.Cells["Contenidos"].Value.ToString();
            frm.dtFecha.Text    = dtgRegistros.CurrentRow.Cells["Fecha_Lanzamiento"].Value.ToString();
            frm.txtPaginas.Text = dtgRegistros.CurrentRow.Cells["Paginas"].Value.ToString();

            DataGridViewRow row  = dtgRegistros.CurrentRow;
            DataRowView     rows = row.DataBoundItem as DataRowView;

            frm.pbxPortada.Image = Functions.Class1.ByteArrayToImage((byte[])rows["Portada"]);
            frm.ShowDialog();
            CargarDatos();
        }