This commit is contained in:
2024-03-01 15:03:39 +01:00
5 changed files with 490 additions and 69 deletions

View File

@@ -17,10 +17,12 @@ Public Class cUeberstunden
Property uest_systemuser As Object = Nothing
Property uest_maxUE As Object = Nothing
Property uest_ignoreLimit As Boolean
Property uest_overwriteValue As Boolean
Property uest_paidout_sum As Object = Nothing
Public hasEntry = False
Dim SQL As New SQL
Dim SQL As New SQL
@@ -37,7 +39,7 @@ Public Class cUeberstunden
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New 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))
@@ -51,14 +53,16 @@ Public Class cUeberstunden
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))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_overwriteValue", uest_overwriteValue))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_paidout_sum", uest_paidout_sum))
Return list
End Function
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
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 " &
@@ -69,9 +73,9 @@ Public Class cUeberstunden
Return SQL.doSQLVarList(sqlstr, "ADMIN", , list)
End Function
Public Sub LOAD()
Try
hasEntry = False
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)
@@ -94,31 +98,31 @@ Public Class cUeberstunden
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
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getUpdateCmd() As String
Try
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. ','
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
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Public Function getInsertCmd() As String