Zooflow: WIP

This commit is contained in:
Jonathan Jenne
2021-12-01 16:22:51 +01:00
parent 8a76425c94
commit 77621193f2
45 changed files with 768 additions and 270 deletions

View File

@@ -0,0 +1,41 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Database
Imports DigitalData.Services.EDMIService.IDB
Imports System.Data.SqlClient
Namespace Methods.SetAttributeValue
Public Class SetAttributeValueMethod
Inherits BaseMethod
Private Connection As SqlConnection
Private Transaction As SqlTransaction
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
MyBase.New(pLogConfig, pDatabase)
Connection = Database.GetConnection()
Transaction = Connection.BeginTransaction()
End Sub
Public Function Run(pData As SetAttributeValueRequest) As SetAttributeValueResponse
Try
If Helpers.TestObjectIdExists(pData.ObjectId) = False Then
LogAndThrow("ObjectId does not exist!")
End If
Dim oResult = Helpers.SetAttributeValue(Connection, Transaction,
pData.ObjectId, pData.AttributeName, pData.AttributeValue, pData.Language, pData.Who)
If oResult = False Then
LogAndThrow("Attribute value could not be set!")
End If
Return New SetAttributeValueResponse(pData.ObjectId)
Catch ex As Exception
Logger.Warn("Error occurred while setting attribute value!")
Return New SetAttributeValueResponse(ex)
End Try
End Function
End Class
End Namespace