Common: ObjectPropertyDialog
This commit is contained in:
38
Modules.EDMIAPI/Modules/IDB/SetAttributeValue.vb
Normal file
38
Modules.EDMIAPI/Modules/IDB/SetAttributeValue.vb
Normal 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
|
||||
Reference in New Issue
Block a user