示例#1
0
 private void btnMatricula_Click(object sender, EventArgs e)
 {
     if (ValidaCampos() != "")
     {
         MessageBox.Show(ValidaCampos(), "ERRO!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         var aluno = new Aluno
         {
             CPF       = txtCPF.Text,
             Nome      = txtNome.Text,
             Endereco  = txtEnd.Text,
             Telefone  = txtTel.Text,
             DataNasc  = DateTime.ParseExact(txtDtNasc.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture),
             EstCivil  = cmbEstCivil.SelectedItem.ToString(),
             NumFilhos = Convert.ToInt32(txtNumFilhos.Value),
             Sexo      = cmbSexo.SelectedItem.ToString(),
             Altura    = Convert.ToDouble(txtAltura.Text),
             Email     = txtEmail.Text
         };
         MessageBox.Show(alunoBLL.AdicionarAluno(aluno));
         this.Hide();
         FrmMatricula matricula = new FrmMatricula();
         matricula.ShowDialog();
         this.Close();
     }
 }
示例#2
0
        private void btnMatricula_Click(object sender, EventArgs e)
        {
            this.Hide();
            FrmMatricula matricula = new FrmMatricula();

            matricula.ShowDialog();
            this.Close();
        }