コード例 #1
0
        public static void processaTrabalho(string dir)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(dir);

            XmlNode  nodeAluno      = doc.DocumentElement.SelectSingleNode("/aluno");
            string   nomeAluno      = nodeAluno.Attributes["nome"]?.InnerText;
            DateTime dataNascimento = Convert.ToDateTime(nodeAluno.Attributes["dataNascimento"]?.InnerText);
            string   sexo           = nodeAluno.Attributes["sexo"]?.InnerText;


            Aluno aluno = new Aluno(nomeAluno, dataNascimento, sexo);

            AlunoNegocios alunoNegocio = new AlunoNegocios();

            alunoNegocio.Cadastrar(aluno);
        }
コード例 #2
0
        private void BtnFinalizar_Click(object sender, EventArgs e)
        {
            Aluno a = new Aluno();


            a.nome           = txtNome.Text;
            a.rg             = txtRG.Text;
            a.cpf            = txtCPF.Text;
            a.dataNascimento = Convert.ToDateTime(txtDataNascimento.Text);
            a.email          = txtEmail.Text;
            a.endereco       = txtEndereco.Text;
            a.numero         = txtNumero.Text;
            a.apto           = txtApto.Text;
            a.telefone       = txtTelefone.Text;
            a.celular        = txtCelular.Text;
            a.cep            = txtCEP.Text;

            AlunoNegocios alunoNegocios = new AlunoNegocios();


            // alunoNegocios.inserirAluno(a);
            this.Hide();
        }