コード例 #1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            //PROFESSOR
            SistemaEscola.Entidades.ProfessorEnt profEnt = new Entidades.ProfessorEnt();
            String nome, telefone, email, cpf, grauForm, form, dataNasc;

            nome     = txtNome.Text;
            telefone = txtTelefone.Text;
            email    = txtEmail.Text;
            cpf      = txtCPF.Text;
            grauForm = cmbGrauFormacao.Text;
            form     = txtFormacao.Text;
            dataNasc = txtDataNasc.Text;

            profEnt.Nome      = nome;
            profEnt.Telefone  = telefone;
            profEnt.Email     = email;
            profEnt.CPF       = cpf;
            profEnt.Grau_Form = grauForm;
            profEnt.Form      = form;
            profEnt.DataNasc  = dataNasc;

            profDAO.alteraProf(profEnt, txtCod);

            //ENDEREÇO
            String   rua, bairro, num, estado, cidade, cep;
            Endereco endEnt = new Endereco();

            rua    = txtRua.Text;
            bairro = txtBairro.Text;
            num    = txtNum.Text;
            estado = txtEstado.Text;
            cidade = txtCidade.Text;
            cep    = txtCEP.Text;

            endEnt.Rua    = rua;
            endEnt.Bairro = bairro;
            endEnt.Num    = num;
            endEnt.Estado = estado;
            endEnt.Cidade = cidade;
            endEnt.CEP    = cep;

            endDAO.alteraEnd(endEnt, txtCod);
        }
コード例 #2
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            //LOGIN
            String   login;
            int      senha;
            LoginDAO loginDAO = new LoginDAO();

            SistemaEscola.Entidades.Login loginEnt = new Entidades.Login();

            login = txtLoginAno.Text + txtLoginNumId.Text;
            senha = Convert.ToInt32(txtSenha.Text);

            loginEnt.Log   = login;
            loginEnt.Senha = senha;
            loginEnt.User  = user;

            loginDAO.salvarLogin(loginEnt);

            //PROFESSOR
            SistemaEscola.Entidades.ProfessorEnt profEnt = new Entidades.ProfessorEnt();
            ProfessorDAO profDAO = new ProfessorDAO();
            String       nome, telefone, email, cpf, grauForm, form, dataNasc;

            nome     = txtNome.Text;
            telefone = txtTelefone.Text;
            email    = txtEmail.Text;
            cpf      = txtCPF.Text;
            grauForm = cmbGrauFormacao.Text;
            form     = txtFormacao.Text;
            dataNasc = txtDataNasc.Text;

            profEnt.Login     = login;
            profEnt.Nome      = nome;
            profEnt.Telefone  = telefone;
            profEnt.Email     = email;
            profEnt.CPF       = cpf;
            profEnt.Grau_Form = grauForm;
            profEnt.Form      = form;
            profEnt.DataNasc  = dataNasc;

            profDAO.salvarProf(profEnt);

            //ENDEREÇO
            SistemaEscola.Entidades.Endereco endEnt = new Entidades.Endereco();
            EnderecoDAO endDAO = new EnderecoDAO();

            String rua, bairro, num, estado, cidade, cep;

            rua    = txtRua.Text;
            bairro = txtBairro.Text;
            num    = txtNum.Text;
            estado = txtEstado.Text;
            cidade = txtCidade.Text;
            cep    = txtCEP.Text;

            endEnt.Login  = login;
            endEnt.Rua    = rua;
            endEnt.Bairro = bairro;
            endEnt.Num    = num;
            endEnt.Estado = estado;
            endEnt.Cidade = cidade;
            endEnt.CEP    = cep;

            endDAO.salvarEnd(endEnt);
        }