Пример #1
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var userSelect = ((System.Data.DataRowView)
                              this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row

                             as MVCProject.SistemaBibliotecaDBADataSet.LocacaoRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                // DELETE

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

            case 1:
            {
                frmEdicaoLocacao edicaoGen = new frmEdicaoLocacao();
                edicaoGen.locacaoRow = userSelect;
                edicaoGen.locacaoRow = userSelect;
                edicaoGen.ShowDialog();


                this.locacaoTableAdapter.Update(edicaoGen.locacaoRow);
            }
            break;
            }
            this.locacaoTableAdapter.CustomQuerys(sistemaBibliotecaDBDataSet.Locacao);
        }
Пример #2
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var locSelect = ((System.Data.DataRowView)
                             this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                            as MVCProjectForms.SistemaBibliotecaDBDataSet.LocacaoRow;

            //var locSelect = ((System.Data.DataRowView)
            //    this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
            //    as MVCProjectForms.SistemaBibliotecaDBDataSet.LocacaoRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                this.locacaoTableAdapter.DeleteQuery(locSelect.Id);
            } break;

            case 1:
            {
                frmEdicaoLocacao editLocacao = new frmEdicaoLocacao();
                editLocacao.LocacaoRow = locSelect;
                editLocacao.ShowDialog();

                this.locacaoTableAdapter.Update(editLocacao.LocacaoRow);
            } break;
            }
            this.locacaoTableAdapter.Fill(sistemaBibliotecaDBDataSet.Locacao);
        }
Пример #3
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var locacaoSelect = ((System.Data.DataRowView)
                                 this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as
                                MVCProject.SistemaBibliotecaDBDataSet.locacaoRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                frmEdicaoLocacao editLocacao = new frmEdicaoLocacao();
                editLocacao.locacoes = locacaoSelect;
                editLocacao.ShowDialog();

                locacaoTableAdapter.Update(editLocacao.locacoes);
            };
                break;
            }

            this.locacaoTableAdapter.CustonQuery(this.sistemaBibliotecaDBDataSet.locacao);
        }