Exemplo n.º 1
0
    protected void btn_saveProfile(object sender, EventArgs e)
    {
        PersonaEntity personaSend;

        if (persona.tipoPersona == 'S')
        {
            personaSend = new SocioEntity();
        }
        else
        {
            personaSend = new EmpleadoEntity();
        }
        personaSend.Id              = persona.Id;
        personaSend.Nombre          = nombre.Value;
        personaSend.Apellido        = apellido.Value;
        personaSend.dni             = dni.Value;
        personaSend.FechaNacimiento = DateTime.Parse(fechanacimiento.Attributes["value"]);
        personaSend.Password        = contrasenia.Attributes["value"];
        if (genderM.Checked)
        {
            personaSend.Sexo = 'M';
        }
        else
        {
            personaSend.Sexo = 'F';
        }

        personaBo.saveProfile(personaSend);
        SessionHelper.AlmacenarPersonaAutenticada(personaBo.Autenticar(persona.Email, personaSend.Password));
        System.Web.Security.FormsAuthentication.RedirectFromLoginPage(SessionHelper.PersonaAutenticada.Email, false);
        Response.Redirect("Profile.aspx");
    }
Exemplo n.º 2
0
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         SessionHelper.AlmacenarPersonaAutenticada(boUsuario.Autenticar(username.Value, password.Value));
         System.Web.Security.FormsAuthentication.RedirectFromLoginPage(SessionHelper.PersonaAutenticada.Email, false);
         Page.Response.Redirect("~/site-web/home/HomeSiteWeb.aspx");
     }
     catch (AutenticacionExcepcionBO ex)
     {
         WebHelper.MostrarMensaje(Page, ex.Message);
     }
 }
 protected void btnEntrar_Click(object sender, EventArgs e)
 {
     try
     {
         SessionHelper.AlmacenarPersonaAutenticada(boUsuario.Autenticar(txtEmail.Text, txtPassword.Text));
         System.Web.Security.FormsAuthentication.RedirectFromLoginPage(SessionHelper.PersonaAutenticada.Email, false);
         Response.Redirect("Biografia.aspx", true);
     }
     catch (AutenticacionExcepcionBO ex)
     {
         WebHelper.MostrarMensaje(Page, ex.Message);
     }
 }