private void DgvLivros_CellContentClick(object sender, DataGridViewCellEventArgs e) { var selectLivros = ((System.Data.DataRowView) this.dgvLivros.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.LivrosRow; switch (e.ColumnIndex) { case 0: { this.livrosTableAdapter.DeleteQuery(selectLivros.Id); } break; case 1: { frmEditLivro editLivro = new frmEditLivro(); editLivro.LivroRow = selectLivros; editLivro.ShowDialog(); this.livrosTableAdapter.Update(editLivro.LivroRow); } break; } this.livrosTableAdapter.QueryShowAtivos(sistemaBibliotecaDBDataSet.Livros); }
private void DataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { var livroSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.LivrosRow; switch (e.ColumnIndex) { case 0: { this.livrosTableAdapter.DeleteQuery(livroSelect.Id); }; break; case 1: { frmEditLivro frmEdit = new frmEditLivro(); frmEdit.LivrosRow = livroSelect; frmEdit.ShowDialog(); this.livrosTableAdapter.Update(frmEdit.LivrosRow); } break; } this.livrosTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Livros); }
private void DataGridLivros_CellContentClick(object sender, DataGridViewCellEventArgs e) { var livroSelect = ((System.Data.DataRowView) this.DataGridLivros.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.LivrosRow; switch (e.ColumnIndex) { case 0: { this.livrosTableAdapter.DeleteQuery(livroSelect.Id); } break; case 1: { frmEditLivro editLivro = new frmEditLivro(); editLivro.LivrosRow = livroSelect; editLivro.ShowDialog(); this.livrosTableAdapter.Update(editLivro.LivrosRow); } break; case 2: { frmLivroAutor fLivroAutor = new frmLivroAutor(); fLivroAutor.LivrosRow = livroSelect; fLivroAutor.ShowDialog(); } break; } this.livrosTableAdapter.FillEditorasGeneros(sistemaBibliotecaDBDataSet.Livros); }