EDMI: Add CheckInOutFile Method
This commit is contained in:
34
Modules.EDMIAPI/Modules/IDB/CheckInFile.vb
Normal file
34
Modules.EDMIAPI/Modules/IDB/CheckInFile.vb
Normal file
@@ -0,0 +1,34 @@
|
||||
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
|
||||
36
Modules.EDMIAPI/Modules/IDB/CheckOutFile.vb
Normal file
36
Modules.EDMIAPI/Modules/IDB/CheckOutFile.vb
Normal file
@@ -0,0 +1,36 @@
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Namespace Modules.IDB
|
||||
Public Class CheckOutFile
|
||||
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 pComment As String = "", 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 oCheckOutFileResponse = Await Channel.CheckInOutFileAsync(New CheckInOutFileRequest With {
|
||||
.User = New UserState With {
|
||||
.Language = pOptions.Language,
|
||||
.UserName = pOptions.Username
|
||||
},
|
||||
.Action = CheckInOutFileAction.CheckOut,
|
||||
.Comment = pComment,
|
||||
.ObjectId = pObjectId
|
||||
})
|
||||
|
||||
If oCheckOutFileResponse.OK = False Then
|
||||
Throw New ApplicationException("Could not Import File Contents!")
|
||||
End If
|
||||
|
||||
Return oCheckOutFileResponse.ObjectId
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user