private void bntEditar_Click(object sender, EventArgs e) { if (getIndex() >= 0 && getIndex() < alunos.Count) { FormCadastroEdicaoAluno form = new FormCadastroEdicaoAluno(alunos[getIndex()], this, dbContext); form.ShowDialog(); } else { MessageBox.Show("Selecione alguma linha para executar essa ação."); } }
private void btnAdd_Click(object sender, EventArgs e) { FormCadastroEdicaoAluno form = new FormCadastroEdicaoAluno(null, this, dbContext); form.ShowDialog(); }