This commit is contained in:
2022-03-14 17:43:28 +01:00
72 changed files with 3259 additions and 3172 deletions

View File

@@ -198,6 +198,7 @@ Namespace IDB
'End Function
Public Function SetAttributeValue(pConnection As SqlConnection, pTransaction As SqlTransaction, pObjectId As Long, pAttributeName As String, pValue As String, pLanguage As String, pWho As String) As Boolean
Logger.Info("Setting value of Attribute [{0}]", pAttributeName)
Dim oSql = $"
DECLARE @NEW_OBJ_MD_ID BIGINT
EXEC PRIDB_NEW_OBJ_DATA {pObjectId}, '{pAttributeName}', '{pWho}', '{pValue}', '{pLanguage}', 0, @OMD_ID = @NEW_OBJ_MD_ID OUTPUT"

View File

@@ -23,6 +23,8 @@ Namespace Methods.IDB.SetAttributeValue
LogAndThrow("ObjectId does not exist!")
End If
Logger.Debug("Setting value of Attribute [{0}]", pData.AttributeName)
Dim oResult = Helpers.SetAttributeValue(Connection, Transaction,
pData.ObjectId, pData.AttributeName, pData.AttributeValue, pData.Language, pData.Who)
@@ -30,9 +32,19 @@ Namespace Methods.IDB.SetAttributeValue
LogAndThrow("Attribute value could not be set!")
End If
Logger.Debug("Attribute value set!")
' Finally, commit the transaction
Transaction?.Commit()
Return New SetAttributeValueResponse(pData.ObjectId)
Catch ex As Exception
Logger.Warn("Error occurred while setting attribute value!")
Logger.Error(ex)
Logger.Info("Rolling back transaction.")
Transaction?.Rollback()
Return New SetAttributeValueResponse(ex)
End Try
End Function

View File

@@ -14,7 +14,7 @@ Namespace Methods.IDB.SetAttributeValue
<DataMember>
Public Property AttributeValue As String
<DataMember>
Public Property Who As Long
Public Property Who As String
<DataMember>
Public Property Language As String
End Class