Exemple #1
0
    //metodo copiado da modal login
    protected void btnEntrar_Click(object sender, EventArgs e)
    {
        string email = txbUserEmail.Text.ToString();
        string senha = txbUserSenha.Text.ToString();

        if (!IsValidUserFields(email, senha))
        {
            Response.Redirect("/login/?l=");
            return;
        }

        Usuario usuario = new UsuarioCrypto()
        {
            Email = email,
            Senha = senha
        };

        if (!UsuarioDB.IsValid(usuario))
        {
            Response.Redirect("/login/?L=");

            txbUserEmail.Text = "";
            txbUserSenha.Text = "";
            return;
        }

        usuario = UsuarioDB.Select(usuario);

        if (usuario == null)
        {
            AlertError("E-mail e/ou Senha Inválidos");
        }
        else
        {
            ResolveRedirect(usuario);
        }
    }