Пример #1
0
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            lo.Usuario = txtUsuario.Text;
            lo.Senha   = BLL.Criptografia.getMdIHash(txtSenha.Text);
            lo.Tipo    = 2;

            pro.IdLogin = loDAL.Cadastrar(lo);


            pro.Nome      = txtNome.Text;
            pro.Email     = txtEmail.Text;
            pro.Telefone  = txtTelefone.Text;
            pro.Foto      = "."; //FIZ UMA PUTA GAMBIARRA
            pro.Cpf       = txtCpf.Text;
            pro.Descricao = txtDescricao.Text;

            proDAL.Cadastrar(pro);

            btnFiltrar_Click(null, null);
            Response.Write("<script>alert('Cadastrado com sucesso!')</script>");

            txtNome.Text      = "";
            txtEmail.Text     = "";
            txtTelefone.Text  = "";
            txtCpf.Text       = "";
            txtDescricao.Text = "";
            txtSenha.Text     = "";
            txtUsuario.Text   = "";

            txtNome.Focus();
        }
Пример #2
0
        /*protected void btnLogin_Click(object sender, EventArgs e)
         * {
         *  Response.Redirect("Login.aspx");
         * }*/

        protected void btnCadastrar_Click(object sender, EventArgs e)
        {
            BLL.Aluno alu = new BLL.Aluno();

            lo.Usuario = txtUsuario.Text;
            lo.Senha   = BLL.Criptografia.getMdIHash(txtSenha.Text);
            lo.Tipo    = 1;



            alu.Nome       = txtNome.Text;
            alu.Cpf        = txtCpf.Text;
            alu.Rg         = txtRg.Text;
            alu.Nascimento = DateTime.Parse(txtNasc.Text);
            alu.Cep        = txtCep.Text;
            alu.Estado     = DropDownList.SelectedValue;
            alu.Bairro     = txtBairro.Text;
            alu.Cidade     = txtCidade.Text;
            alu.RuaAv      = txtRuaAv.Text;
            alu.Numero     = txtNum.Text;
            alu.Email      = txtEmail.Text;
            alu.Telefone   = txtTelefone.Text;

            if (CheckBox1.Checked == true)
            {
                alu.IdLogin = loDAL.Cadastrar(lo);

                DAL.AlunoDAL aluDAL = new DAL.AlunoDAL();

                aluDAL.Cadastrar(alu);

                txtUsuario.Text            = "";
                txtNome.Text               = "";
                txtCpf.Text                = "";
                txtSenha.Text              = "";
                txtRg.Text                 = "";
                txtNasc.Text               = "";
                txtCep.Text                = "";
                DropDownList.SelectedIndex = 1;
                txtBairro.Text             = "";
                txtCidade.Text             = "";
                txtRuaAv.Text              = "";
                txtNum.Text                = "";
                txtEmail.Text              = "";
                txtTelefone.Text           = "";
                txtNome.Focus();

                Response.Write("<script>alert('Cadastro efetuado!')</script>");
            }
            else
            {
                litAviso.Text = "Você deve concordar com termos para continuar!";
            }


            //btnLogin_Click(null, null);
        }