コード例 #1
0
        protected void btnSignIn_Click(object sender, EventArgs e)
        {
            int?userId = UserDBHelper.IsCredentialsValid(txtUserName.Text, txtPassword.Text);

            if (userId != null)
            {
                Session["USER"]   = txtUserName.Text;
                Session["USERID"] = userId;
                if (UserDBHelper.IsUserAdmin(Session["USER"].ToString()))
                {
                    Session["ISADMIN"] = "1";
                    Response.Redirect("AdminHome.aspx");
                }
                Response.Redirect("Home.aspx");
            }
        }