private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var generoSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.GeneroRow; switch (e.ColumnIndex) { case 0: { this.generoTableAdapter.DeleteQuery(generoSelect.Id, generoSelect.Tipo, 1, generoSelect.Descrição); this.generoTableAdapter.SelectQuery(sistemaBibliotecaDBDataSet.Genero); } break; case 1: { frmEditGenero edicaoGenero = new frmEditGenero() { generoRow = generoSelect }; edicaoGenero.ShowDialog(); this.generoTableAdapter.Update(edicaoGenero.generoRow); } break; } this.generoTableAdapter.SelectQuery(this.sistemaBibliotecaDBDataSet.Genero); }
private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var generoSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.GenerosRow; switch (e.ColumnIndex) { case 0: { frmEdit = new frmEditGenero(); frmEdit.GenerosRow = generoSelect; frmEdit.ShowDialog(); this.generosTableAdapter.Update(frmEdit.GenerosRow); }; break; } this.generosTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Generos); }
private void DgvGeneros_CellContentClick(object sender, DataGridViewCellEventArgs e) { var selectGenero = ((System.Data.DataRowView) this.dgvGeneros.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.GenerosRow; switch (e.ColumnIndex) { case 0: { frmEditGenero editGenero = new frmEditGenero(); editGenero.GeneroRow = selectGenero; editGenero.ShowDialog(); this.generosTableAdapter.Update(editGenero.GeneroRow); } break; } this.generosTableAdapter.Fill(sistemaBibliotecaDBDataSet.Generos); }