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

@@ -0,0 +1,38 @@
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.EDMI.API.Options
Imports DigitalData.Modules.Logging
Namespace Modules.IDB
Public Class SetAttributeValue
Inherits BaseMethod
Public Sub New(pLogConfig As LogConfig, pChannel As IEDMIServiceChannel)
MyBase.New(pLogConfig, pChannel)
End Sub
Public Async Function RunAsync(pObjectId As String, pAttributeName As String, pAttributeValue As Object, Optional pOptions As SetAttributeValueOptions = Nothing) As Task(Of Boolean)
Try
Dim oParams As New SetAttributeValueRequest With {
.ObjectId = pObjectId,
.Language = pOptions.Language,
.Who = pOptions.Username,
.AttributeName = pAttributeName,
.AttributeValue = pAttributeValue
}
Dim oResponse As SetAttributeValueResponse = Await Channel.SetAttributeValueAsync(oParams)
If oResponse.OK Then
Return True
End If
Logger.Warn("Error while setting Attribute Value: [{0}]", oResponse.ErrorMessage)
Return False
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
End Class
End Namespace