Änderungen an Fehlersystem
This commit is contained in:
14
App_Code/VERAG_VARIABLES.vb
Normal file
14
App_Code/VERAG_VARIABLES.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Imports Microsoft.VisualBasic
|
||||
|
||||
Public Class VERAG_VARIABLES
|
||||
Public Shared errornumb As Integer = 0
|
||||
Shared Sub initerrorcount()
|
||||
errornumb = 0
|
||||
End Sub
|
||||
Shared Sub seterrorcount(var As Integer)
|
||||
errornumb += 1
|
||||
End Sub
|
||||
Shared Function geterrornumb() As String
|
||||
Return "Error:" + Space(1) + VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(errornumb.ToString)
|
||||
End Function
|
||||
End Class
|
||||
@@ -137,7 +137,26 @@ Partial Class Customers_Default3
|
||||
Protected Sub btn_b_Click(sender As Object, e As EventArgs)
|
||||
dt = Nothing
|
||||
If valdaterage_1.IsValid And valdaterange_2.IsValid Then
|
||||
|
||||
If String.IsNullOrEmpty(Kdnrtext) = False Then
|
||||
If Not String.IsNullOrEmpty(txt_Absender.Text) Then
|
||||
txt_Absender.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
||||
regex_txt_Absender.Enabled = True
|
||||
regex_txt_Absender.Validate()
|
||||
Try
|
||||
If regex_txt_Absender.IsValid = True Then
|
||||
Absender = txt_Absender.Text
|
||||
Else
|
||||
VERAG_VARIABLES.seterrorcount()
|
||||
lbl_status.Text = VERAG_VARIABLES.geterrornumb + ": Fehler bei der Zuweisung"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
VERAG_VARIABLES.seterrorcount()
|
||||
lbl_status.Text = VERAG_VARIABLES.geterrornumb + ": "
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
lbl_status.Text = "The time chosen is newer then today or older than april 2001. Please correct."
|
||||
End If
|
||||
MsgBox("Test")
|
||||
End Sub
|
||||
@@ -168,14 +187,14 @@ Partial Class Customers_Default3
|
||||
End Sub
|
||||
|
||||
Protected Sub valdaterage_1_ServerValidate(source As Object, args As ServerValidateEventArgs)
|
||||
If Date.ParseExact(pickdate1.Text, "dd.MM.yyyy", provider) < Date.ParseExact("01.04.2001", "dd.MM.yyyy", provider) Then
|
||||
If Date.Parse(pickdate1.Text) < Date.ParseExact("01.04.2001", "dd.MM.yyyy", provider) Then
|
||||
lbl_status.Text = "Der zeitpunkt " + pickdate1.Text + "zu weit zurückliegend."
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub valdaterange_2_ServerValidate(source As Object, args As ServerValidateEventArgs)
|
||||
|
||||
If Date.ParseExact(pickdate2.Text, "dd.MM.yyyy", provider) > Date.ParseExact(Date.Now.ToShortDateString, "dd.MM.yyyy", provider) Then
|
||||
If Date.Parse(pickdate2.Text) > Date.ParseExact(Date.Now.ToShortDateString, "dd.MM.yyyy", provider) Then
|
||||
lbl_status.Text = "Der Zeitpunkt " + pickdate2.Text + " ist zu weit in der Zukunft."
|
||||
End If
|
||||
End Sub
|
||||
|
||||
BIN
Fehlermeldungen_Auflistung.xlsx
Normal file
BIN
Fehlermeldungen_Auflistung.xlsx
Normal file
Binary file not shown.
@@ -30,7 +30,7 @@
|
||||
void Session_Start(object sender, EventArgs e)
|
||||
{
|
||||
// Code, der ausgeführt wird, wenn eine neue Sitzung gestartet wird
|
||||
|
||||
VERAG_VARIABLES.initerrorcount()
|
||||
}
|
||||
|
||||
void Session_End(object sender, EventArgs e)
|
||||
|
||||
11
Web.config
11
Web.config
@@ -27,7 +27,7 @@
|
||||
<authentication mode="Forms">
|
||||
<forms defaultUrl="/Customers/Welcome.aspx" loginUrl="login/Login_FLEX.aspx" slidingExpiration="true" timeout="2880" />
|
||||
</authentication>
|
||||
<sessionState mode="InProc" timeout="1800" cookieless="false" regenerateExpiredSessionId="false" compressionEnabled="false" useHostingIdentity="true" />
|
||||
<sessionState mode="InProc" timeout="2880" cookieless="false" regenerateExpiredSessionId="false" compressionEnabled="false" useHostingIdentity="true" />
|
||||
<httpRuntime requestValidationMode="2.0" targetFramework="4.7" />
|
||||
<pages validateRequest="false" controlRenderingCompatibilityVersion="4.0" />
|
||||
<!--<securityPolicy>
|
||||
@@ -129,7 +129,14 @@
|
||||
<!--A question mark (?) denies anonymous users-->
|
||||
</authorization>
|
||||
</system.web>
|
||||
</location>
|
||||
</location>
|
||||
<location path="admin">
|
||||
<system.web>
|
||||
<authorization>
|
||||
<allow users="Admin,admin" />
|
||||
</authorization>
|
||||
</system.web>
|
||||
</location>
|
||||
<system.codedom>
|
||||
<compilers>
|
||||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
|
||||
|
||||
@@ -60,7 +60,8 @@ Partial Class login_FLEX
|
||||
If regexuserID.IsValid Then
|
||||
Customer_ID = tb.Text
|
||||
Else
|
||||
regexuserID.ErrorMessage = "Customer-ID has to be a number."
|
||||
VERAG_VARIABLES.seterrorcount(1)
|
||||
regexuserID.ErrorMessage = VERAG_VARIABLES.geterrornumb + ": Customer-ID has to be a number."
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -72,7 +73,8 @@ Partial Class login_FLEX
|
||||
If regexusername_M.IsValid Then
|
||||
Customer_ID = tb_M.Text
|
||||
Else
|
||||
regexusername_M.ErrorMessage = "Username doeas not have any special chaaracters in it."
|
||||
VERAG_VARIABLES.seterrorcount(2)
|
||||
regexusername_M.ErrorMessage = VERAG_VARIABLES.geterrornumb + "Username does not have any special characters in it."
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -84,10 +86,12 @@ Partial Class login_FLEX
|
||||
If regexusername.IsValid Then
|
||||
UserNaMe = tb2.Text
|
||||
Else
|
||||
regexusername_M.ErrorMessage = "Username does not have any special chaaracters in it."
|
||||
VERAG_VARIABLES.seterrorcount(2)
|
||||
regexusername_M.ErrorMessage = VERAG_VARIABLES.geterrornumb + "Username does not have any special characters in it."
|
||||
End If
|
||||
Else
|
||||
reqfieldvaluserName.ErrorMessage = "Username has to be given."
|
||||
VERAG_VARIABLES.seterrorcount(2)
|
||||
reqfieldvaluserName.ErrorMessage = VERAG_VARIABLES.geterrornumb + "Username has to be given."
|
||||
End If
|
||||
End If
|
||||
If String.IsNullOrEmpty(tb2_M.Text) = False AndAlso String.IsNullOrEmpty(tb2.Text) = True Then
|
||||
@@ -99,7 +103,8 @@ Partial Class login_FLEX
|
||||
If regexusername.IsValid Then
|
||||
UserNaMe = tb2_M.Text
|
||||
Else
|
||||
regexusername.ErrorMessage = "Password has to match the criterias of tge info button."
|
||||
VERAG_VARIABLES.seterrorcount(3)
|
||||
regexusername.ErrorMessage = VERAG_VARIABLES.geterrornumb + "Password has to match the criterias of tge info button."
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -119,7 +124,8 @@ Partial Class login_FLEX
|
||||
If reqfieldvalpassw_M.IsValid = True Then
|
||||
passw = tb3_M.Text
|
||||
Else
|
||||
reqfieldvalpassw_M.ErrorMessage = "Please insert your personal passowrd."
|
||||
VERAG_VARIABLES.seterrorcount(4)
|
||||
reqfieldvalpassw_M.ErrorMessage = VERAG_VARIABLES.geterrornumb + "Please insert your personal passowrd."
|
||||
End If
|
||||
End If
|
||||
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
||||
@@ -139,16 +145,19 @@ Partial Class login_FLEX
|
||||
'MsgBox(dr.Item(0).ToString())
|
||||
Select Case dr.Item(0)
|
||||
Case 0
|
||||
Login1.FailureText = "Benuzername und/oder das Passwort stimmen nicht überein."
|
||||
VERAG_VARIABLES.seterrorcount(5)
|
||||
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username and/or Password do not match."
|
||||
Exit Select
|
||||
Case -2
|
||||
Login1.FailureText = "Account ist nicht freigeschaltet."
|
||||
VERAG_VARIABLES.seterrorcount(6)
|
||||
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Account is not activated."
|
||||
Exit Select
|
||||
Case Else
|
||||
If tb.Text = dr("KundenNr") Then
|
||||
Customer_ID = dr("KundenNr").ToString
|
||||
Else
|
||||
Login1.FailureText = "ID cannot be found in the database!"
|
||||
VERAG_VARIABLES.seterrorcount(7)
|
||||
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "ID cannot be found in the database!"
|
||||
End If
|
||||
If tb2.Text = dr("Username") Then
|
||||
UserNaMe = dr("Username").ToString
|
||||
|
||||
Reference in New Issue
Block a user