private void btnCadastrarAluno_Click(object sender, EventArgs e) { if (tbNomeAluno.Text != "" && tbNomeAluno.Text != null && dtNascimentoAluno.Text != "" && dtNascimentoAluno.Text != null && cbCurso.SelectedItem != null) { Curso curso = (Curso)cbCurso.SelectedItem; Aluno aluno = new Aluno(Convert.ToDateTime(dtNascimentoAluno.Text), tbNomeAluno.Text, curso); alunoServico.cadastraAluno(aluno); MessageBox.Show("Aluno cadastrado com sucesso!"); btnBuscarAluno_Click(sender, e); } else { MessageBox.Show("Os dados para cadastro de um aluno estão incompletos. Por favor preencha todos os campos e tente novamente."); } }