private void btnAlterar_Click(object sender, EventArgs e) { try { vw_Livro_Autor_Genero livro = dgvLivros.CurrentRow.DataBoundItem as vw_Livro_Autor_Genero; frmCadastrar frm = new frmCadastrar(); frm.PreencherCampos(livro.id_livro); ((frmPrincipal)this.ParentForm).CarregarPanel(frm); } catch (Exception) { MessageBox.Show($"Você deve selecionar um livro para visualizar!", "Biblioteca", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnCadastrar_Click(object sender, EventArgs e) { frmCadastrar frm = new frmCadastrar(); ((frmPrincipal)this.ParentForm).CarregarPanel(frm); }