This commit is contained in:
2024-02-26 12:42:59 +01:00
22 changed files with 2305 additions and 516 deletions

View File

@@ -32,6 +32,9 @@ Public Class cBonitaetsauskunft
Property ba_datenarchivId As Object = Nothing
Property ba_Geschaeftszweck As Object = Nothing
Property ba_GSName As Object = Nothing
Property ba_UID As String = ""
Property ba_forcedRequest As Boolean = False
Dim SQL As New SQL
@@ -75,6 +78,8 @@ Public Class cBonitaetsauskunft
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ba_datenarchivId", ba_datenarchivId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ba_Geschaeftszweck", ba_Geschaeftszweck))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ba_GSName", ba_GSName))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ba_UID", ba_UID))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ba_forcedRequest", ba_forcedRequest))
Return list
End Function

View File

@@ -50,22 +50,24 @@ Public Class cFeiertage
End Get
End Property
Public Function GetFirstyDayInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer) As DateTime
Public Function GetFirstyDayYInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer, Optional irgnoreDay As Boolean = False) As DateTime
' Create a start date for the 1st day of the month
Dim startDate As DateTime = New DateTime(year, month, 1)
While startDate.DayOfWeek <> day
startDate = startDate.AddDays(1)
End While
If Not irgnoreDay Then
While startDate.DayOfWeek <> day
startDate = startDate.AddDays(1)
End While
End If
Return startDate
End Function
Public Function GetLastyDayInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer) As DateTime
Public Function GetLastyDayYInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer, Optional irgnoreDay As Boolean = False) As DateTime
' Create a start date for the last weekday of the month
Dim startDate As DateTime
@@ -77,9 +79,14 @@ Public Class cFeiertage
startDate = startDate.AddDays(-1)
End If
While (startDate.DayOfWeek <> day)
If irgnoreDay Then
startDate = startDate.AddDays(-1)
End While
Else
While (startDate.DayOfWeek <> day)
startDate = startDate.AddDays(-1)
End While
End If
Return startDate
@@ -268,9 +275,9 @@ Public Class cFeiertage
Case "GB"
If datum = Karfreitag Then Return True
If datum = GetFirstyDayInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Early May Bank Holiday Erster Montag im Mai
If datum = GetLastyDayInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Spring Bank Holiday Letzter Montag im Mai
If datum = GetLastyDayInxMonth(DayOfWeek.Monday, 8, _Year) Then Return True 'Summer Bank Holiday Letzter Montag im August
If datum = GetFirstyDayYInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Early May Bank Holiday Erster Montag im Mai
If datum = GetLastyDayYInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Spring Bank Holiday Letzter Montag im Mai
If datum = GetLastyDayYInxMonth(DayOfWeek.Monday, 8, _Year) Then Return True 'Summer Bank Holiday Letzter Montag im August
Return False
Case Else

View File

@@ -22,6 +22,7 @@ Public Class cMitarbeiter
Property mit_durchwahl As String = ""
Property mit_telefonnr As String = ""
Property mit_email As String = ""
Property mit_emailprivat As String = ""
Property mit_mobiltel As String = ""
Property mit_allowAnruf As Boolean
Property mit_info As String = ""
@@ -202,6 +203,7 @@ Public Class cMitarbeiter
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_Sprachkentnisse", mit_Sprachkentnisse))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_homeoffice", mit_homeoffice))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_timasNichtStempeln", mit_timasNichtStempeln))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_emailprivat", mit_emailprivat))
Return list
@@ -401,6 +403,7 @@ Public Class cMitarbeiter
If Not dr.Item("mit_Sprachkentnisse") Is DBNull.Value Then Me.mit_Sprachkentnisse = dr.Item("mit_Sprachkentnisse")
Me.mit_homeoffice = dr.Item("mit_homeoffice")
Me.mit_timasNichtStempeln = dr.Item("mit_timasNichtStempeln")
If Not dr.Item("mit_emailprivat") Is DBNull.Value Then Me.mit_emailprivat = dr.Item("mit_emailprivat")
Catch ex As Exception

View File

@@ -0,0 +1,146 @@

Imports System.Data.SqlClient
Imports System.Reflection
Public Class cUeberstunden
Property uest_id As Integer
Property uest_maId As Object = Nothing
Property uest_timasId As Object = Nothing
Property uest_100 As Object = Nothing
Property uest_50 As Object = Nothing
Property uest_0 As Object = Nothing
Property uest_date As Date = Nothing
Property uest_created As Object = Nothing
Property uest_lastChanged As Object = Nothing
Property uest_deleted As Boolean
Property uest_systemuser As Object = Nothing
Property uest_maxUE As Object = Nothing
Property uest_ignoreLimit As Boolean
Public hasEntry = False
Dim SQL As New SQL
Sub New(uest_maId, uest_date)
Me.uest_maId = uest_maId
Me.uest_date = uest_date
LOAD()
End Sub
Sub New(uest_maId, uest_date, uest_created)
Me.uest_maId = uest_maId
Me.uest_date = uest_date
Me.uest_created = uest_created
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_id", uest_id,, True, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_maId", uest_maId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_timasId", uest_timasId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_100", uest_100))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_50", uest_50))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_0", uest_0))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_date", uest_date))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_created", uest_created))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_lastChanged", uest_lastChanged))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_deleted", uest_deleted))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_systemuser", uest_systemuser))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_ignoreLimit", uest_ignoreLimit))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_maxUE", uest_maxUE))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblUeberstunden WHERE uest_maId=@uest_maId AND uest_date=@uest_date AND uest_deleted = 0) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "ADMIN", , list)
End Function
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionADMIN()
Using cmd As New SqlCommand("SELECT TOP(1) * FROM tblUeberstunden WHERE uest_maId=@uest_maId AND uest_date=@uest_date AND uest_deleted = 0 order by uest_created desc", conn)
cmd.Parameters.AddWithValue("@uest_maId", uest_maId)
cmd.Parameters.AddWithValue("@uest_date", uest_date)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblUeberstunden] SET " & str & " WHERE uest_maId=@uest_maId AND uest_date=@uest_date AND uest_deleted = 0 ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblUeberstunden (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
End Class