Handling InsertReceivers und kleinigkeiten frm Main
This commit is contained in:
@@ -152,6 +152,9 @@ Public Class ElementModel
|
||||
pElement.Id = GetElementId(pElement)
|
||||
Return True
|
||||
Else
|
||||
|
||||
Dim filledSql As String = GetFilledSql(oCommand)
|
||||
Logger.Warn(filledSql)
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -161,6 +164,26 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Function GetFilledSql(command As SqlCommand) As String
|
||||
Dim oSql As String = command.CommandText
|
||||
For Each oParam As SqlParameter In command.Parameters
|
||||
Dim oValue As String
|
||||
If oParam.Value Is Nothing OrElse oParam.Value Is DBNull.Value Then
|
||||
oValue = "NULL"
|
||||
ElseIf TypeOf oParam.Value Is String OrElse TypeOf oParam.Value Is Date Then
|
||||
oValue = $"'{oParam.Value.ToString().Replace("'", "''")}'"
|
||||
|
||||
ElseIf TypeOf oParam.Value Is Boolean Then
|
||||
oValue = If(CBool(oParam.Value), "1", "0")
|
||||
Else
|
||||
oValue = oParam.Value.ToString()
|
||||
End If
|
||||
oSql = oSql.Replace("@" & oParam.ParameterName, oValue)
|
||||
Next
|
||||
Return oSql
|
||||
End Function
|
||||
|
||||
|
||||
Public Function Update(pElement As DocumentReceiverElement) As Boolean
|
||||
Try
|
||||
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||
|
||||
Reference in New Issue
Block a user