예제 #1
0
 private void btnExcluirAluno_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Deseja realmente excluir?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         ClsAlunos.cod = Convert.ToInt32(dt.Rows[dgvAlunos.CurrentRow.Index]["id_aluno"]);
         ClsAlunos.excluir(ClsAlunos.cod);
         carregarDataGrid();
     }
 }
예제 #2
0
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     if (dgvAlunos.SelectedRows.Count > 0)
     {
         ClsAlunos.cod = Convert.ToInt32(dt.Rows[dgvAlunos.CurrentRow.Index]["id_aluno"]);
         ClsAlunos.excluir(ClsAlunos.cod);
     }
     else
     {
         ClsAlunos.cod = Convert.ToInt32(dgvAlunos.Rows[0].Cells[0].Value);
         ClsAlunos.excluir(ClsAlunos.cod);
     }
 }
예제 #3
0
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            //StringBuilder codigo = new StringBuilder();

            if (dgvAlunos.SelectedRows.Count > 0)
            {
                //codigo.Append(dgvAlunos.SelectedRows[0].Cells[0].Value.ToString());
                ClsAlunos.cod = Convert.ToInt32(dt.Rows[dgvAlunos.CurrentRow.Index]["id_aluno"]);
                //ClsAlunos.cod = Convert.ToInt32(dgvAlunos.SelectedRows[0].Cells[0].Value);
                ClsAlunos.excluir(ClsAlunos.cod);

                //MessageBox.Show(cod.ToString());
            }
            else
            {
                //codigo.Append(dgvAlunos.Rows[0].Cells[0].Value.ToString());
                ClsAlunos.cod = Convert.ToInt32(dgvAlunos.Rows[0].Cells[0].Value);
                ClsAlunos.excluir(ClsAlunos.cod);
            }
        }