Merge branch 'master' of http://dd-vmp07-com04:3000/AppStd/Monorepo
This commit is contained in:
commit
673aa6bf95
@ -92,8 +92,8 @@
|
|||||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.29728.190
|
VisualStudioVersion = 17.4.33103.184
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GUIs", "GUIs", "{8FFE925E-8B84-45F1-93CB-32B1C96F41EB}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GUIs", "GUIs", "{8FFE925E-8B84-45F1-93CB-32B1C96F41EB}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@ -90,8 +90,8 @@
|
|||||||
<HintPath>..\..\DDModules\ZooFlow\bin\Debug\DigitalData.Modules.ZooFlow.dll</HintPath>
|
<HintPath>..\..\DDModules\ZooFlow\bin\Debug\DigitalData.Modules.ZooFlow.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -12,8 +12,8 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("")>
|
<Assembly: AssemblyDescription("")>
|
||||||
<Assembly: AssemblyCompany("")>
|
<Assembly: AssemblyCompany("")>
|
||||||
<Assembly: AssemblyProduct("ClipboardWatcher")>
|
<Assembly: AssemblyProduct("ClipboardWatcher")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2021")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("1.5.1.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.5.0.0")>
|
<Assembly: AssemblyVersion("1.5.1.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.5.0.0")>
|
<Assembly: AssemblyFileVersion("1.5.1.0")>
|
||||||
|
|||||||
@ -12,10 +12,10 @@ Imports DigitalData.Modules.ZooFlow.Params
|
|||||||
Public Class ProfileSearches
|
Public Class ProfileSearches
|
||||||
Inherits BaseClass
|
Inherits BaseClass
|
||||||
|
|
||||||
Private _Environment As Environment
|
Private ReadOnly _Environment As Environment
|
||||||
Private _Client As Client
|
Private ReadOnly _Client As Client
|
||||||
|
Private ReadOnly _ClipboardContents As String
|
||||||
Private _ClipboardContents As String
|
Private ReadOnly _ClientIsOnline As Boolean = False
|
||||||
|
|
||||||
Public Class Search
|
Public Class Search
|
||||||
Public Guid As Integer
|
Public Guid As Integer
|
||||||
@ -31,8 +31,10 @@ Public Class ProfileSearches
|
|||||||
|
|
||||||
_Environment = pEnvironment
|
_Environment = pEnvironment
|
||||||
_ClipboardContents = pClipboardContents
|
_ClipboardContents = pClipboardContents
|
||||||
|
_ClientIsOnline = _Environment.Service.Client IsNot Nothing AndAlso _Environment.Service.Client.IsOnline = True
|
||||||
|
|
||||||
Try
|
Try
|
||||||
If _Environment.Service.Client.IsOnline = True Then
|
If _ClientIsOnline Then
|
||||||
Try
|
Try
|
||||||
Dim oSplit() As String = _Environment.Service.Address.Split(":")
|
Dim oSplit() As String = _Environment.Service.Address.Split(":")
|
||||||
Dim oAppServerAddress As String = oSplit(0)
|
Dim oAppServerAddress As String = oSplit(0)
|
||||||
@ -50,6 +52,8 @@ Public Class ProfileSearches
|
|||||||
Logger.Warn($"Could not initialize the AppServer: {ex.Message}")
|
Logger.Warn($"Could not initialize the AppServer: {ex.Message}")
|
||||||
Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
|
Else
|
||||||
|
Logger.Debug("No client found in Env.")
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
@ -82,15 +86,14 @@ Public Class ProfileSearches
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
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))
|
||||||
Return Await Task.Run(Function()
|
Return Await Task.Run(Function() DoLoadDocumentSearches(ProfileId))
|
||||||
Return DoLoadDocumentSearches(ProfileId)
|
|
||||||
End Function)
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
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 As DataTable
|
Dim oSearchesDataTable As DataTable
|
||||||
If _Environment.Service.Client.IsOnline = True Then
|
|
||||||
|
If _ClientIsOnline Then
|
||||||
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DOC_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX")
|
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DOC_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX")
|
||||||
oSearchesDataTable = oTableResult.Table
|
oSearchesDataTable = oTableResult.Table
|
||||||
If oSearchesDataTable Is Nothing Then
|
If oSearchesDataTable Is Nothing Then
|
||||||
@ -100,6 +103,7 @@ Public Class ProfileSearches
|
|||||||
Else
|
Else
|
||||||
oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
|
oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oDocSearches As New List(Of Search)
|
Dim oDocSearches As New List(Of Search)
|
||||||
If Not IsNothing(oSearchesDataTable) Then
|
If Not IsNothing(oSearchesDataTable) Then
|
||||||
Dim oCounter As Integer = 0
|
Dim oCounter As Integer = 0
|
||||||
@ -146,9 +150,7 @@ Public Class ProfileSearches
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Async Function LoadDataSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search))
|
Public Async Function LoadDataSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search))
|
||||||
Return Await Task.Run(Function()
|
Return Await Task.Run(Function() DoLoadDataSearches(ProfileId))
|
||||||
Return DoLoadDataSearches(ProfileId)
|
|
||||||
End Function)
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function DoLoadDataSearches(ProfileId As Integer) As List(Of Search)
|
Private Function DoLoadDataSearches(ProfileId As Integer) As List(Of Search)
|
||||||
@ -157,7 +159,7 @@ 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 As DataTable
|
Dim oSearchesDataTable As DataTable
|
||||||
If _Environment.Service.Client.IsOnline = True Then
|
If _ClientIsOnline Then
|
||||||
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DATA_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX")
|
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DATA_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX")
|
||||||
oSearchesDataTable = oTableResult.Table
|
oSearchesDataTable = oTableResult.Table
|
||||||
If oSearchesDataTable Is Nothing Then
|
If oSearchesDataTable Is Nothing Then
|
||||||
|
|||||||
@ -51,6 +51,10 @@
|
|||||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -98,8 +98,8 @@
|
|||||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|||||||
@ -55,6 +55,8 @@ Public Class frmDocumentResultList
|
|||||||
Private Property ResultLists As List(Of DocumentResult)
|
Private Property ResultLists As List(Of DocumentResult)
|
||||||
|
|
||||||
Private IsLoading As Boolean = True
|
Private IsLoading As Boolean = True
|
||||||
|
Private ClientIsOnline As Boolean = False
|
||||||
|
|
||||||
Private _DragBoxFromMouseDown As Rectangle
|
Private _DragBoxFromMouseDown As Rectangle
|
||||||
Private _ScreenOffset As Point
|
Private _ScreenOffset As Point
|
||||||
Private _CurrentDocument As DocumentResultList.Document = Nothing
|
Private _CurrentDocument As DocumentResultList.Document = Nothing
|
||||||
@ -125,17 +127,28 @@ Public Class frmDocumentResultList
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetOperationMode() As OperationMode
|
Private Function GetOperationMode() As OperationMode
|
||||||
Dim oOperationMode As OperationMode
|
Dim oOperationMode As OperationMode = OperationMode.NoAppServer
|
||||||
|
|
||||||
If Environment.Service IsNot Nothing AndAlso Environment.Service.Client.IsOnline AndAlso Environment.Service.Address <> String.Empty Then
|
Try
|
||||||
oOperationMode = OperationMode.WithAppServer
|
If Environment.Service.Client IsNot Nothing AndAlso Environment.Service.Client.IsOnline Then
|
||||||
Else
|
oOperationMode = OperationMode.WithAppServer
|
||||||
oOperationMode = OperationMode.NoAppServer
|
Else
|
||||||
End If
|
oOperationMode = OperationMode.NoAppServer
|
||||||
|
End If
|
||||||
|
|
||||||
If Params.OperationModeOverride <> OperationMode.None Then
|
Logger.Debug("OperationMode set to [{0}]", oOperationMode)
|
||||||
oOperationMode = Params.OperationModeOverride
|
|
||||||
End If
|
If Params.OperationModeOverride <> OperationMode.None Then
|
||||||
|
Logger.Debug("Overriding OperationMode with [{0}]", Params.OperationModeOverride)
|
||||||
|
oOperationMode = Params.OperationModeOverride
|
||||||
|
End If
|
||||||
|
|
||||||
|
Logger.Debug("OperationMode is now [{0}]", oOperationMode)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Logger.Warn("Error while determining OperationMode. Setting to [{0}]", oOperationMode)
|
||||||
|
End Try
|
||||||
|
|
||||||
Return oOperationMode
|
Return oOperationMode
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyCompany("")>
|
<Assembly: AssemblyCompany("")>
|
||||||
<Assembly: AssemblyProduct("Common")>
|
<Assembly: AssemblyProduct("Common")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("2.4.1.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.0.0")>
|
<Assembly: AssemblyVersion("2.4.1.0")>
|
||||||
<Assembly: AssemblyFileVersion("2.4.0.0")>
|
<Assembly: AssemblyFileVersion("2.4.1.0")>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -62,8 +62,8 @@
|
|||||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -105,11 +105,11 @@
|
|||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Quartz, Version=3.3.2.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
<Reference Include="Quartz, Version=3.5.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Quartz.3.3.2\lib\net472\Quartz.dll</HintPath>
|
<HintPath>..\packages\Quartz.3.5.0\lib\net472\Quartz.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net461" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net461" />
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net472" />
|
<package id="NLog" version="5.0.5" targetFramework="net472" />
|
||||||
<package id="Quartz" version="3.3.2" targetFramework="net472" />
|
<package id="Quartz" version="3.5.0" targetFramework="net472" />
|
||||||
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
|
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
|
||||||
<package id="System.Diagnostics.DiagnosticSource" version="4.7.1" targetFramework="net461" />
|
<package id="System.Diagnostics.DiagnosticSource" version="4.7.1" targetFramework="net461" />
|
||||||
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
|
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
|
||||||
|
|||||||
@ -33,6 +33,6 @@
|
|||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -7,14 +7,14 @@ Public MustInherit Class BaseMethod
|
|||||||
|
|
||||||
Friend ReadOnly DatabaseIDB As MSSQLServer
|
Friend ReadOnly DatabaseIDB As MSSQLServer
|
||||||
Friend ReadOnly DatabaseECM As MSSQLServer
|
Friend ReadOnly DatabaseECM As MSSQLServer
|
||||||
Friend ReadOnly Helpers As Helpers
|
Friend ReadOnly Helpers As IDB.Helpers
|
||||||
Friend ReadOnly GlobalState As GlobalState
|
Friend ReadOnly GlobalState As GlobalState
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState)
|
Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState)
|
||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
DatabaseIDB = pDatabaseIDB
|
DatabaseIDB = pDatabaseIDB
|
||||||
DatabaseECM = pDatabaseECM
|
DatabaseECM = pDatabaseECM
|
||||||
Helpers = New Helpers(pLogConfig, pDatabaseIDB)
|
Helpers = New IDB.Helpers(pLogConfig, pDatabaseIDB)
|
||||||
GlobalState = pGlobalState
|
GlobalState = pGlobalState
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<AssemblyName>EDMIService</AssemblyName>
|
<AssemblyName>EDMIService</AssemblyName>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<MyType>Console</MyType>
|
<MyType>Console</MyType>
|
||||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
@ -100,11 +100,11 @@
|
|||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Quartz, Version=3.3.2.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
<Reference Include="Quartz, Version=3.5.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Quartz.3.3.2\lib\net472\Quartz.dll</HintPath>
|
<HintPath>..\packages\Quartz.3.5.0\lib\net462\Quartz.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
@ -235,6 +235,7 @@
|
|||||||
<Compile Include="My Project\Application.Designer.vb">
|
<Compile Include="My Project\Application.Designer.vb">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Application.myapp</DependentUpon>
|
<DependentUpon>Application.myapp</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="My Project\Resources.Designer.vb">
|
<Compile Include="My Project\Resources.Designer.vb">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
|
|||||||
@ -22,7 +22,7 @@ Namespace My.Resources
|
|||||||
'''<summary>
|
'''<summary>
|
||||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
|
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||||
|
|||||||
@ -15,7 +15,7 @@ Option Explicit On
|
|||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0"), _
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
|
||||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Partial Friend NotInheritable Class MySettings
|
Partial Friend NotInheritable Class MySettings
|
||||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net472" />
|
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net472" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net472" />
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net472" />
|
<package id="NLog" version="5.0.5" targetFramework="net472" />
|
||||||
<package id="Quartz" version="3.3.2" targetFramework="net472" />
|
<package id="Quartz" version="3.5.0" targetFramework="net462" />
|
||||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
<package id="System.Diagnostics.DiagnosticSource" version="4.7.1" targetFramework="net472" />
|
<package id="System.Diagnostics.DiagnosticSource" version="4.7.1" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
||||||
|
|||||||
@ -1,50 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<section name="DigitalData.Services.JobRunner.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
|
||||||
</sectionGroup>
|
|
||||||
</configSections>
|
</configSections>
|
||||||
<applicationSettings>
|
|
||||||
<DigitalData.Services.JobRunner.My.MySettings>
|
|
||||||
<setting name="LOG_PATH" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="SQL_CONNECTIONSTRING" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="FIREBIRD_SERVER" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="FIREBIRD_DATABASE" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="FIREBIRD_USER" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="FIREBIRD_PASSWORD" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="LOG_DEBUG" serializeAs="String">
|
|
||||||
<value>False</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="ADSYNC_CONFIG" serializeAs="String">
|
|
||||||
<value>False|0 0 0/1 * * ?|RootPath::LDAP://DIGITALDATA,UserFilter::(&(samaccountname=@SAMACCOUNTNAME)),GroupFilter::(&(samaccountname=*))</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="TEST_CONFIG" serializeAs="String">
|
|
||||||
<value>False|10/0 * * * * ?|Foo::Bar</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="GRAPHQL_CONFIG" serializeAs="String">
|
|
||||||
<value>False|0 0 0/1 * * ?|QueryConfigFolder::E:\JenneJ\GraphQL</value>
|
|
||||||
</setting>
|
|
||||||
</DigitalData.Services.JobRunner.My.MySettings>
|
|
||||||
</applicationSettings>
|
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral"/>
|
||||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0"/>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
|
||||||
|
|||||||
25
Service.JobRunner/Config.vb
Normal file
25
Service.JobRunner/Config.vb
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Imports DigitalData.Modules.Jobs
|
||||||
|
|
||||||
|
Public Class Config
|
||||||
|
Public Property Debug As Boolean = False
|
||||||
|
|
||||||
|
Public Property SQLConnectionString As String = ""
|
||||||
|
|
||||||
|
Public Property Firebird As New FirebirdConfig
|
||||||
|
Public Property Jobs As New List(Of JobConfig)
|
||||||
|
|
||||||
|
'Public Enum JobType
|
||||||
|
' ADSync
|
||||||
|
' GraphQL
|
||||||
|
' Test
|
||||||
|
'End Enum
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Class FirebirdConfig
|
||||||
|
Public Property DataSource As String = "172.24.12.41"
|
||||||
|
Public Property Database As String = "172.24.12.41:E:\DB\Firebird\Databases\EDMI_TEMPLATE\EDMI_MASTER.FDB"
|
||||||
|
Public Property User As String = "sysdba"
|
||||||
|
Public Property Password As String = "dd"
|
||||||
|
End Class
|
||||||
|
End Class
|
||||||
@ -1,44 +1,29 @@
|
|||||||
Imports System.Collections.Specialized
|
Imports System.Collections.Specialized
|
||||||
|
Imports DigitalData.Modules.Config
|
||||||
Imports DigitalData.Modules.Database
|
Imports DigitalData.Modules.Database
|
||||||
Imports DigitalData.Modules.Jobs
|
Imports DigitalData.Modules.Jobs
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
Imports DigitalData.Services.JobRunner.Config
|
||||||
Imports Quartz
|
Imports Quartz
|
||||||
Imports Quartz.Impl
|
Imports Quartz.Impl
|
||||||
Imports Quartz.Logging
|
Imports Quartz.Logging
|
||||||
|
|
||||||
Public Class JobRunner
|
Public Class JobRunner
|
||||||
Private _LogConfig As LogConfig
|
Private ReadOnly _LogConfig As LogConfig
|
||||||
Private _Logger As DigitalData.Modules.Logging.Logger
|
Private ReadOnly _Logger As DigitalData.Modules.Logging.Logger
|
||||||
Private _firebird As Firebird
|
Private ReadOnly _firebird As Firebird
|
||||||
Private _mssql As MSSQLServer
|
Private ReadOnly _mssql As MSSQLServer
|
||||||
|
Private ReadOnly _config As Config
|
||||||
|
|
||||||
Private _Props As New NameValueCollection From {
|
|
||||||
{"quartz.serializer.type", "binary"},
|
|
||||||
{"quartz.threadPool.threadCount", 10}
|
|
||||||
}
|
|
||||||
Private _factory As StdSchedulerFactory
|
Private _factory As StdSchedulerFactory
|
||||||
Private _scheduler As IScheduler
|
Private _scheduler As IScheduler
|
||||||
|
|
||||||
Public Sub New(LogConfig As LogConfig, MSSQL As MSSQLServer, Firebird As Firebird)
|
Public Sub New(pLogConfig As LogConfig, pConfig As Config, pMSSQL As MSSQLServer, pFirebird As Firebird)
|
||||||
_LogConfig = LogConfig
|
_LogConfig = pLogConfig
|
||||||
_Logger = LogConfig.GetLogger()
|
_Logger = pLogConfig.GetLogger()
|
||||||
_firebird = Firebird
|
_firebird = pFirebird
|
||||||
_mssql = MSSQL
|
_mssql = pMSSQL
|
||||||
Try
|
_config = pConfig
|
||||||
Dim directory As New IO.DirectoryInfo(_LogConfig.LogDirectory)
|
|
||||||
|
|
||||||
For Each file As IO.FileInfo In directory.GetFiles
|
|
||||||
If (Now - file.CreationTime).Days > 29 Then
|
|
||||||
file.Delete()
|
|
||||||
Else
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Next
|
|
||||||
Catch ex As Exception
|
|
||||||
|
|
||||||
End Try
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Async Sub Start()
|
Public Async Sub Start()
|
||||||
@ -48,7 +33,8 @@ Public Class JobRunner
|
|||||||
_Logger.Info("Starting JobRunner")
|
_Logger.Info("Starting JobRunner")
|
||||||
|
|
||||||
Dim oProps As New NameValueCollection From {
|
Dim oProps As New NameValueCollection From {
|
||||||
{"quartz.serializer.type", "binary"}
|
{"quartz.serializer.type", "binary"},
|
||||||
|
{"quartz.threadPool.threadCount", 10}
|
||||||
}
|
}
|
||||||
_factory = New StdSchedulerFactory(oProps)
|
_factory = New StdSchedulerFactory(oProps)
|
||||||
_scheduler = Await _factory.GetScheduler()
|
_scheduler = Await _factory.GetScheduler()
|
||||||
@ -57,26 +43,30 @@ Public Class JobRunner
|
|||||||
Await _scheduler.Start()
|
Await _scheduler.Start()
|
||||||
|
|
||||||
' [START] Job Scheduling
|
' [START] Job Scheduling
|
||||||
Await ScheduleJob(Of ADJob)("ADSync", My.Settings.ADSYNC_CONFIG)
|
Await ScheduleJob(Of ADJob)("ADSync", GetJobConfig(JobConfig.JobType.ADSync))
|
||||||
Await ScheduleJob(Of TestJob)("TestJob", My.Settings.TEST_CONFIG)
|
Await ScheduleJob(Of TestJob)("TestJob", GetJobConfig(JobConfig.JobType.Test))
|
||||||
Await ScheduleJob(Of GraphQLJob)("GraphQLJob", My.Settings.GRAPHQL_CONFIG)
|
Await ScheduleJob(Of GraphQLJob)("GraphQLJob", GetJobConfig(JobConfig.JobType.GraphQL))
|
||||||
' [END] Job Scheduling
|
' [END] Job Scheduling
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Warn("Job Failed.")
|
_Logger.Warn("Job Failed with message: [{0}].", ex.Message)
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Async Function ScheduleJob(Of T As Quartz.IJob)(JobName As String, JobConfigString As String) As Task
|
Public Function GetJobConfig(pName As JobConfig.JobType) As JobConfig
|
||||||
|
Return _config.Jobs.Where(Function(j) j.Name = pName).SingleOrDefault()
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Async Function ScheduleJob(Of T As Quartz.IJob)(JobName As String, pJobConfig As JobConfig) As Task
|
||||||
Dim oJobIdentity As String = JobName
|
Dim oJobIdentity As String = JobName
|
||||||
Dim oTriggerIdentity As String = JobName & "-Trigger"
|
Dim oTriggerIdentity As String = JobName & "-Trigger"
|
||||||
Dim oJobConfig As JobConfig = JobConfigParser.ParseConfig(JobConfigString)
|
Dim oJobConfig As JobConfig = JobConfigParser.ParseConfig(pJobConfig)
|
||||||
Dim oJobData As New JobDataMap From {
|
Dim oJobData As New JobDataMap From {
|
||||||
{"LogConfig", _LogConfig},
|
{"LogConfig", _LogConfig},
|
||||||
{"Firebird", _firebird},
|
{"Firebird", _firebird},
|
||||||
{"MSSQL", _mssql},
|
{"MSSQL", _mssql},
|
||||||
{"Args", oJobConfig.Arguments}
|
{"Args", oJobConfig.Args}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dim oJob = JobBuilder.Create(Of T)().
|
Dim oJob = JobBuilder.Create(Of T)().
|
||||||
@ -87,7 +77,7 @@ Public Class JobRunner
|
|||||||
Dim oTrigger = TriggerBuilder.Create().
|
Dim oTrigger = TriggerBuilder.Create().
|
||||||
WithIdentity(oTriggerIdentity).
|
WithIdentity(oTriggerIdentity).
|
||||||
StartNow().
|
StartNow().
|
||||||
WithCronSchedule(oJobConfig.CronExpression).
|
WithCronSchedule(oJobConfig.CronSchedule).
|
||||||
Build()
|
Build()
|
||||||
|
|
||||||
If oJobConfig.Enabled Then
|
If oJobConfig.Enabled Then
|
||||||
@ -98,8 +88,8 @@ Public Class JobRunner
|
|||||||
_Logger.Info("Job {0} is disabled.", JobName)
|
_Logger.Info("Job {0} is disabled.", JobName)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' If StartImmediately is True, start Job after 10 Seconds
|
' If StartWithoutDelay is True, start Job after 10 Seconds
|
||||||
If oJobConfig.StartImmediately Then
|
If oJobConfig.StartWithoutDelay Then
|
||||||
Dim oDebugJob = JobBuilder.Create(Of T)().
|
Dim oDebugJob = JobBuilder.Create(Of T)().
|
||||||
WithIdentity(oJobIdentity & "-DEBUG").
|
WithIdentity(oJobIdentity & "-DEBUG").
|
||||||
UsingJobData(oJobData).
|
UsingJobData(oJobData).
|
||||||
@ -130,8 +120,6 @@ Public Class JobRunner
|
|||||||
_Logger = Logger
|
_Logger = Logger
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Function GetLogger(name As String) As Logging.Logger Implements ILogProvider.GetLogger
|
Private Function GetLogger(name As String) As Logging.Logger Implements ILogProvider.GetLogger
|
||||||
Return Function(level, func, exception, parameters)
|
Return Function(level, func, exception, parameters)
|
||||||
If exception IsNot Nothing Then
|
If exception IsNot Nothing Then
|
||||||
|
|||||||
@ -11,8 +11,9 @@
|
|||||||
<AssemblyName>DigitalData.Services.JobRunner</AssemblyName>
|
<AssemblyName>DigitalData.Services.JobRunner</AssemblyName>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<MyType>Console</MyType>
|
<MyType>Console</MyType>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -50,6 +51,10 @@
|
|||||||
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
|
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="DigitalData.Modules.Config, Version=1.1.4.1, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Database, Version=2.2.7.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Modules.Database, Version=2.2.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||||
@ -66,11 +71,11 @@
|
|||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Quartz, Version=3.3.2.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
<Reference Include="Quartz, Version=3.5.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Quartz.3.3.2\lib\net461\Quartz.dll</HintPath>
|
<HintPath>..\packages\Quartz.3.5.0\lib\net462\Quartz.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
@ -101,6 +106,7 @@
|
|||||||
<Import Include="System.Threading.Tasks" />
|
<Import Include="System.Threading.Tasks" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Config.vb" />
|
||||||
<Compile Include="JobRunner.vb" />
|
<Compile Include="JobRunner.vb" />
|
||||||
<Compile Include="Jobs\GraphQLJob.vb" />
|
<Compile Include="Jobs\GraphQLJob.vb" />
|
||||||
<Compile Include="Jobs\ADJob.vb" />
|
<Compile Include="Jobs\ADJob.vb" />
|
||||||
@ -108,6 +114,7 @@
|
|||||||
<Compile Include="My Project\Application.Designer.vb">
|
<Compile Include="My Project\Application.Designer.vb">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Application.myapp</DependentUpon>
|
<DependentUpon>Application.myapp</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="JobRunnerService.vb">
|
<Compile Include="JobRunnerService.vb">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
|
|||||||
@ -1,31 +1,37 @@
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports System.IO
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Modules.Logging.LogConfig
|
Imports DigitalData.Modules.Logging.LogConfig
|
||||||
Imports DigitalData.Modules.Database
|
Imports DigitalData.Modules.Database
|
||||||
Imports DigitalData.Services.JobRunner
|
Imports DigitalData.Modules.Config
|
||||||
|
|
||||||
Public Class JobRunnerService
|
Public Class JobRunnerService
|
||||||
Private _logConfig As LogConfig
|
Private _logConfig As LogConfig
|
||||||
Private _logger As Logger
|
Private _logger As Logger
|
||||||
|
Private _config As ConfigManager(Of Config)
|
||||||
Private _mssql As MSSQLServer
|
Private _mssql As MSSQLServer
|
||||||
Private _firebird As Firebird
|
Private _firebird As Firebird
|
||||||
Private _jobrunner As JobRunner
|
Private _jobrunner As JobRunner
|
||||||
|
|
||||||
Protected Overrides Sub OnStart(ByVal args() As String)
|
Protected Overrides Sub OnStart(ByVal args() As String)
|
||||||
_logConfig = New LogConfig(PathType.CustomPath, My.Settings.LOG_PATH) With {
|
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log")) With {.Debug = True}
|
||||||
.Debug = My.Settings.LOG_DEBUG
|
|
||||||
}
|
|
||||||
_logger = _logConfig.GetLogger()
|
_logger = _logConfig.GetLogger()
|
||||||
_logger.Info("Starting Service {0}", ServiceName)
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
_mssql = New MSSQLServer(_logConfig, My.Settings.SQL_CONNECTIONSTRING)
|
|
||||||
_firebird = New Firebird(_logConfig, My.Settings.FIREBIRD_SERVER, My.Settings.FIREBIRD_DATABASE, My.Settings.FIREBIRD_USER, My.Settings.FIREBIRD_PASSWORD)
|
|
||||||
Catch ex As Exception
|
|
||||||
_logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Try
|
_logger.Info("Starting Service {0}", ServiceName)
|
||||||
_jobrunner = New JobRunner(_logConfig, _mssql, _firebird)
|
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
|
||||||
|
_logConfig.Debug = _config.Config.Debug
|
||||||
|
|
||||||
|
Dim oFirebird = _config.Config.Firebird
|
||||||
|
|
||||||
|
_logger.Debug("Connecting to Database..")
|
||||||
|
|
||||||
|
_mssql = New MSSQLServer(_logConfig, _config.Config.SQLConnectionString)
|
||||||
|
_firebird = New Firebird(_logConfig, oFirebird.DataSource, oFirebird.Database, oFirebird.User, oFirebird.Password)
|
||||||
|
|
||||||
|
_logger.Debug("Starting Jobrunner..")
|
||||||
|
|
||||||
|
_jobrunner = New JobRunner(_logConfig, _config.Config, _mssql, _firebird)
|
||||||
_jobrunner.Start()
|
_jobrunner.Start()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Error(ex)
|
_logger.Error(ex)
|
||||||
|
|||||||
@ -12,8 +12,8 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("")>
|
<Assembly: AssemblyDescription("")>
|
||||||
<Assembly: AssemblyCompany("")>
|
<Assembly: AssemblyCompany("")>
|
||||||
<Assembly: AssemblyProduct("Service.JobRunner")>
|
<Assembly: AssemblyProduct("Service.JobRunner")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2020")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("2.1.0.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.0.4.0")>
|
<Assembly: AssemblyVersion("2.1.0.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
@ -22,7 +22,7 @@ Namespace My.Resources
|
|||||||
'''<summary>
|
'''<summary>
|
||||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
|
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||||
|
|||||||
93
Service.JobRunner/My Project/Settings.Designer.vb
generated
93
Service.JobRunner/My Project/Settings.Designer.vb
generated
@ -15,7 +15,7 @@ Option Explicit On
|
|||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0"), _
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
|
||||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Partial Friend NotInheritable Class MySettings
|
Partial Friend NotInheritable Class MySettings
|
||||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
@ -53,97 +53,6 @@ Namespace My
|
|||||||
Return defaultInstance
|
Return defaultInstance
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
|
||||||
Public ReadOnly Property LOG_PATH() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("LOG_PATH"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
|
||||||
Public ReadOnly Property SQL_CONNECTIONSTRING() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("SQL_CONNECTIONSTRING"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
|
||||||
Public ReadOnly Property FIREBIRD_SERVER() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("FIREBIRD_SERVER"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
|
||||||
Public ReadOnly Property FIREBIRD_DATABASE() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("FIREBIRD_DATABASE"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
|
||||||
Public ReadOnly Property FIREBIRD_USER() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("FIREBIRD_USER"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
|
||||||
Public ReadOnly Property FIREBIRD_PASSWORD() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("FIREBIRD_PASSWORD"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
|
||||||
Public ReadOnly Property LOG_DEBUG() As Boolean
|
|
||||||
Get
|
|
||||||
Return CType(Me("LOG_DEBUG"),Boolean)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("True|10/0 * * * * ?|Foo::Bar")> _
|
|
||||||
Public ReadOnly Property TEST_CONFIG() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("TEST_CONFIG"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("False|0 0 0/1 * * ?|QueryConfigFolder::E:\JenneJ\GraphQL")> _
|
|
||||||
Public ReadOnly Property GRAPHQL_CONFIG() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("GRAPHQL_CONFIG"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("False|0 0 0/1 * * ?|RootPath::LDAP://DIGITALDATA,UserFilter::(&(samaccountname=@S"& _
|
|
||||||
"AMACCOUNTNAME)),GroupFilter::(&(samaccountname=*))")> _
|
|
||||||
Public ReadOnly Property ADSYNC_CONFIG() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("ADSYNC_CONFIG"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|
||||||
|
|||||||
@ -1,36 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings />
|
||||||
<Setting Name="LOG_PATH" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="SQL_CONNECTIONSTRING" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FIREBIRD_SERVER" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FIREBIRD_DATABASE" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FIREBIRD_USER" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FIREBIRD_PASSWORD" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LOG_DEBUG" Type="System.Boolean" Scope="Application">
|
|
||||||
<Value Profile="(Default)">False</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="ADSYNC_CONFIG" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)">False|0 0 0/1 * * ?|RootPath::LDAP://DIGITALDATA,UserFilter::(&(samaccountname=@SAMACCOUNTNAME)),GroupFilter(&(samaccountname=*))</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="TEST_CONFIG" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)">True|10/0 * * * * ?|Foo::Bar</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="GRAPHQL_CONFIG" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)">False|0 0 0/1 * * ?|QueryConfigFolder::E:\JenneJ\GraphQL</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net461" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net461" />
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
<package id="Quartz" version="3.3.2" targetFramework="net461" />
|
<package id="Quartz" version="3.5.0" targetFramework="net462" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -81,8 +81,8 @@
|
|||||||
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -308,10 +308,10 @@ Public Class EmailService
|
|||||||
|
|
||||||
Select Case Database
|
Select Case Database
|
||||||
Case DatabaseType.Firebird
|
Case DatabaseType.Firebird
|
||||||
oSQL = "SELECT * FROM TBEDM_EMAIL_QUEUE WHERE EMAIL_SENT IS NULL and EMAIL_TO <> '' ORDER BY EMAIL_ACCOUNT_ID, CREATEDWHEN DESC"
|
oSQL = "SELECT * FROM TBEDM_EMAIL_QUEUE WHERE EMAIL_SENT IS NULL and EMAIL_TO <> ''"
|
||||||
oEmailQueue = _Firebird.GetDatatable(oSQL)
|
oEmailQueue = _Firebird.GetDatatable(oSQL)
|
||||||
Case DatabaseType.MSSQL
|
Case DatabaseType.MSSQL
|
||||||
oSQL = "SELECT * FROM TBEMLP_EMAIL_OUT WHERE EMAIL_SENT IS NULL and EMAIL_ADRESS <> '' ORDER BY SENDING_PROFILE, ADDED_WHEN DESC"
|
oSQL = "SELECT * FROM TBEMLP_EMAIL_OUT WHERE EMAIL_SENT IS NULL and EMAIL_ADRESS <> ''"
|
||||||
oEmailQueue = MSSQLInstance.GetDatatable(oSQL)
|
oEmailQueue = MSSQLInstance.GetDatatable(oSQL)
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
@ -337,9 +337,9 @@ Public Class EmailService
|
|||||||
|
|
||||||
Select Case Database
|
Select Case Database
|
||||||
Case DatabaseType.Firebird
|
Case DatabaseType.Firebird
|
||||||
oAccountQueue = oEmailQueue.Select($"EMAIL_ACCOUNT_ID = {oAccount.Guid}")
|
oAccountQueue = oEmailQueue.Select($"EMAIL_ACCOUNT_ID = {oAccount.Guid}", "GUID ASC")
|
||||||
Case Else
|
Case Else
|
||||||
oAccountQueue = oEmailQueue.Select($"SENDING_PROFILE = {oAccount.Guid}")
|
oAccountQueue = oEmailQueue.Select($"SENDING_PROFILE = {oAccount.Guid}", "GUID ASC")
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
' No mails for this profile
|
' No mails for this profile
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyCompany("")>
|
<Assembly: AssemblyCompany("")>
|
||||||
<Assembly: AssemblyProduct("DDEmailService")>
|
<Assembly: AssemblyProduct("DDEmailService")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("1.5.1.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.5.0.0")>
|
<Assembly: AssemblyVersion("1.5.1.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.5.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net461" />
|
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net461" />
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -56,8 +56,8 @@
|
|||||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -34,6 +34,10 @@
|
|||||||
Public Property RejectionTransferEnabled As Boolean = True
|
Public Property RejectionTransferEnabled As Boolean = True
|
||||||
Public Property RejectionTransferTimeUnit As String = "HOUR"
|
Public Property RejectionTransferTimeUnit As String = "HOUR"
|
||||||
Public Property RejectionTransferTimeValue As Integer = 12
|
Public Property RejectionTransferTimeValue As Integer = 12
|
||||||
|
|
||||||
|
Public Property AllowFacturX As Boolean = True
|
||||||
|
Public Property AllowXRechnung As Boolean = True
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class FirebirdConfig
|
Public Class FirebirdConfig
|
||||||
|
|||||||
@ -71,8 +71,8 @@
|
|||||||
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
||||||
</Reference>
|
</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=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyCompany("Digital Data")>
|
<Assembly: AssemblyCompany("Digital Data")>
|
||||||
<Assembly: AssemblyProduct("DDZUGFeRDService")>
|
<Assembly: AssemblyProduct("DDZUGFeRDService")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("2.1.2.1")>
|
<Assembly: AssemblyTrademark("2.2.0.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.1.2.1")>
|
<Assembly: AssemblyVersion("2.2.0.0")>
|
||||||
<Assembly: AssemblyFileVersion("2.1.2.1")>
|
<Assembly: AssemblyFileVersion("2.2.0.0")>
|
||||||
|
|||||||
@ -50,8 +50,12 @@ Public Class ThreadRunner
|
|||||||
.ExceptionEmailAddress = _config.Config.ExceptionEmailAddress,
|
.ExceptionEmailAddress = _config.Config.ExceptionEmailAddress,
|
||||||
.IgnoreRejectionStatus = _config.Config.Custom.IgnoreRejectionStatus,
|
.IgnoreRejectionStatus = _config.Config.Custom.IgnoreRejectionStatus,
|
||||||
.MaxAttachmentSizeInMegaBytes = _config.Config.Custom.MaxAttachmentSizeInMegaBytes,
|
.MaxAttachmentSizeInMegaBytes = _config.Config.Custom.MaxAttachmentSizeInMegaBytes,
|
||||||
.NamePortal = _config.Config.PORTAL_NAME
|
.NamePortal = _config.Config.PORTAL_NAME,
|
||||||
|
.EmailOutProfileId = _config.Config.MSSQLEmailOutAccountID,
|
||||||
|
.AllowFacturX = _config.Config.Custom.AllowFacturX,
|
||||||
|
.AllowXRechnung = _config.Config.Custom.AllowXRechnung
|
||||||
}
|
}
|
||||||
|
|
||||||
oArgs = LoadFolderConfig(oArgs)
|
oArgs = LoadFolderConfig(oArgs)
|
||||||
oArgs = LoadPropertyMapFor(oArgs, "DEFAULT")
|
oArgs = LoadPropertyMapFor(oArgs, "DEFAULT")
|
||||||
|
|
||||||
@ -191,7 +195,7 @@ Public Class ThreadRunner
|
|||||||
Dim oArgs As WorkerArgs = e.Argument
|
Dim oArgs As WorkerArgs = e.Argument
|
||||||
_logger.Debug("Background worker running..")
|
_logger.Debug("Background worker running..")
|
||||||
|
|
||||||
Dim oJob As New ImportZUGFeRDFiles(_logConfig, _firebird, _config.Config.MSSQLEmailOutAccountID, _config.Config.PORTAL_NAME, _mssql)
|
Dim oJob As New ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
|
||||||
oJob.Start(oArgs)
|
oJob.Start(oArgs)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Warn("Background worker failed!")
|
_logger.Warn("Background worker failed!")
|
||||||
|
|||||||
@ -18,19 +18,6 @@ Public Class ZUGFeRDService
|
|||||||
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
|
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
|
||||||
_logConfig.Debug = _config.Config.Debug
|
_logConfig.Debug = _config.Config.Debug
|
||||||
_logger = _logConfig.GetLogger()
|
_logger = _logConfig.GetLogger()
|
||||||
Try
|
|
||||||
Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory)
|
|
||||||
|
|
||||||
For Each file As IO.FileInfo In directory.GetFiles
|
|
||||||
If (Now - file.CreationTime).Days > 29 Then
|
|
||||||
file.Delete()
|
|
||||||
Else
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
Catch ex As Exception
|
|
||||||
|
|
||||||
End Try
|
|
||||||
_logger.Info($"{Constants.SERVICE_NAME} is starting.")
|
_logger.Info($"{Constants.SERVICE_NAME} is starting.")
|
||||||
|
|
||||||
Dim oDataSource As String = _config.Config.Firebird.DataSource
|
Dim oDataSource As String = _config.Config.Firebird.DataSource
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net461" />
|
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net461" />
|
||||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -1,15 +1,20 @@
|
|||||||
using System;
|
namespace ZUGFeRDRESTService
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ZUGFeRDRESTService
|
|
||||||
{
|
{
|
||||||
public class Config
|
public class Config
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string LogPath { get; set; }
|
public string LogPath { get; set; }
|
||||||
|
|
||||||
public string MSSQLConnectionString { get; set; }
|
public string MSSQLConnectionString { get; set; }
|
||||||
|
|
||||||
|
public FirebirdConfig Firebird { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class FirebirdConfig
|
||||||
|
{
|
||||||
|
public string Datasource { get; set; }
|
||||||
|
public string Database { get; set; }
|
||||||
|
public string Username { get; set; }
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using DigitalData.Modules.Interfaces;
|
using DigitalData.Modules.Interfaces;
|
||||||
using DigitalData.Modules.Logging;
|
|
||||||
using static DigitalData.Modules.Interfaces.Exceptions;
|
using static DigitalData.Modules.Interfaces.Exceptions;
|
||||||
using static DigitalData.Modules.Interfaces.ZUGFeRDInterface;
|
using static DigitalData.Modules.Interfaces.ZUGFeRDInterface;
|
||||||
|
using static DigitalData.Modules.Interfaces.PropertyValues;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
|
||||||
namespace ZUGFeRDRESTService.Controllers
|
namespace ZUGFeRDRESTService.Controllers
|
||||||
{
|
{
|
||||||
@ -17,8 +16,11 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class ValidationController : ControllerBase
|
public class ValidationController : ControllerBase
|
||||||
{
|
{
|
||||||
public static string RESPONSE_OK = "OK";
|
public const string RESPONSE_OK = "OK";
|
||||||
public static string RESPONSE_ERROR = "ERROR";
|
public const string RESPONSE_ERROR = "ERROR";
|
||||||
|
|
||||||
|
public const string ADDED_WHO = "ZUGFeRD REST Service";
|
||||||
|
public const string MESSAGEID_DOMAIN = "test.wisag.de";
|
||||||
|
|
||||||
private readonly ZUGFeRDInterface _zugferd;
|
private readonly ZUGFeRDInterface _zugferd;
|
||||||
private readonly IDatabase _database;
|
private readonly IDatabase _database;
|
||||||
@ -29,34 +31,6 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
private readonly PropertyValues _props;
|
private readonly PropertyValues _props;
|
||||||
private readonly Dictionary<String, XmlItemProperty> _propertyMap;
|
private readonly Dictionary<String, XmlItemProperty> _propertyMap;
|
||||||
|
|
||||||
public class ValidationResponse
|
|
||||||
{
|
|
||||||
public string status;
|
|
||||||
public string message;
|
|
||||||
public List<string> errors;
|
|
||||||
|
|
||||||
public ValidationResponse()
|
|
||||||
{
|
|
||||||
status = RESPONSE_OK;
|
|
||||||
message = string.Empty;
|
|
||||||
errors = new List<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ValidationResponse(string Status, string Message)
|
|
||||||
{
|
|
||||||
status = Status;
|
|
||||||
message = Message;
|
|
||||||
errors = new List<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ValidationResponse(string Status, string Message, List<String> Errors)
|
|
||||||
{
|
|
||||||
status = Status;
|
|
||||||
message = Message;
|
|
||||||
errors = Errors;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ValidationController(ILogging logging, IDatabase database)
|
public ValidationController(ILogging logging, IDatabase database)
|
||||||
{
|
{
|
||||||
_logConfig = logging.LogConfig;
|
_logConfig = logging.LogConfig;
|
||||||
@ -79,11 +53,12 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// POST: /api/validation
|
/// POST: /api/validation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="files">This parameter's name needs to correspond to the html form's file-input name</param>
|
/// <param name="file">This parameter's name needs to correspond to the html form's file-input name</param>
|
||||||
|
/// <param name="user_id">This is the email address which the user supplied</param>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<ValidationResponse> Post(IFormFile file, string user_id)
|
public ValidationResponse Post(IFormFile file, string user_id)
|
||||||
{
|
{
|
||||||
_logger.Debug("Start processing request to ValidationController");
|
_logger.Info("Start processing request to ValidationController");
|
||||||
|
|
||||||
object oDocument;
|
object oDocument;
|
||||||
PropertyValues.CheckPropertyValuesResult oResult = new PropertyValues.CheckPropertyValuesResult();
|
PropertyValues.CheckPropertyValuesResult oResult = new PropertyValues.CheckPropertyValuesResult();
|
||||||
@ -92,40 +67,63 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
{
|
{
|
||||||
using Stream oStream = file.OpenReadStream();
|
using Stream oStream = file.OpenReadStream();
|
||||||
{
|
{
|
||||||
_logger.Debug("Extracting ZUGFeRD Data from file [{0}]", file.FileName);
|
_logger.Info("Extracting ZUGFeRD Data from file [{0}]", file.FileName);
|
||||||
|
|
||||||
oDocument = _zugferd.ExtractZUGFeRDFileWithGDPicture(oStream);
|
oDocument = _zugferd.ExtractZUGFeRDFileWithGDPicture(oStream);
|
||||||
|
|
||||||
_logger.Debug("Checking ZUGFeRD Data against the database");
|
_logger.Info("Starting structural check against the database.");
|
||||||
|
|
||||||
oResult = _props.CheckPropertyValues(oDocument, _propertyMap, "MESSAGEID");
|
oResult = _props.CheckPropertyValues(oDocument, _propertyMap, "MESSAGEID");
|
||||||
|
|
||||||
var oRequiredProperties = _propertyMap.
|
var oRequiredProperties = _propertyMap.
|
||||||
Where(prop => {return prop.Value.IsRequired == true;}).
|
Where(prop => { return prop.Value.IsRequired == true; }).
|
||||||
Select(prop => { return prop.Value.Description; })
|
Select(prop => { return prop.Value.Description; })
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
_logger.Debug("Found [{0}] required properties", oRequiredProperties.Count);
|
_logger.Debug("Found [{0}] required properties", oRequiredProperties.Count);
|
||||||
_logger.Debug(String.Join(",", oRequiredProperties.ToArray()));
|
_logger.Debug(string.Join(",", oRequiredProperties.ToArray()));
|
||||||
|
|
||||||
_logger.Debug("Result of checking against the database: {0} valid properties, {1} missing properties",
|
_logger.Info("Result of checking against the database: {0} valid properties, {1} missing properties",
|
||||||
oResult.ValidProperties.Count, oResult.MissingProperties.Count);
|
oResult.ValidProperties.Count, oResult.MissingProperties.Count);
|
||||||
|
|
||||||
if (oResult.MissingProperties.Count > 0)
|
if (oResult.MissingProperties.Count > 0)
|
||||||
{
|
{
|
||||||
throw new ZUGFeRDExecption(ZUGFeRDInterface.ErrorType.MissingProperties,
|
throw new ZUGFeRDExecption(ErrorType.MissingProperties,
|
||||||
"Die hochgeladene Datei ist eine gültige ZUGFeRD-Rechnung, allerdings fehlen benötigte Daten.");
|
"Die hochgeladene Datei ist eine gültige ZUGFeRD-Rechnung, allerdings fehlen benötigte Daten.");
|
||||||
}
|
}
|
||||||
|
|
||||||
string oMessage = "Die hochgeladene Datei ist eine gültige-ZUGFeRD Rechnung";
|
Tuple<bool, string> oValidateResult = ValidateBuyerOrderReference(oResult.ValidProperties);
|
||||||
|
|
||||||
_logger.Debug($"Replying with: [{oMessage}]");
|
if (oValidateResult.Item1 == false)
|
||||||
|
|
||||||
return new ValidationResponse()
|
|
||||||
{
|
{
|
||||||
status = RESPONSE_OK,
|
throw new ZUGFeRDExecption(ErrorType.UnknownError, "Die hochgeladene Datei kann nicht validiert werden, weil ein unbekannter Fehler aufgetreten ist.");
|
||||||
message = oMessage
|
}
|
||||||
};
|
|
||||||
|
string oValidateResultString = oValidateResult.Item2;
|
||||||
|
|
||||||
|
if (oValidateResultString == "ALL REFERENCES CHECKED POSITIVE")
|
||||||
|
{
|
||||||
|
string oMessage = "Die hochgeladene Datei ist eine gültige-ZUGFeRD Rechnung";
|
||||||
|
|
||||||
|
_logger.Info($"Responding with message: [{oMessage}]");
|
||||||
|
|
||||||
|
return new ValidationResponse()
|
||||||
|
{
|
||||||
|
status = RESPONSE_OK,
|
||||||
|
message = oMessage
|
||||||
|
};
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
string oMessage = oValidateResultString;
|
||||||
|
|
||||||
|
_logger.Info($"Responding with message: [{oMessage}]");
|
||||||
|
|
||||||
|
return new ValidationResponse()
|
||||||
|
{
|
||||||
|
status = RESPONSE_ERROR,
|
||||||
|
message = oMessage
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (ZUGFeRDExecption ex)
|
catch (ZUGFeRDExecption ex)
|
||||||
@ -150,7 +148,7 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
_ => new List<string>()
|
_ => new List<string>()
|
||||||
};
|
};
|
||||||
|
|
||||||
_logger.Debug($"Replying with: [{oMessage}]");
|
_logger.Info($"Responding with message: [{oMessage}]");
|
||||||
|
|
||||||
return new ValidationResponse()
|
return new ValidationResponse()
|
||||||
{
|
{
|
||||||
@ -165,7 +163,7 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
|
|
||||||
string oMessage = "Die hochgeladene Datei kann nicht validiert werden, weil ein unbekannter Fehler aufgetreten ist.";
|
string oMessage = "Die hochgeladene Datei kann nicht validiert werden, weil ein unbekannter Fehler aufgetreten ist.";
|
||||||
|
|
||||||
_logger.Debug($"Replying with: [{oMessage}]");
|
_logger.Info($"Responding with message: [{oMessage}]");
|
||||||
|
|
||||||
return new ValidationResponse()
|
return new ValidationResponse()
|
||||||
{
|
{
|
||||||
@ -174,5 +172,87 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Tuple<bool, string> ValidateBuyerOrderReference(List<ValidProperty> pProperties)
|
||||||
|
{
|
||||||
|
var oMessageId = GetMessageId();
|
||||||
|
_logger.Debug("Created new MessageId: [{0}]", oMessageId);
|
||||||
|
|
||||||
|
_logger.Debug("Inserting properties into database.");
|
||||||
|
foreach (var oItem in pProperties)
|
||||||
|
{
|
||||||
|
var oResult = InsertPropertyMap(oItem, oMessageId);
|
||||||
|
|
||||||
|
if (oResult == false)
|
||||||
|
{
|
||||||
|
_logger.Warn("Error while inserting the Property [{0}] into the Database!", oItem.Description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.Debug("Calling validation prodecure.");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using SqlCommand oCommand = new SqlCommand("PRCUST_INV_CHECK_FROM_PORTAL");
|
||||||
|
oCommand.CommandType = System.Data.CommandType.StoredProcedure;
|
||||||
|
|
||||||
|
oCommand.Parameters.Clear();
|
||||||
|
oCommand.Parameters.Add("@REF_GUID", System.Data.SqlDbType.VarChar, 250).Value = oMessageId;
|
||||||
|
oCommand.Parameters.Add("@MSG_OUTPUT", System.Data.SqlDbType.VarChar, 500).Direction = System.Data.ParameterDirection.Output;
|
||||||
|
|
||||||
|
if (_database.MSSQL.ExecuteNonQuery(oCommand))
|
||||||
|
{
|
||||||
|
string oReturnValue = (string)oCommand.Parameters["@MSG_OUTPUT"].Value;
|
||||||
|
return new Tuple<bool, string>(true, oReturnValue);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new Tuple<bool, string>(false, string.Empty);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.Error(e);
|
||||||
|
return new Tuple<bool, string>(false, string.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetMessageId()
|
||||||
|
{
|
||||||
|
return $"{Guid.NewGuid()}@{MESSAGEID_DOMAIN}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool InsertPropertyMap(ValidProperty pProperty, string pMessageId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var oSql = $"INSERT INTO {pProperty.TableName} " +
|
||||||
|
"(REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, CREATEDWHO, SPEC_NAME, GROUP_COUNTER, IS_REQUIRED) VALUES " +
|
||||||
|
"(@REFERENCE_GUID, @ITEM_DESCRIPTION, @ITEM_VALUE, @CREATEDWHO, @SPEC_NAME, @GROUP_COUNTER, @IS_REQUIRED)";
|
||||||
|
|
||||||
|
var oParams = new SqlParameter[]
|
||||||
|
{
|
||||||
|
new SqlParameter("@REFERENCE_GUID", pMessageId),
|
||||||
|
new SqlParameter("@ITEM_DESCRIPTION", pProperty.Description),
|
||||||
|
new SqlParameter("@ITEM_VALUE", pProperty.Value),
|
||||||
|
new SqlParameter("@CREATEDWHO", ADDED_WHO),
|
||||||
|
new SqlParameter("@GROUP_COUNTER", pProperty.GroupCounter),
|
||||||
|
new SqlParameter("@SPEC_NAME", pProperty.TableColumn),
|
||||||
|
new SqlParameter("@IS_REQUIRED", pProperty.ISRequired)
|
||||||
|
};
|
||||||
|
|
||||||
|
var oCommand = new SqlCommand(oSql);
|
||||||
|
oCommand.Parameters.AddRange(oParams);
|
||||||
|
|
||||||
|
return _database.MSSQL.ExecuteNonQuery(oCommand);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace ZUGFeRDRESTService.Controllers
|
||||||
|
{
|
||||||
|
|
||||||
|
public class ValidationResponse
|
||||||
|
{
|
||||||
|
public string status;
|
||||||
|
public string message;
|
||||||
|
public List<string> errors;
|
||||||
|
|
||||||
|
public ValidationResponse()
|
||||||
|
{
|
||||||
|
status = ValidationController.RESPONSE_OK;
|
||||||
|
message = string.Empty;
|
||||||
|
errors = new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResponse(string Status, string Message)
|
||||||
|
{
|
||||||
|
status = Status;
|
||||||
|
message = Message;
|
||||||
|
errors = new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResponse(string Status, string Message, List<String> Errors)
|
||||||
|
{
|
||||||
|
status = Status;
|
||||||
|
message = Message;
|
||||||
|
errors = Errors;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,18 +1,21 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using DigitalData.Modules.Database;
|
using DigitalData.Modules.Database;
|
||||||
using DigitalData.Modules.Interfaces;
|
using DigitalData.Modules.Interfaces;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace ZUGFeRDRESTService
|
namespace ZUGFeRDRESTService
|
||||||
{
|
{
|
||||||
public class Database: IDatabase
|
public class Database: IDatabase
|
||||||
{
|
{
|
||||||
private string _gdPictureKey = null;
|
private string _gdPictureKey = null;
|
||||||
private Dictionary<String, XmlItemProperty> _propertyMap = null;
|
private Dictionary<string, XmlItemProperty> _propertyMap = null;
|
||||||
|
|
||||||
private const string QUERY_GET_GDPICTURE_KEY = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'";
|
private const string QUERY_GET_GDPICTURE_KEY = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'";
|
||||||
private const string QUERY_GET_PROPERTY_MAP = "SELECT * FROM TBEDM_XML_ITEMS WHERE SPECIFICATION = '{0}' AND ACTIVE = True ORDER BY XML_PATH";
|
private const string QUERY_GET_PROPERTY_MAP = "SELECT * FROM TBEDM_XML_ITEMS WHERE SPECIFICATION = '{0}' AND ACTIVE = True ORDER BY XML_PATH";
|
||||||
@ -22,16 +25,23 @@ namespace ZUGFeRDRESTService
|
|||||||
|
|
||||||
public Database(ILogging Logging, IConfiguration Config)
|
public Database(ILogging Logging, IConfiguration Config)
|
||||||
{
|
{
|
||||||
var LogConfig = Logging.LogConfig;
|
var oLogConfig = Logging.LogConfig;
|
||||||
var Logger = Logging.LogConfig.GetLogger();
|
var oLogger = Logging.LogConfig.GetLogger();
|
||||||
var AppConfig = Config.GetSection("Config");
|
var oAppConfig = Config.GetSection("Config");
|
||||||
var FBConfig = AppConfig.GetSection("Firebird");
|
var oFirebirdConfig = oAppConfig.GetSection("Firebird");
|
||||||
|
|
||||||
MSSQL = new MSSQLServer(LogConfig, AppConfig["MSSQLConnectionString"]);
|
oLogger.Debug("Establishing MSSQL Database connection..");
|
||||||
Firebird = new Firebird(LogConfig, FBConfig["Datasource"], FBConfig["Database"], FBConfig["Username"], FBConfig["Password"]);
|
MSSQL = new MSSQLServer(oLogConfig, oAppConfig["MSSQLConnectionString"]);
|
||||||
|
|
||||||
Logger.Debug("MSSQL Connection: [{0}]", MSSQL.CurrentConnectionString);
|
oLogger.Debug("Establishing Firebird Database connection..");
|
||||||
Logger.Debug("Firebird Connection: [{0}]", Firebird.ConnectionString);
|
Firebird = new Firebird(oLogConfig,
|
||||||
|
oFirebirdConfig["Datasource"],
|
||||||
|
oFirebirdConfig["Database"],
|
||||||
|
oFirebirdConfig["Username"],
|
||||||
|
oFirebirdConfig["Password"]);
|
||||||
|
|
||||||
|
oLogger.Debug("MSSQL Connection: [{0}]", MSSQL.CurrentConnectionString);
|
||||||
|
oLogger.Debug("Firebird Connection: [{0}]", Firebird.ConnectionString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetGDPictureKey()
|
public string GetGDPictureKey()
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.5.0" />
|
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.5.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
|
||||||
<PackageReference Include="NLog" Version="4.7.10" />
|
<PackageReference Include="NLog" Version="5.0.5" />
|
||||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.12.0" />
|
<PackageReference Include="NLog.Web.AspNetCore" Version="4.12.0" />
|
||||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
|
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user