protected void BotonModificarDatos_Click(object sender, EventArgs e) { PW3Entities ctx = new PW3Entities(); AutenticacionService aut = new AutenticacionService(sesion.mail, sesion.contraseña); alumno al = (from a in ctx.alumno where a.mail == sesion.mail select a).First(); al.nombre = TexBoxNombre.Text; al.apellido = TextBoxApellido.Text; al.contraseña = TextBoxPassNuevaRe.Text; ctx.SaveChanges(); Session["usuario"] = aut.getAlumno(); }
protected void BotonLogin_Click(object sender, EventArgs e) { AutenticacionService aut = new AutenticacionService(TextBoxEmail.Text, TextBoxContraseña.Text); if (Convert.ToInt32(DropDownList1.SelectedValue) == 1) { if (aut.comprobarProfesor()) { Session["usuario"] = aut.getProfesor(); Response.Redirect("home-profesor.aspx"); } } if (Convert.ToInt32(DropDownList1.SelectedValue) == 2) { if (aut.comprobarAlumno()) { Session["usuario"] = aut.getAlumno(); Response.Redirect("home-alumno.aspx"); } } }