Ejemplo n.º 1
0
        private void btnAdicionar_Click(object sender, EventArgs e)
        {
            AlunoDetalhe tela = new AlunoDetalhe();
            tela.ShowDialog();

            if(tela.Atual != null)
            {
                alunos.Add(tela.Atual);
                AlunoRepositorio repositorio = new AlunoRepositorio();
                repositorio.Inserir(tela.Atual);
            }
        }
Ejemplo n.º 2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            Aluno aluno = (Aluno)dgvAlunos.CurrentRow.DataBoundItem;
            AlunoDetalhe tela = new AlunoDetalhe();
            tela.Atual = aluno;

            if(tela.ShowDialog() == DialogResult.OK)
            {
                AlunoRepositorio repositorio = new AlunoRepositorio();
                repositorio.Atualizar(aluno);
                dgvAlunos.Refresh();
            }
        }