예제 #1
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var autoresSelect = ((System.Data.DataRowView)
                                 this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                                as MVCProject.SistemaBibliotecaDBDataSet.AutoresRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                this.autoresTableAdapter.DeleteQuery(autoresSelect.Id, autoresSelect.Nome, 1, autoresSelect.Descricao);
                this.autoresTableAdapter.SelectQuery(sistemaBibliotecaDBDataSet.Autores);
            }
            break;

            case 1:
            {
                frmEditAutores edicaoAutores = new frmEditAutores()
                {
                    autoresRow = autoresSelect
                };
                edicaoAutores.ShowDialog();

                this.autoresTableAdapter.Update(edicaoAutores.autoresRow);
            }
            break;
            }
            this.autoresTableAdapter.SelectQuery(this.sistemaBibliotecaDBDataSet.Autores);
        }
예제 #2
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var autorSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.AutoresRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                frmEditAutores telaEditAutor = new frmEditAutores();
                telaEditAutor.AutoresRow = autorSelect;
                telaEditAutor.ShowDialog();
                this.autoresTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Autores);
            }
            break;
            }
        }