Example #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            BEC_EMAIL.Email mail             = new BEC_EMAIL.Email();
            WS_Agregar_Bec.AgregarClient add = new WS_Agregar_Bec.AgregarClient();
            BEC_EMAIL.User us = new BEC_EMAIL.User();

            //add.insertarFicha(txtRut.Text, txtNombre.Text, txtDIreccion.Text, txtEmail.Text, txtTelefono.Text, int.Parse(txtHuella.Text));

            int result = add.insertarFicha(txtRut.Text, txtNombre.Text, txtDIreccion.Text, txtEmail.Text, txtTelefono.Text, 123);

            if (result != 0)
            {
                string nick = us.CrearUser(txtNombre.Text);
                add.insertarUsuario(nick, "D2wq#43gtd@kl#d1dDssq", 0, result, 3);
                mail.EnviarCorreo(txtEmail.Text, "D2wq#43gtd@kl#d1dDssq", nick);
                Session["Correcto"] = "si";
                Session["nick"]     = nick;
                Session["reg"]      = "si";
                Response.Redirect("liststudent.aspx");
            }
            else
            {
                Incorrect();
            }
        }
Example #2
0
 protected void txtRut_TextChanged(object sender, EventArgs e)
 {
     BEC_EMAIL.User us = new BEC_EMAIL.User();
     if (us.validarRut(txtRut.Text))
     {
         txtRut.Text = us.formatearRut(txtRut.Text);
     }
     else
     {
         IncorrectRut();
         txtRut.Text = "";
     }
 }