This commit is contained in:
SchreiberM 2020-12-22 14:12:16 +01:00
parent 1e3f508b1f
commit 96f5570a78
3 changed files with 50 additions and 3 deletions

View File

@ -53,6 +53,10 @@
<Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DigitalData.Modules.EDMI.API, Version=0.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Modules.EDMIAPI\bin\Debug\DigitalData.Modules.EDMI.API.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.7.5\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.5\lib\net45\NLog.dll</HintPath>
@ -153,6 +157,10 @@
<Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project> <Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project>
<Name>Database</Name> <Name>Database</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Modules.EDMIAPI\EDMI.API.vbproj">
<Project>{25017513-0d97-49d3-98d7-ba76d9b251b0}</Project>
<Name>EDMI.API</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Language\Language.vbproj"> <ProjectReference Include="..\Modules.Language\Language.vbproj">
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project> <Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
<Name>Language</Name> <Name>Language</Name>

View File

@ -2,12 +2,15 @@
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.Patterns Imports DigitalData.Modules.Patterns
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Public Class ProfileSearches Public Class ProfileSearches
Private _LogConfig As LogConfig Private _LogConfig As LogConfig
Private _Logger As Logger Private _Logger As Logger
Private _Environment As Environment Private _Environment As Environment
Private _Params As ClipboardWatcherParams Private _Params As ClipboardWatcherParams
Private _Client As Client
Public Class Search Public Class Search
Public Guid As Integer Public Guid As Integer
@ -23,6 +26,28 @@ Public Class ProfileSearches
_Logger = LogConfig.GetLogger() _Logger = LogConfig.GetLogger()
_Environment = Environment _Environment = Environment
_Params = Params _Params = Params
Try
If _Environment.Service.IsActive = True Then
Try
Dim oSplit() As String = _Environment.Service.Address.Split(";")
Dim oAppServerAddress As String = oSplit(0)
Dim oAppServerPort As Integer = 9000
If oSplit.Length = 2 Then
oAppServerPort = oSplit(1)
End If
_Client = New Client(LogConfig, oAppServerAddress, oAppServerPort)
If Not IsNothing(_Client) Then
If _Client.Connect() Then
End If
End If
Catch ex As Exception
_Logger.Warn($"Could not initialize the AppServer: {ex.Message}")
End Try
End If
Catch ex As Exception
End Try
End Sub End Sub
Public Async Function LoadDocumentSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search)) Public Async Function LoadDocumentSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search))
@ -33,7 +58,15 @@ Public Class ProfileSearches
Private Function DoLoadDocumentSearches(ProfileId As Integer) As List(Of Search) Private Function DoLoadDocumentSearches(ProfileId As Integer) As List(Of Search)
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX" Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX"
Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL) Dim oSearchesDataTable As DataTable
Dim o = _Environment.Service.Address
If _Environment.Service.IsActive = True Then
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DOC_SEARCH", $"PROFILE_ID = {ProfileId}", "TAB_INDEX")
oSearchesDataTable = oTableResult.Table
Else
oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
End If
Dim oDocSearches As New List(Of Search) Dim oDocSearches As New List(Of Search)
Dim oCounter As Integer = 0 Dim oCounter As Integer = 0
Dim oPatterns As New ClassPatterns(_LogConfig) Dim oPatterns As New ClassPatterns(_LogConfig)
@ -83,7 +116,13 @@ Public Class ProfileSearches
Try Try
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX" Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX"
Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL) Dim oSearchesDataTable As DataTable
If _Environment.Service.IsActive = True Then
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DATA_SEARCH", $"PROFILE_ID = {ProfileId}", "TAB_INDEX")
oSearchesDataTable = oTableResult.Table
Else
oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
End If
Dim oCounter As Integer = 0 Dim oCounter As Integer = 0
Dim oPatterns As New ClassPatterns(_LogConfig) Dim oPatterns As New ClassPatterns(_LogConfig)

View File

@ -60,7 +60,7 @@ Public Class frmDocumentResultList
Private Sub InitIDB() Private Sub InitIDB()
_IsLegacy = Not _Environment.Service.IsActive _IsLegacy = Not _Environment.Service.IsActive
If _Environment.Service.IsActive Then If _Environment.Service.IsActive Then
Dim oSplit As List(Of String) = _Environment.Service.Address.Split(":").ToList() Dim oSplit As List(Of String) = _Environment.Service.Address.Split(";").ToList()
Dim oAddress As String = oSplit.Item(0) Dim oAddress As String = oSplit.Item(0)
Dim oPort As Integer = oSplit.Item(1) Dim oPort As Integer = oSplit.Item(1)