Exemplo n.º 1
0
    protected void SignIn(object sender, EventArgs e)
    {
        LoginBusiness lb   = new LoginBusiness();
        User          user = new User();

        user.Account  = username.Text;
        user.Password = password.Text;
        user.RoleId   = 3;

        string errorText = lb.ValidateCredentials(user);

        if (errorText == null)
        {
            RegularUser regularUser = lb.GetRegularUser(user);

            Session["REG_USER"] = regularUser;
            Response.Redirect("Wall.aspx");
        }
        else
        {
            Errors.Text = errorText;
        }
    }