EDMIService: clean up
This commit is contained in:
@@ -7,7 +7,7 @@ Imports System.ServiceModel
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.ServiceModel.Description
|
||||
Imports DigitalData.Services.EDMIService.Messages
|
||||
Imports DigitalData.Services.EDMIService.Rights
|
||||
Imports DigitalData.Modules.EDMI.API.Rights
|
||||
|
||||
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
|
||||
Public Class EDMIService
|
||||
@@ -219,7 +219,7 @@ Public Class EDMIService
|
||||
''' Imports a file according to ObjectStoreId
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function ImportFile(Data As Messages.DocumentImportRequest) As Messages.DocumentImportResponse Implements IEDMIService.ImportFile
|
||||
Public Function ImportFile(Data As DocumentImportRequest) As DocumentImportResponse Implements IEDMIService.ImportFile
|
||||
Dim oObjectStore = GlobalState.ObjectStores.
|
||||
Where(Function(s) s.Id = Data.ObjectStoreId).
|
||||
FirstOrDefault()
|
||||
@@ -276,7 +276,7 @@ Public Class EDMIService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse Implements IEDMIService.GetFileByObjectId
|
||||
Public Function GetFileByObjectId(Data As DocumentStreamRequest) As DocumentStreamResponse Implements IEDMIService.GetFileByObjectId
|
||||
Try
|
||||
Dim oSQL As String = $"SELECT ObjectStoreId FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}"
|
||||
Dim oObjectStoreId = MSSQL_IDB.GetScalarValue(oSQL)
|
||||
@@ -288,7 +288,6 @@ Public Class EDMIService
|
||||
Dim oSQL2 As String = $"SELECT DocRelativePath FROM VWIDB_DOC_DATA WHERE IDB_OBJ_ID = {Data.ObjectId}"
|
||||
Dim oPath As String = MSSQL_IDB.GetScalarValue(oSQL2)
|
||||
|
||||
|
||||
If IsNothing(oPath) Then
|
||||
Throw New FaultException($"Object [{Data.ObjectId}] does not exist in database!")
|
||||
End If
|
||||
@@ -325,13 +324,13 @@ Public Class EDMIService
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListFilesForUser() As Messages.DocumentListResponse Implements IEDMIService.ListFilesForUser
|
||||
Public Function ListFilesForUser() As DocumentListResponse Implements IEDMIService.ListFilesForUser
|
||||
Try
|
||||
Dim oSQL = $"SELECT * FROM VWIDB_DOC_DATA"
|
||||
Dim oDatatable As DataTable = MSSQL_IDB.GetDatatable(oSQL)
|
||||
oDatatable.TableName = "DocumentList"
|
||||
|
||||
Return New Messages.DocumentListResponse() With {
|
||||
Return New DocumentListResponse() With {
|
||||
.Datatable = oDatatable
|
||||
}
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user