EDMI: Update Service, Add TestObjectIdExists, Work on GetVariableValue

This commit is contained in:
Jonathan Jenne
2021-07-05 16:31:22 +02:00
parent bd6fa93a45
commit 3ef80383ea
12 changed files with 405 additions and 238 deletions

View File

@@ -469,6 +469,32 @@ Public Class EDMIService
End Try
End Function
Public Function TestObjectIdExists(Data As TestObjectIdExistsRequest) As TestObjectIdExistsResponse Implements IEDMIService.TestObjectIdExists
Try
Dim oSQL As String = $"SELECT IDB_OBJ_ID, ACTIVE, DELETED FROM TBIDB_OBJECT WHERE IDB_OBJ_ID = {Data.ObjectId}"
Dim oTable As DataTable = MSSQL_IDB.GetDatatable(oSQL)
If IsNothing(oTable) OrElse oTable.Rows.Count = 0 Then
_Logger.Warn("ObjectId {0} does not exist")
Return New TestObjectIdExistsResponse(False)
End If
Dim oRow As DataRow = oTable.Rows.Item(0)
Dim oActive = Utils.NotNull(oRow.Item("ACTIVE"), False)
Dim oDeleted = Utils.NotNull(oRow.Item("DELETED"), False)
Return New TestObjectIdExistsResponse(True) With {
.Deleted = oDeleted,
.Inactive = Not oActive
}
Catch ex As Exception
_Logger.Error(ex)
Return New TestObjectIdExistsResponse(False)
End Try
End Function
Public Function NewFileObject(Data As NewFileObjectRequest) As NewFileObjectResponse Implements IEDMIService.NewFileObject
Try
Dim oStoreType As String = Data.StoreType

View File

@@ -131,6 +131,28 @@ Namespace Messages
End Class
#End Region
#Region "Helpers"
<MessageContract>
Public Class TestObjectIdExistsRequest
<MessageBodyMember>
Public ObjectId As Long
End Class
<MessageContract>
Public Class TestObjectIdExistsResponse
Public Sub New(pExists As Boolean)
Exists = pExists
End Sub
<MessageBodyMember>
Public Exists As Boolean = False
<MessageBodyMember>
Public Inactive As Boolean = False
<MessageBodyMember>
Public Deleted As Boolean = False
End Class
#End Region
End Namespace

View File

@@ -92,4 +92,10 @@ Interface IEDMIService
Function ImportFileIntoFileObject(Data As ImportFileIntoFileObjectRequest) As ImportFileIntoFileObjectResponse
#End Region
#Region "Helpers"
<OperationContract>
<FaultContract(GetType(UnexpectedErrorFault))>
Function TestObjectIdExists(Data As TestObjectIdExistsRequest) As TestObjectIdExistsResponse
#End Region
End Interface

View File

@@ -38,7 +38,7 @@ Public Class WindowsService
Try
Dim oServicePath As String = AppDomain.CurrentDomain.BaseDirectory
_LogConfig = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"))
_LogConfig = New LogConfig(LogConfig.PathType.CustomPath, IO.Path.Combine(oServicePath, "Log"), Nothing, Nothing, Nothing, 3)
_Logger = _LogConfig.GetLogger()
Try