Zooflow: CheckInOut

This commit is contained in:
Jonathan Jenne
2022-03-28 16:42:47 +02:00
parent c833f486ac
commit ea8b4242ae
20 changed files with 696 additions and 98 deletions

View File

@@ -0,0 +1,49 @@
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.Logging
Namespace DocumentResultList
Public Class CheckInOut
Inherits BaseClass
Private Client As Client
Public Sub New(pLogConfig As LogConfig, pClient As Client)
MyBase.New(pLogConfig)
Client = pClient
End Sub
Public Async Function GetCheckoutState(pObjectId As Long) As Task(Of CheckoutState)
Try
Dim oSQL = $"SELECT * FROM VWOBJECT_CHECKED_OUT WHERE IDB_OBJ_ID = {pObjectId}"
Dim oResponse = Await Client.GetDatatableFromIDBAsync(oSQL)
If oResponse.ok = False Then
Return Nothing
End If
If oResponse.Table.Rows.Count = 0 Then
Return New CheckoutState()
End If
Dim oRow = oResponse.Table.Rows.Item(0)
Dim oState As New CheckoutState With {
.IsCheckedOut = True,
.CheckedOutWhen = oRow.Item("CHECKED_OUT_WHEN"),
.CheckedOutWho = oRow.Item("EMAIL")
}
Return oState
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Public Class CheckoutState
Public Property IsCheckedOut As Boolean = False
Public Property CheckedOutWhen As Date = Nothing
Public Property CheckedOutWho As String = Nothing
End Class
End Class
End Namespace