EDMI: Add Testing to EDMIBenchmark, Add ListFiles to EDMIService

This commit is contained in:
Jonathan Jenne
2020-04-16 13:38:01 +02:00
parent 6ee7bd07a3
commit 9095c0cd07
16 changed files with 697 additions and 116 deletions

View File

@@ -30,12 +30,24 @@ Public Class EDMIService
Public Sub New()
Dim oOperationContext As OperationContext = OperationContext.Current
Dim oInstanceContext As InstanceContext = oOperationContext.InstanceContext
Dim oUsername = oOperationContext.ServiceSecurityContext.WindowsIdentity.Name
Dim oUsername = StripDomainFromUsername(oOperationContext.ServiceSecurityContext.WindowsIdentity.Name)
_username = oUsername
_logger = LogConfig.GetLogger()
_logger.Debug("New Request by User [{0}]", _username)
End Sub
Public Function StripDomainFromUsername(UserName As String)
If UserName.Contains("\") Then
Return UserName.Split("\")(1)
ElseIf UserName.Contains("@") Then
Return UserName.Split("@")(0)
Else
Return UserName
End If
End Function
#Region "Auth"
Private Function TestUserAuth() As Boolean
Try
@@ -391,6 +403,21 @@ Public Class EDMIService
End Try
End Function
Public Function ListFilesForUser() As Messages.DocumentListResponse Implements IEDMIService.ListFilesForUser
Try
Dim oSQL = $"SELECT * FROM VWIDB_DOC_DATA WHERE ADDED_WHO = UPPER('{_username}')"
Dim oDatatable As DataTable = MSSQL.GetDatatable(oSQL)
oDatatable.TableName = "DocumentList"
Return New Messages.DocumentListResponse() With {
.Datatable = oDatatable
}
Catch ex As Exception
_logger.Error(ex)
Throw New FaultException(ex.Message)
End Try
End Function
#End Region
#Region "Index"