private void cadastarBtn_Click(object sender, RoutedEventArgs e) { Aluno aluno = new Aluno(); AlunoServico a = new AlunoServico(); aluno.alunoId = Convert.ToInt32(alunoIdTbx.Text); aluno.nome = nomeTbx.Text; aluno.ra = raTbx.Text; aluno.notaB1 = Convert.ToDecimal(notaB1Tbx.Text); aluno.notaB2 = Convert.ToDecimal(notaB2Tbx.Text); aluno.notaPim = Convert.ToDecimal(notaPimTbx.Text); // Serviço que faz o cadastro a.Cadastrar(aluno); // Sempre ao cadastrar, a lista de alunos é atualizada alunosDgv.ItemsSource = a.BuscarTodos(); // Deixar as TextBox em Branco nomeTbx.Text = String.Empty; raTbx.Text = String.Empty; notaB1Tbx.Text = String.Empty; notaB2Tbx.Text = String.Empty; notaPimTbx.Text = String.Empty; }