Beispiel #1
0
        private void DataGridView1_CellContentClick(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.Deletar(livroSelect.Id);
                break;

            case 1:
                frmEdicaoLivro editLivro = new frmEdicaoLivro();
                editLivro.livrosRow = livroSelect;
                editLivro.ShowDialog();

                this.livrosTableAdapter.Update(editLivro.livrosRow);
                break;

            case 2:
                frmLivroAutor livroAutor = new frmLivroAutor();
                livroAutor.livroRow = livroSelect;
                livroAutor.ShowDialog();
                break;
            }

            this.livrosTableAdapter.SelectAtivos(this.sistemaBibliotecaDBDataSet.Livros);
        }
Beispiel #2
0
        private void DataGridView1_CellContentClick(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:
            {
                frmEdicaoLivro editLivro = new frmEdicaoLivro();
                editLivro.livros = livroSelect;
                editLivro.ShowDialog();

                livrosTableAdapter.Update(editLivro.livros);
            };
                break;
            }

            this.livrosTableAdapter.CustonQuery(this.sistemaBibliotecaDBDataSet.Livros);
        }
Beispiel #3
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var userSelect = ((System.Data.DataRowView)
                              this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row

                             as MVCProject.SistemaBibliotecaDBADataSet.LivrosRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {         // Livro AUTOR
                LivroAutor frm = new LivroAutor();
                frm.LivrosRow = userSelect;
                frm.ShowDialog();
            }
            break;

            case 1:
            {
                // DELETE

                this.livrosTableAdapter.DeleteQuery(userSelect.Id);
            }
            break;

            case 2:
            {         // Editar
                frmEdicaoLivro edicaoLiv = new frmEdicaoLivro();
                edicaoLiv.livroRow = userSelect;
                edicaoLiv.ShowDialog();

                this.livrosTableAdapter.Update(edicaoLiv.livroRow);
            }
            break;
            }

            this.livrosTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Livros);
            this.livrosTableAdapter.CustomQuery(sistemaBibliotecaDBDataSet.Livros);
        }