Beispiel #1
0
    public string LoginUser(string txtUsername, string txtPassword)
    {
        string message = "";
        // Declare userlogin of userdataset type
        dsUser dsUserLogin;

        dsUserLogin = myDataLayer.VerifyUser(txtUsername, txtPassword);

        // If less than 1 no matches found
        if (dsUserLogin.tblUsers.Count < 1)
        {
            message = "Incorrect Username or Password.";
            return(message);
        }
        else
        {
            HttpContext.Current.Session["username"] = txtUsername;

            HttpContext.Current.Response.Redirect("Account Details.aspx");
            return(message);
        }
    }