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

            switch (e.ColumnIndex)
            {
            case 0:
            {
                frmEdicaoGeneros editGeneros = new frmEdicaoGeneros();
                editGeneros.GenerosRow = generosSelect;
                editGeneros.ShowDialog();

                this.generosTableAdapter.UpdateQuery(
                    editGeneros.GenerosRow.Tipo,
                    editGeneros.GenerosRow.Descricao,
                    editGeneros.GenerosRow.Id);

                //this.generosTableAdapter.DeleteQuery(generosSelect.Id);
            }
            break;
            }
            this.generosTableAdapter.CustomQuery(this.sistemaBibliotecaDBDataSet.Generos);
        }
示例#2
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var userSelect = ((System.Data.DataRowView)
                              this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row

                             as MVCProject.SistemaBibliotecaDBADataSet.GenerosRow;

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

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

            case 1:
            {
                frmEdicaoGeneros edicaoGen = new frmEdicaoGeneros();
                edicaoGen.generosRow = userSelect;
                edicaoGen.generosRow = userSelect;
                edicaoGen.ShowDialog();


                this.generosTableAdapter.Update(edicaoGen.generosRow);
            }
            break;
            }
            this.generosTableAdapter.CustomQuery(sistemaBibliotecaDBDataSet.Generos);
        }