Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 private void BtnAutores_Click(object sender, EventArgs e)
 {
     if (rowSelecionada != null)
     {
         frmLivroAutor telaAutor = new frmLivroAutor();
         telaAutor.livrosRow = rowSelecionada;
         telaAutor.ShowDialog();
         this.livrosTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Livros);
     }
     else
     {
         MessageBox.Show("Selecione um registro para alterar");
     }
 }
Ejemplo n.º 3
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //Lembrar que isso e apenas para a linha da nossa grid e noa a classe de uso normal
            var livroSelect = ((System.Data.DataRowView)
                               this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as
                              MVCProject.SistemaBibliotecaDBDataSet.LivrosRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                frmLivroAutor frm = new frmLivroAutor();
                frm.LivrosRow = livroSelect;
                frm.ShowDialog();
            }
            break;
            }

            this.livrosTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Livros);
        }
Ejemplo n.º 4
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:                                 //Coluna deletar
            {
                this.livrosTableAdapter.DeleteQuery(livroSelect.Id);
            }
            break;

            case 1:                 //editar
            {
                editLivro livroEdit = new editLivro();
                livroEdit.livrosRow = livroSelect;
                livroEdit.ShowDialog();


                this.livrosTableAdapter.Update(livroEdit.livrosRow);
            }
            break;

            case 2:                 // Livro AUTOR
            {
                frmLivroAutor frm = new frmLivroAutor();
                frm.livrosRow = livroSelect;
                frm.ShowDialog();
            }
            break;
            }

            this.livrosTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Livros);
            this.livrosTableAdapter.CustomQuery(sistemaBibliotecaDBDataSet.Livros);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        private void LivroAutorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmLivroAutor fLivroAutor = new frmLivroAutor();

            fLivroAutor.ShowDialog();
        }