private void button1_Click(object sender, EventArgs e) { string cpf = TextBoxCpf.Text; EscolaController ec = new EscolaController(); Escola escola = new Escola(); try { escola = ec.PesquisarAluno(cpf); if (escola == null) { MessageBox.Show("Cliente não foi encontrado", "ATENÇÃO", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { NomeAluno.Text = escola.GetNomeAluno(); DataNasc.Text = Convert.ToString(escola.GetDataNascimentoAluno()); AnoEscolar.Text = escola.GetAnoEscolar(); NomeResp.Text = escola.GetNomeResponsavel(); Contato.Text = escola.GetContato(); Email.Text = escola.GetEmail(); button1.Enabled = false; TextBoxCpf.Enabled = false; } } catch (Exception m) { MessageBox.Show(m.Message, "ATENÇÃO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public EscolaControllerTest() { testBuilder = new EscolaBuildTests(); testeOutParam = string.Empty; escolaController = new EscolaController(testBuilder.autenticacaoServiceMock.Object, testBuilder.escolaServiceMock.Object, testBuilder.logService.Object); }