2022-03-25 16:06:00 +01:00

35 lines
1.2 KiB
VB.net

Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.Logging
Namespace Modules.IDB
Public Class CheckInFile
Inherits BaseMethod
Public Sub New(pLogConfig As LogConfig, pChannel As IEDMIServiceChannel)
MyBase.New(pLogConfig, pChannel)
End Sub
Public Async Function RunAsync(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
' Set default options
If pOptions Is Nothing Then
pOptions = New Options.CheckOutInOptions()
End If
Dim oCheckInFileResponse = Await Channel.CheckInOutFileAsync(New CheckInOutFileRequest With {
.User = New UserState With {
.Language = pOptions.Language,
.UserName = pOptions.Username
},
.Action = CheckInOutFileAction.CheckOut,
.ObjectId = pObjectId
})
If oCheckInFileResponse.OK = False Then
Throw New ApplicationException("Could not Import File Contents!")
End If
Return oCheckInFileResponse.ObjectId
End Function
End Class
End Namespace