Common: ObjectPropertyDialog

This commit is contained in:
Jonathan Jenne
2022-03-11 15:46:59 +01:00
parent a6de7e0af2
commit 7f9fd6ee58
36 changed files with 785 additions and 326 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