MDM-Vollmachten, Mahnungen, Fremdwährung, Gesamtsicherheiten

This commit is contained in:
2024-10-10 11:32:28 +02:00
parent 82be7a58d3
commit f9003db09d
15 changed files with 185 additions and 45 deletions

View File

@@ -117,3 +117,93 @@ Public Class cFremdwaehrungskurse
End Class
Public Class cWaehrungskurseNEU
Property fw_id As String
Property fw_iso2 As String
Property fw_iso3 As String
Property fw_land As String
Property fw_kurswert As Double
Dim SQL As New SQL
Sub New()
End Sub
Public 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("fw_id", fw_id))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fw_iso2", fw_iso2))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fw_iso3", fw_iso3))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fw_land", fw_land))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("fw_kurswert", fw_kurswert))
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 tblWahrungtabelleNEU WITH(updlock,serializable) WHERE fw_iso2=@fw_iso2 AND fw_land=@fw_land) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
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 [tblWahrungtabelleNEU] SET " & str & " WHERE fw_iso2=@fw_iso2 AND fw_land=@fw_land")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
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 tblWahrungtabelleNEU (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
End Class