änderungen design
This commit is contained in:
@@ -64,10 +64,11 @@ Partial Class login_FLEX
|
||||
ElseIf reqfieldvaluserName_M.IsValid Then
|
||||
passw = tb2_M.Text
|
||||
End If
|
||||
|
||||
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
||||
Using con As New SqlConnection(ConnectionString)
|
||||
' Using cmd As New SqlCommand("Validate_User")
|
||||
Using cmd As New SqlCommand("SELECT COUNT(*) FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND Kundennr=@UserID")
|
||||
Using cmd As New SqlCommand("SELECT COUNT(*), UserId,Username, Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND Kundennr=@Kundennr")
|
||||
' cmd.CommandType = CommandType.StoredProcedure
|
||||
cmd.Parameters.AddWithValue("@Username", UserNaMe)
|
||||
cmd.Parameters.AddWithValue("UserID", user_ID)
|
||||
@@ -87,11 +88,26 @@ Partial Class login_FLEX
|
||||
Login1.FailureText = "Account ist nicht freigeschaltet."
|
||||
Exit Select
|
||||
Case Else
|
||||
If tb.Text = dr("UserId") Then
|
||||
user_ID = dr("UserID")
|
||||
Else
|
||||
Login1.FailureText = "ID cannot be found in the database!"
|
||||
End If
|
||||
If tb2.Text = dr("Username") Then
|
||||
user_ID = dr("Username")
|
||||
Else
|
||||
Login1.FailureText = "Username is not in the database!"
|
||||
End If
|
||||
If tb3.Text = dr("Password") Then
|
||||
user_ID = dr("Password")
|
||||
Else
|
||||
Login1.FailureText = "Password is not in the database!"
|
||||
End If
|
||||
|
||||
Login1.FailureText = "Erfolgreich validiert."
|
||||
Session.Add("test", UserNaMe)
|
||||
Session.Add("UserID", user_ID)
|
||||
Session.Add("PW", passw)
|
||||
|
||||
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
|
||||
|
||||
'FormsAuthentication.SetAuthCookie(Login1.UserName, True)
|
||||
@@ -108,6 +124,12 @@ Partial Class login_FLEX
|
||||
Protected Sub LoginButton_Click(sender As Object, e As EventArgs)
|
||||
Validate("Login")
|
||||
If Page.IsValid() Then
|
||||
Dim cb As CheckBox = Page.FindControl("RememberMe")
|
||||
If cb.Checked = True Then
|
||||
FormsAuthentication.SetAuthCookie(Login1.UserName, True)
|
||||
Else
|
||||
FormsAuthentication.SetAuthCookie(Login1.UserName, False)
|
||||
End If
|
||||
Response.Redirect("../Customers/CustomsAviso.aspx")
|
||||
Else
|
||||
Response.Redirect("login_FLEX.aspx")
|
||||
@@ -116,6 +138,12 @@ Partial Class login_FLEX
|
||||
Protected Sub LoginButton_M_Click(sender As Object, e As EventArgs)
|
||||
Validate("Login_M")
|
||||
If Page.IsValid() Then
|
||||
Dim cb As CheckBox = Page.FindControl("RememberMe_M")
|
||||
If cb.Checked = True Then
|
||||
FormsAuthentication.SetAuthCookie(Login1.UserName, True)
|
||||
Else
|
||||
FormsAuthentication.SetAuthCookie(Login1.UserName, False)
|
||||
End If
|
||||
Response.Redirect("../Customers/CustomsAviso.aspx")
|
||||
Else
|
||||
Response.Redirect("login_FLEX.aspx")
|
||||
|
||||
Reference in New Issue
Block a user