Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }