Compare commits
2 Commits
df3f8167fe
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
960acb0ce1 | ||
|
|
b95e580f06 |
@@ -99,23 +99,17 @@
|
||||
</Component>-->
|
||||
|
||||
<Component Id="WindreamLibs" Guid="4D11FC99-50D9-4E54-B18A-8885C9112646">
|
||||
<File Id="WINDREAMLibDLL" Name="Interop.WINDREAMLib.dll" Source="P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WINDREAMLib.dll" KeyPath="yes"/>
|
||||
<File Id="WMOTOOLLib" Name="Interop.WMOTOOLLib.dll" Source="P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOTOOLLib.dll"/>
|
||||
<File Id="WMOSRCHLib" Name="Interop.WMOSRCHLib.dll" Source="P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOSRCHLib.dll"/>
|
||||
<File Id="WMOBRWSLib" Name="Interop.WMOBRWSLib.dll" Source="P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOBRWSLib.dll"/>
|
||||
<File Id="WINDREAMLibDLL" Name="Interop.WINDREAMLib.dll" Source="M:\Bibliotheken\3rdParty\windream\Interop.WINDREAMLib.dll" KeyPath="yes"/>
|
||||
<File Id="WMOTOOLLib" Name="Interop.WMOTOOLLib.dll" Source="M:\Bibliotheken\3rdParty\windream\Interop.WMOTOOLLib.dll"/>
|
||||
<File Id="WMOSRCHLib" Name="Interop.WMOSRCHLib.dll" Source="M:\Bibliotheken\3rdParty\windream\Interop.WMOSRCHLib.dll"/>
|
||||
<File Id="WMOBRWSLib" Name="Interop.WMOBRWSLib.dll" Source="M:\Bibliotheken\3rdParty\windream\Interop.WMOBRWSLib.dll"/>
|
||||
</Component>
|
||||
|
||||
<Component Id="FormsUtilsLibs" Guid="51c183a7-af21-481a-bd34-0e547e6f6e1c">
|
||||
<File Id="FormsUtilsLib" Name="FormsUtils.dll" Source="P:\Visual Studio Projekte\Bibliotheken\FormsUtils.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="IndependentsoftLibs" Guid="C3B3BB48-DB41-4419-A4B8-0E4DC5E8856B">
|
||||
<File Id="MSGLib" Name="Independentsoft.Msg.dll" Source="P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\22_11_19\Independentsoft.Msg.dll" KeyPath="yes"/>
|
||||
<File Id="FormsUtilsLib" Name="FormsUtils.dll" Source="M:\Bibliotheken\3rdParty\FormsUtils.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="DDLibs" Guid="BA2979E3-3778-48B8-B0D8-4B77825B9293">
|
||||
<File Id="DLLLicenseManager" Name="DLLLicenseManager.dll" Source="P:\Visual Studio Projekte\Bibliotheken\DLLLicenseManager.dll" KeyPath="yes"/>
|
||||
<File Id="DDLibStandards" Name="DD_LIB_Standards.dll" Source="P:\Visual Studio Projekte\Bibliotheken\DD_LIB_Standards.dll"/>
|
||||
<File Id="LookupGrid" Name="DigitalData.Controls.LookupGrid.dll" Source="DigitalData.Controls.LookupGrid.dll"/>
|
||||
<File Id="DDSnapPanel" Name="DigitalData.Controls.SnapPanel.dll" Source="DigitalData.Controls.SnapPanel.dll"/>
|
||||
<File Id="DDCommonGUIs" Name="DigitalData.GUIs.Common.dll" Source="DigitalData.GUIs.Common.dll"/>
|
||||
@@ -139,58 +133,58 @@
|
||||
</Component>
|
||||
<Component Id="RuntimeLibs" Guid="F7170744-3DB5-4275-ACCD-7F3B9BDE1D6E">
|
||||
<File Id="Newtonsoft.Json" Name="Newtonsoft.Json.dll" Source="Newtonsoft.Json.dll" KeyPath="yes" />
|
||||
<File Id="System.Memory" Name="System.Memory.dll" Source="System.Memory.dll" />
|
||||
<File Id="System.Runtime.CompilerServices.Unsafe" Name="System.Runtime.CompilerServices.Unsafe.dll" Source="System.Runtime.CompilerServices.Unsafe.dll" />
|
||||
<File Id="System.Buffers" Name="System.Buffers.dll" Source="System.Buffers.dll" />
|
||||
<File Id="System.Collections.Immutable" Name="System.Collections.Immutable.dll" Source="System.Collections.Immutable.dll" />
|
||||
<File Id="System.Numerics.Vectors" Name="System.Numerics.Vectors.dll" Source="System.Numerics.Vectors.dll" />
|
||||
<File Id="System.Security.Cryptography.Pkcs" Name="System.Security.Cryptography.Pkcs.dll" Source="System.Security.Cryptography.Pkcs.dll" />
|
||||
<File Id="System.Text.Json" Name="System.Text.Json.dll" Source="System.Text.Json.dll" />
|
||||
<File Id="System.Text.Encodings.Web" Name="System.Text.Encodings.Web.dll" Source="System.Text.Encodings.Web.dll" />
|
||||
<File Id="System.Threading.Tasks.Extensions" Name="System.Threading.Tasks.Extensions.dll" Source="System.Threading.Tasks.Extensions.dll" />
|
||||
<File Id="Microsoft.Bcl.AsyncInterfaces" Name="Microsoft.Bcl.AsyncInterfaces.dll" Source="Microsoft.Bcl.AsyncInterfaces.dll" />
|
||||
<File Id="protobuf_net" Name="protobuf-net.dll" Source="protobuf-net.dll" />
|
||||
<File Id="DocumentFormat.OpenXml" Name="DocumentFormat.OpenXml.dll" Source="DocumentFormat.OpenXml.dll" />
|
||||
<File Id="DocumentFormat.OpenXml.Framework" Name="DocumentFormat.OpenXml.Framework.dll" Source="DocumentFormat.OpenXml.Framework.dll" />
|
||||
<File Id="FirebirdSql.Data.FirebirdClient" Name="FirebirdSql.Data.FirebirdClient.dll" Source="FirebirdSql.Data.FirebirdClient.dll" />
|
||||
<File Id="EntityFramework" Name="EntityFramework.dll" Source="EntityFramework.dll" />
|
||||
<File Id="EntityFramework.SqlServer" Name="EntityFramework.SqlServer.dll" Source="EntityFramework.SqlServer.dll" />
|
||||
<File Id="EntityFramework.Firebird" Name="EntityFramework.Firebird.dll" Source="EntityFramework.Firebird.dll" />
|
||||
</Component>
|
||||
|
||||
<Component Id="Oracle" Guid="CF76DB5D-3263-450F-96C6-F02F5447A0A1">
|
||||
<File Id="Oracle.ManagedDataAccess" Name="Oracle.ManagedDataAccess.dll" Source="P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll" KeyPath="yes"/>
|
||||
</Component>
|
||||
|
||||
<Component Id="PDFsharp" Guid="9cd1cfb7-3f84-4a8b-aa51-642b723fcd70">
|
||||
<File Id="PdfSharpgdi" Name="PdfSharp-gdi.dll" Source="P:\Visual Studio Projekte\Bibliotheken\PdfSharp-gdi.dll" KeyPath="yes"/>
|
||||
</Component>
|
||||
|
||||
<Component Id="GDPictureLibs" Guid="9ea5ab43-58ff-4813-9a8b-f854784f0275">
|
||||
<File Id="GdPicture.NET.14" Name="GdPicture.NET.14.dll" KeyPath="yes" />
|
||||
<File Id="GdPicture.NET.14.filters" Name="GdPicture.NET.14.filters.dll" />
|
||||
<File Id="GdPicture.NET.14.filters.64" Name="GdPicture.NET.14.filters.64.dll" />
|
||||
<File Id="GdPicture.NET.14.image" Name="GdPicture.NET.14.image.gdimgplug.dll" />
|
||||
<File Id="GdPicture.NET.14.image64" Name="GdPicture.NET.14.image.gdimgplug.64.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.Rendering.Skia" Name="GdPicture.NET.14.Imaging.Rendering.Skia.dll" />
|
||||
<File Id="GdPicture.NET.14.Rendering.Skia.64" Name="GdPicture.NET.14.Imaging.Rendering.Skia.64.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging" Name="GdPicture.NET.14.Imaging.dll" />
|
||||
<File Id="GdPicture.NET.14.Common" Name="GdPicture.NET.14.Common.dll" />
|
||||
<File Id="GdPicture.NET.14" Name="GdPicture.NET.14.dll" KeyPath="yes" />
|
||||
<File Id="GdPicture.NET.14.CAD" Name="GdPicture.NET.14.CAD.dll" />
|
||||
<File Id="GdPicture.NET.14.CAD.DWG" Name="GdPicture.NET.14.CAD.DWG.dll" />
|
||||
<File Id="GdPicture.NET.14.filters" Name="GdPicture.NET.14.filters.dll" />
|
||||
<File Id="GdPicture.NET.14.filters64" Name="GdPicture.NET.14.filters.64.dll" />
|
||||
<File Id="GdPicture.NET.14.image" Name="GdPicture.NET.14.image.gdimgplug.dll" />
|
||||
<File Id="GdPicture.NET.14.image64" Name="GdPicture.NET.14.image.gdimgplug.64.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.Formats" Name="GdPicture.NET.14.Imaging.Formats.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.Rendering" Name="GdPicture.NET.14.Imaging.Rendering.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.Rendering.Skia" Name="GdPicture.NET.14.Imaging.Rendering.Skia.dll" />
|
||||
<File Id="GdPicture.NET.14.Rendering.Skia.64" Name="GdPicture.NET.14.Imaging.Rendering.Skia.64.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging" Name="GdPicture.NET.14.Imaging.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.ML.64" Name="GdPicture.NET.14.Imaging.ML.64.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.ML" Name="GdPicture.NET.14.Imaging.ML.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.Formats.Conversion" Name="GdPicture.NET.14.Imaging.Formats.Conversion.dll" />
|
||||
<File Id="GdPicture.NET.14.Common" Name="GdPicture.NET.14.Common.dll" />
|
||||
<File Id="GdPicture.NET.14.Document" Name="GdPicture.NET.14.Document.dll" />
|
||||
<File Id="GdPicture.NET.14.PDF" Name="GdPicture.NET.14.PDF.dll" />
|
||||
<File Id="GdPicture.NET.14.Imaging.Formats" Name="GdPicture.NET.14.Imaging.Formats.dll" />
|
||||
<File Id="GdPicture.NET.14.RTF" Name="GdPicture.NET.14.RTF.dll" />
|
||||
<File Id="GdPicture.NET.14.SVG" Name="GdPicture.NET.14.SVG.dll" />
|
||||
<File Id="GdPicture.NET.14.OpenDocument" Name="GdPicture.NET.14.OpenDocument.dll" />
|
||||
<File Id="GdPicture.NET.14.OpenXML" Name="GdPicture.NET.14.OpenXML.dll" />
|
||||
<File Id="GdPicture.NET.14.Email" Name="GdPicture.NET.14.Email.dll" />
|
||||
<File Id="GdPicture.NET.14.HTML" Name="GdPicture.NET.14.HTML.dll" />
|
||||
<File Id="GdPicture.NET.14.MSOfficeBinary" Name="GdPicture.NET.14.MSOfficeBinary.dll"/>
|
||||
<File Id="GdPicture.NET.14.CAD" Name="GdPicture.NET.14.CAD.dll"/>
|
||||
<File Id="GdPicture.NET.14.CAD.DWG" Name="GdPicture.NET.14.CAD.DWG.dll"/>
|
||||
<File Id="BouncyCastle.Cryptography" Name="BouncyCastle.Cryptography.dll"/>
|
||||
<File Id="System.ValueTuple" Name="System.ValueTuple.dll" />
|
||||
<File Id="DocumentFormat.OpenXml" Name="DocumentFormat.OpenXml.dll" />
|
||||
<File Id="DocumentFormat.OpenXml.Framework" Name="DocumentFormat.OpenXml.Framework.dll" />
|
||||
<File Id="Microsoft.Bcl.AsyncInterfaces" Name="Microsoft.Bcl.AsyncInterfaces.dll" />
|
||||
<File Id="OpenMcdf" Name="OpenMcdf.dll" />
|
||||
<File Id="protobufnet.Core" Name="protobuf-net.Core.dll" />
|
||||
<File Id="protobufnet" Name="protobuf-net.dll" />
|
||||
<File Id="RtfPipe" Name="RtfPipe.dll" />
|
||||
<File Id="System.Buffers" Name="System.Buffers.dll" />
|
||||
<File Id="System.CodeDom" Name="System.CodeDom.dll" />
|
||||
<File Id="System.Collections.Immutable" Name="System.Collections.Immutable.dll" />
|
||||
<File Id="System.IO.Packaging" Name="System.IO.Packaging.dll" />
|
||||
<File Id="System.Memory" Name="System.Memory.dll" />
|
||||
<File Id="System.Numerics.Vectors" Name="System.Numerics.Vectors.dll" />
|
||||
<File Id="System.Runtime.CompilerServices.Unsafe" Name="System.Runtime.CompilerServices.Unsafe.dll" />
|
||||
<File Id="System.Security.Cryptography.Pkcs" Name="System.Security.Cryptography.Pkcs.dll" />
|
||||
<File Id="System.Text.Encodings.Web" Name="System.Text.Encodings.Web.dll" />
|
||||
<File Id="System.Threading.Tasks.Extensions" Name="System.Threading.Tasks.Extensions.dll" />
|
||||
<File Id="System.ValueTuple" Name="System.ValueTuple.dll" />
|
||||
</Component>
|
||||
|
||||
<Component Id="DevExpressLibs" Guid="CB40DAAE-348E-4BD3-B275-9A526EB8F191">
|
||||
@@ -307,9 +301,6 @@
|
||||
<ComponentRef Id="FormsUtilsLibs"/>
|
||||
<ComponentRef Id="DDLibs" />
|
||||
<ComponentRef Id="RuntimeLibs" />
|
||||
<ComponentRef Id="Oracle" />
|
||||
<ComponentRef Id="PDFsharp" />
|
||||
<ComponentRef Id="IndependentsoftLibs" />
|
||||
<ComponentRef Id="DevExpressLibs" />
|
||||
<ComponentRef Id="GDPictureLibs" />
|
||||
<ComponentRef Id="Devexpress.Locales.de" />
|
||||
|
||||
@@ -7,8 +7,6 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupVS19", "SetupVS19\Setu
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "taskFLOW", "TaskFlow\taskFLOW.vbproj", "{6ACA1432-09A2-47EF-A704-C0AA73905756}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DocumentViewer", "..\..\..\2_DLL Projekte\Controls.DocumentViewer\DocumentViewer.vbproj", "{0958CDDF-4A16-41F6-8837-8335F71D599C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
CD_ROM|Any CPU = CD_ROM|Any CPU
|
||||
@@ -63,26 +61,6 @@ Global
|
||||
{6ACA1432-09A2-47EF-A704-C0AA73905756}.SingleImage|Any CPU.Build.0 = Release|x86
|
||||
{6ACA1432-09A2-47EF-A704-C0AA73905756}.SingleImage|x86.ActiveCfg = Debug|x86
|
||||
{6ACA1432-09A2-47EF-A704-C0AA73905756}.SingleImage|x86.Build.0 = Debug|x86
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.CD_ROM|x86.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.CD_ROM|x86.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.DVD-5|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.DVD-5|Any CPU.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.DVD-5|x86.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.DVD-5|x86.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.Release|x86.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.SingleImage|Any CPU.Build.0 = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.SingleImage|x86.ActiveCfg = Release|Any CPU
|
||||
{0958CDDF-4A16-41F6-8837-8335F71D599C}.SingleImage|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -418,518 +418,4 @@ Public Class ClassAllgemeineFunktionen
|
||||
' Ergebnis zurückgeben
|
||||
Return b64
|
||||
End Function
|
||||
#Region "Windows API Deklarationen"
|
||||
<DllImport("mpr.dll", CharSet:=CharSet.Auto)>
|
||||
Private Shared Function WNetAddConnection2(ByRef lpNetResource As NETRESOURCE,
|
||||
ByVal lpPassword As String,
|
||||
ByVal lpUsername As String,
|
||||
ByVal dwFlags As Integer) As Integer
|
||||
End Function
|
||||
|
||||
<DllImport("mpr.dll", CharSet:=CharSet.Auto)>
|
||||
Private Shared Function WNetCancelConnection2(ByVal lpName As String,
|
||||
ByVal dwFlags As Integer,
|
||||
ByVal fForce As Boolean) As Integer
|
||||
End Function
|
||||
|
||||
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)>
|
||||
Private Structure NETRESOURCE
|
||||
Public dwScope As Integer
|
||||
Public dwType As Integer
|
||||
Public dwDisplayType As Integer
|
||||
Public dwUsage As Integer
|
||||
Public lpLocalName As String
|
||||
Public lpRemoteName As String
|
||||
Public lpComment As String
|
||||
Public lpProvider As String
|
||||
End Structure
|
||||
|
||||
Private Const RESOURCETYPE_DISK As Integer = 1
|
||||
Private Const CONNECT_UPDATE_PROFILE As Integer = 1
|
||||
Private Const ERROR_SUCCESS As Integer = 0
|
||||
Private Const ERROR_ALREADY_ASSIGNED As Integer = 85
|
||||
#End Region
|
||||
|
||||
''' <summary>
|
||||
''' Struktur für Netzlaufwerk-Informationen
|
||||
''' </summary>
|
||||
Public Structure NetworkDriveInfo
|
||||
Public DriveLetter As String
|
||||
Public NetworkPath As String
|
||||
Public DriveType As IO.DriveType
|
||||
Public IsReady As Boolean
|
||||
Public TotalSize As Long
|
||||
Public FreeSpace As Long
|
||||
End Structure
|
||||
|
||||
''' <summary>
|
||||
''' Ermittelt den nächsten freien Laufwerksbuchstaben (alphabetisch absteigend von Z bis A)
|
||||
''' </summary>
|
||||
''' <param name="blacklist">Liste der nicht erlaubten Laufwerksbuchstaben (z.B. "Y,M,V")</param>
|
||||
''' <returns>Nächster freier Laufwerksbuchstabe mit Doppelpunkt (z.B. "Z:") oder String.Empty wenn keiner frei</returns>
|
||||
Public Shared Function GetNextFreeDriveLetter(Optional blacklist As String = "") As String
|
||||
Try
|
||||
' Blacklist verarbeiten (Großbuchstaben ohne Doppelpunkte)
|
||||
Dim blacklistArray As New List(Of Char)
|
||||
If Not String.IsNullOrEmpty(blacklist) Then
|
||||
For Each item In blacklist.Split(","c)
|
||||
Dim letter = item.Trim().ToUpper().Replace(":", "")
|
||||
If letter.Length = 1 AndAlso Char.IsLetter(letter(0)) Then
|
||||
blacklistArray.Add(letter(0))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
' Alle aktuell verwendeten Laufwerksbuchstaben ermitteln
|
||||
Dim usedDrives As New List(Of Char)
|
||||
For Each drive As IO.DriveInfo In IO.DriveInfo.GetDrives()
|
||||
Dim letter As Char = drive.Name(0)
|
||||
usedDrives.Add(Char.ToUpper(letter))
|
||||
Next
|
||||
|
||||
' Alphabetisch absteigend von Z bis A durchgehen
|
||||
For i As Integer = Asc("Z"c) To Asc("A"c) Step -1
|
||||
Dim currentLetter As Char = Chr(i)
|
||||
|
||||
' Prüfen ob Buchstabe verfügbar ist
|
||||
If Not usedDrives.Contains(currentLetter) AndAlso Not blacklistArray.Contains(currentLetter) Then
|
||||
LOGGER.Debug($"Nächster freier Laufwerksbuchstabe gefunden: {currentLetter}:")
|
||||
Return currentLetter & ":"
|
||||
End If
|
||||
Next
|
||||
|
||||
LOGGER.Warn("Kein freier Laufwerksbuchstabe gefunden!")
|
||||
Return String.Empty
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler beim Ermitteln des nächsten freien Laufwerksbuchstabens: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Prüft ob ein Laufwerksbuchstabe verfügbar ist (nicht verwendet und nicht in Blacklist)
|
||||
''' </summary>
|
||||
''' <param name="driveLetter">Zu prüfender Laufwerksbuchstabe</param>
|
||||
''' <param name="blacklist">Liste der nicht erlaubten Laufwerksbuchstaben</param>
|
||||
''' <returns>True wenn verfügbar, False wenn bereits verwendet oder in Blacklist</returns>
|
||||
Public Shared Function IsDriveLetterAvailable(driveLetter As String, Optional blacklist As String = "") As Boolean
|
||||
Try
|
||||
' Formatierung sicherstellen
|
||||
driveLetter = driveLetter.Trim().ToUpper().Replace(":", "")
|
||||
If driveLetter.Length <> 1 OrElse Not Char.IsLetter(driveLetter(0)) Then
|
||||
LOGGER.Warn($"Ungültiger Laufwerksbuchstabe: {driveLetter}")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim letter As Char = driveLetter(0)
|
||||
|
||||
' Blacklist prüfen
|
||||
If Not String.IsNullOrEmpty(blacklist) Then
|
||||
For Each item In blacklist.Split(","c)
|
||||
Dim blacklistedLetter = item.Trim().ToUpper().Replace(":", "")
|
||||
If blacklistedLetter.Length = 1 AndAlso blacklistedLetter(0) = letter Then
|
||||
LOGGER.Debug($"Laufwerk {letter}: ist in der Blacklist")
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
' Prüfen ob bereits verwendet
|
||||
For Each drive As IO.DriveInfo In IO.DriveInfo.GetDrives()
|
||||
If Char.ToUpper(drive.Name(0)) = letter Then
|
||||
LOGGER.Debug($"Laufwerk {letter}: ist bereits verwendet")
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler beim Prüfen der Laufwerksverfügbarkeit: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Mappt ein Netzlaufwerk mit automatischer Laufwerksbuchstabenwahl oder spezifischem Buchstaben
|
||||
''' </summary>
|
||||
''' <param name="driveLetter">Gewünschter Laufwerksbuchstabe (leer = automatisch den nächsten freien wählen)</param>
|
||||
''' <param name="networkPath">UNC-Pfad des Netzwerkshares</param>
|
||||
''' <param name="blacklist">Komma-getrennte Liste verbotener Laufwerksbuchstaben (z.B. "Y,M,V")</param>
|
||||
''' <param name="userName">Optionaler Benutzername für Authentifizierung</param>
|
||||
''' <param name="password">Optionales Passwort für Authentifizierung</param>
|
||||
''' <param name="persistent">Soll das Mapping persistent sein?</param>
|
||||
''' <returns>Verwendeter Laufwerksbuchstabe bei Erfolg, String.Empty bei Fehler</returns>
|
||||
Public Shared Function MapNetworkDrive(driveLetter As String,
|
||||
networkPath As String,
|
||||
Optional blacklist As String = "",
|
||||
Optional userName As String = Nothing,
|
||||
Optional password As String = Nothing,
|
||||
Optional persistent As Boolean = True) As String
|
||||
Try
|
||||
Dim targetDriveLetter As String = ""
|
||||
|
||||
' Szenario 1: Kein Laufwerksbuchstabe angegeben -> Automatische Auswahl
|
||||
If String.IsNullOrEmpty(driveLetter) Then
|
||||
LOGGER.Info("Kein Laufwerksbuchstabe angegeben - suche nächsten freien Buchstaben...")
|
||||
targetDriveLetter = GetNextFreeDriveLetter(blacklist)
|
||||
|
||||
If String.IsNullOrEmpty(targetDriveLetter) Then
|
||||
LOGGER.Error("Kein freier Laufwerksbuchstabe verfügbar!")
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
LOGGER.Info($"Automatisch gewählter Laufwerksbuchstabe: {targetDriveLetter}")
|
||||
Else
|
||||
' Szenario 2: Spezifischer Laufwerksbuchstabe angegeben
|
||||
targetDriveLetter = driveLetter.Trim().ToUpper()
|
||||
If Not targetDriveLetter.EndsWith(":") Then
|
||||
targetDriveLetter &= ":"
|
||||
End If
|
||||
|
||||
' Prüfen ob Laufwerk verfügbar ist
|
||||
If Not IsDriveLetterAvailable(targetDriveLetter, blacklist) Then
|
||||
LOGGER.Error($"Laufwerk {targetDriveLetter} ist nicht verfügbar (bereits verwendet oder in Blacklist)")
|
||||
Return String.Empty
|
||||
End If
|
||||
End If
|
||||
|
||||
' Laufwerk mappen
|
||||
If MapNetworkDriveInternal(targetDriveLetter, networkPath, userName, password, persistent) Then
|
||||
LOGGER.Info($"✓ Netzlaufwerk {targetDriveLetter} erfolgreich gemappt zu {networkPath}")
|
||||
Return targetDriveLetter
|
||||
Else
|
||||
LOGGER.Error($"✗ Fehler beim Mappen von {targetDriveLetter}")
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler in MapNetworkDrive: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Interne Methode zum tatsächlichen Mappen eines Netzlaufwerks
|
||||
''' </summary>
|
||||
Private Shared Function MapNetworkDriveInternal(driveLetter As String,
|
||||
networkPath As String,
|
||||
userName As String,
|
||||
password As String,
|
||||
persistent As Boolean) As Boolean
|
||||
Try
|
||||
' Erst trennen falls vorhanden (ohne Fehler wenn nicht vorhanden)
|
||||
DisconnectNetworkDrive(driveLetter, True)
|
||||
|
||||
' NETRESOURCE-Struktur vorbereiten
|
||||
Dim netResource As New NETRESOURCE With {
|
||||
.dwType = RESOURCETYPE_DISK,
|
||||
.lpLocalName = driveLetter,
|
||||
.lpRemoteName = networkPath
|
||||
}
|
||||
|
||||
Dim flags As Integer = If(persistent, CONNECT_UPDATE_PROFILE, 0)
|
||||
|
||||
' WICHTIG: Credentials als Nothing übergeben = Verwende aktuelle Windows-Credentials
|
||||
' Wenn der Share öffentlich oder mit aktuellen Credentials erreichbar ist, funktioniert es
|
||||
Dim result As Integer = WNetAddConnection2(netResource, password, userName, flags)
|
||||
|
||||
Select Case result
|
||||
Case ERROR_SUCCESS
|
||||
LOGGER.Debug($"✓ Laufwerk {driveLetter} erfolgreich gemappt")
|
||||
Return True
|
||||
|
||||
Case 1326 ' ERROR_LOGON_FAILURE
|
||||
LOGGER.Error($"❌ Authentifizierungsfehler (1326): Anmeldung fehlgeschlagen für [{networkPath}]")
|
||||
LOGGER.Error($" → Der UNC-Pfad erfordert möglicherweise spezielle Credentials")
|
||||
LOGGER.Error($" → Oder der aktuelle Benutzer hat keine Berechtigung")
|
||||
Return False
|
||||
|
||||
Case 53 ' ERROR_BAD_NETPATH
|
||||
LOGGER.Error($"❌ Netzwerkpfad nicht gefunden (53): [{networkPath}]")
|
||||
Return False
|
||||
|
||||
Case 67 ' ERROR_BAD_NET_NAME
|
||||
LOGGER.Error($"❌ Netzwerkname ungültig (67): [{networkPath}]")
|
||||
Return False
|
||||
|
||||
Case 85 ' ERROR_ALREADY_ASSIGNED
|
||||
LOGGER.Warn($"⚠️ Laufwerk {driveLetter} ist bereits zugewiesen (85)")
|
||||
' Versuche es zu trennen und erneut zu verbinden
|
||||
DisconnectNetworkDrive(driveLetter, force:=True)
|
||||
System.Threading.Thread.Sleep(500) ' Kurze Pause
|
||||
result = WNetAddConnection2(netResource, password, userName, flags)
|
||||
If result = ERROR_SUCCESS Then
|
||||
LOGGER.Info($"✓ Laufwerk {driveLetter} nach erneutem Versuch erfolgreich gemappt")
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Case Else
|
||||
LOGGER.Error($"❌ WNetAddConnection2 Error Code: {result}")
|
||||
Return False
|
||||
End Select
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler in MapNetworkDriveInternal: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Test-Funktion um UNC-Pfad-Zugriff zu prüfen
|
||||
''' </summary>
|
||||
Public Shared Function TestUNCAccess(uncPath As String) As Boolean
|
||||
Try
|
||||
LOGGER.Info($"🔍 Teste Zugriff auf UNC-Pfad: [{uncPath}]")
|
||||
|
||||
' Teste ob Pfad existiert und erreichbar ist
|
||||
If System.IO.Directory.Exists(uncPath) Then
|
||||
LOGGER.Info($"✓ UNC-Pfad ist direkt erreichbar ohne Mapping")
|
||||
|
||||
' Teste Lese-Berechtigung
|
||||
Try
|
||||
Dim files = System.IO.Directory.GetFiles(uncPath)
|
||||
LOGGER.Info($"✓ Lese-Berechtigung vorhanden ({files.Length} Dateien gefunden)")
|
||||
Return True
|
||||
Catch permEx As UnauthorizedAccessException
|
||||
LOGGER.Error($"❌ Keine Lese-Berechtigung: {permEx.Message}")
|
||||
Return False
|
||||
End Try
|
||||
Else
|
||||
LOGGER.Error($"❌ UNC-Pfad nicht erreichbar oder existiert nicht")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"❌ Fehler beim Testen des UNC-Zugriffs: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Trennt ein Netzlaufwerk mit Windows-API
|
||||
''' </summary>
|
||||
Public Shared Function DisconnectNetworkDrive(driveLetter As String, Optional force As Boolean = True) As Boolean
|
||||
Try
|
||||
' Formatierung sicherstellen
|
||||
driveLetter = driveLetter.Trim().ToUpper()
|
||||
If Not driveLetter.EndsWith(":") Then
|
||||
driveLetter &= ":"
|
||||
End If
|
||||
|
||||
Dim flags As Integer = CONNECT_UPDATE_PROFILE
|
||||
Dim result As Integer = WNetCancelConnection2(driveLetter, flags, force)
|
||||
|
||||
If result = ERROR_SUCCESS Then
|
||||
LOGGER.Debug($"Netzlaufwerk {driveLetter} erfolgreich getrennt")
|
||||
Return True
|
||||
ElseIf result = ERROR_ALREADY_ASSIGNED Then
|
||||
LOGGER.Debug($"Netzlaufwerk {driveLetter} war nicht verbunden")
|
||||
Return True
|
||||
Else
|
||||
LOGGER.Warn($"Warnung beim Trennen von {driveLetter}: Error Code {result}")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Debug($"Fehler beim Trennen von {driveLetter} (ignoriert): {ex.Message}")
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Ermittelt alle gemappten Netzlaufwerke
|
||||
''' </summary>
|
||||
Public Shared Function GetMappedNetworkDrives() As List(Of NetworkDriveInfo)
|
||||
Dim mappedDrives As New List(Of NetworkDriveInfo)
|
||||
|
||||
Try
|
||||
For Each drive As IO.DriveInfo In IO.DriveInfo.GetDrives()
|
||||
If drive.DriveType = IO.DriveType.Network Then
|
||||
Dim driveInfo As New NetworkDriveInfo With {
|
||||
.DriveLetter = drive.Name,
|
||||
.NetworkPath = GetNetworkPath(drive.Name),
|
||||
.DriveType = drive.DriveType,
|
||||
.IsReady = drive.IsReady
|
||||
}
|
||||
|
||||
If drive.IsReady Then
|
||||
Try
|
||||
driveInfo.TotalSize = drive.TotalSize
|
||||
driveInfo.FreeSpace = drive.AvailableFreeSpace
|
||||
Catch ex As Exception
|
||||
LOGGER.Debug($"Konnte Größeninformationen für {drive.Name} nicht ermitteln: {ex.Message}")
|
||||
End Try
|
||||
End If
|
||||
|
||||
mappedDrives.Add(driveInfo)
|
||||
End If
|
||||
Next
|
||||
|
||||
LOGGER.Debug($"Insgesamt {mappedDrives.Count} Netzlaufwerk(e) gefunden")
|
||||
Return mappedDrives
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler beim Ermitteln der Netzlaufwerke: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return mappedDrives
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Ermittelt den UNC-Pfad eines gemappten Laufwerks
|
||||
''' </summary>
|
||||
Public Shared Function GetNetworkPath(driveLetter As String) As String
|
||||
Try
|
||||
driveLetter = driveLetter.Trim().ToUpper()
|
||||
If Not driveLetter.EndsWith(":") Then
|
||||
driveLetter &= ":"
|
||||
End If
|
||||
|
||||
Dim network As Object = CreateObject("WScript.Network")
|
||||
Dim enumDrives As Object = network.EnumNetworkDrives()
|
||||
|
||||
For i As Integer = 0 To enumDrives.Count - 1 Step 2
|
||||
If enumDrives.Item(i).ToString.Equals(driveLetter, StringComparison.OrdinalIgnoreCase) Then
|
||||
Return enumDrives.Item(i + 1).ToString()
|
||||
End If
|
||||
Next
|
||||
|
||||
Return String.Empty
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Debug($"Fehler beim Ermitteln des Netzwerkpfads für {driveLetter}: {ex.Message}")
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Prüft ob ein bestimmtes Laufwerk als Netzlaufwerk gemappt ist
|
||||
''' </summary>
|
||||
Public Shared Function IsDriveMapped(driveLetter As String) As Boolean
|
||||
Try
|
||||
driveLetter = driveLetter.Trim().ToUpper()
|
||||
If Not driveLetter.EndsWith(":") Then
|
||||
driveLetter &= ":"
|
||||
End If
|
||||
If Not driveLetter.EndsWith("\") Then
|
||||
driveLetter &= "\"
|
||||
End If
|
||||
|
||||
Dim driveInfo As New IO.DriveInfo(driveLetter)
|
||||
Return driveInfo.DriveType = IO.DriveType.Network AndAlso driveInfo.IsReady
|
||||
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Gibt eine formatierte Übersicht aller gemappten Netzlaufwerke zurück
|
||||
''' </summary>
|
||||
Public Shared Function GetMappedDrivesInfo() As String
|
||||
Dim result As New System.Text.StringBuilder()
|
||||
Dim drives = GetMappedNetworkDrives()
|
||||
|
||||
If drives.Count = 0 Then
|
||||
Return "Keine Netzlaufwerke gefunden."
|
||||
End If
|
||||
|
||||
result.AppendLine($"Gemappte Netzlaufwerke ({drives.Count}):")
|
||||
result.AppendLine(New String("-"c, 60))
|
||||
|
||||
For Each drive In drives
|
||||
result.AppendLine($"Laufwerk: {drive.DriveLetter}")
|
||||
result.AppendLine($" Pfad: {drive.NetworkPath}")
|
||||
result.AppendLine($" Status: {If(drive.IsReady, "Verfügbar", "Nicht verfügbar")}")
|
||||
|
||||
If drive.IsReady AndAlso drive.TotalSize > 0 Then
|
||||
Dim totalGB As Double = drive.TotalSize / (1024.0 ^ 3)
|
||||
Dim freeGB As Double = drive.FreeSpace / (1024.0 ^ 3)
|
||||
result.AppendLine($" Größe: {totalGB:N2} GB (Frei: {freeGB:N2} GB)")
|
||||
End If
|
||||
|
||||
result.AppendLine()
|
||||
Next
|
||||
|
||||
Return result.ToString()
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Mappt ein spezifisches Laufwerk (z.B. "V") mit Blacklist-Prüfung
|
||||
''' </summary>
|
||||
Public Function MapSpecificDrive(driveLetter As String, blacklist As String, networkPath As String) As Boolean
|
||||
Try
|
||||
' Formatierung sicherstellen
|
||||
driveLetter = driveLetter.Trim().ToUpper().Replace(":", "")
|
||||
|
||||
If String.IsNullOrEmpty(driveLetter) OrElse driveLetter.Length <> 1 Then
|
||||
LOGGER.Warn($"⚠️ Ungültiger Laufwerksbuchstabe: [{driveLetter}]")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim driveWithColon As String = driveLetter & ":"
|
||||
|
||||
' Prüfen ob Laufwerk verfügbar ist
|
||||
If Not IsDriveLetterAvailable(driveWithColon, blacklist) Then
|
||||
LOGGER.Warn($"⚠️ Laufwerk {driveWithColon} ist nicht verfügbar (bereits verwendet oder in Blacklist)")
|
||||
Return False
|
||||
End If
|
||||
|
||||
' UNC-Pfad vorbereiten (ohne abschließenden Backslash)
|
||||
Dim uncPath As String = networkPath.TrimEnd("\"c)
|
||||
|
||||
' Laufwerk mappen (OHNE Credentials, persistent=False für temporäres Mapping)
|
||||
Dim result = MapNetworkDrive(driveWithColon, uncPath, blacklist, userName:=Nothing, password:=Nothing, persistent:=False)
|
||||
|
||||
If Not String.IsNullOrEmpty(result) Then
|
||||
LOGGER.Debug($"✓ Laufwerk {driveWithColon} erfolgreich gemappt zu [{uncPath}]")
|
||||
Return True
|
||||
Else
|
||||
LOGGER.Error($"❌ Fehler beim Mappen von {driveWithColon}")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler in MapSpecificDrive: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Mappt automatisch den nächsten freien Laufwerksbuchstaben (Z→A)
|
||||
''' </summary>
|
||||
Public Function MapDriveAutomatic(blacklist As String, networkPath As String) As String
|
||||
Try
|
||||
' UNC-Pfad vorbereiten (ohne abschließenden Backslash)
|
||||
Dim uncPath As String = networkPath.TrimEnd("\"c)
|
||||
|
||||
LOGGER.Debug($"🔍 Suche automatisch freien Laufwerksbuchstaben...")
|
||||
LOGGER.Debug($" Blacklist: [{blacklist}]")
|
||||
LOGGER.Debug($" Netzwerkpfad: [{uncPath}]")
|
||||
|
||||
' Automatisches Mapping (leer = automatische Auswahl, persistent=False)
|
||||
Dim result = MapNetworkDrive("", uncPath, blacklist, userName:=Nothing, password:=Nothing, persistent:=False)
|
||||
|
||||
If Not String.IsNullOrEmpty(result) Then
|
||||
LOGGER.Debug($"✓ Automatisch gewähltes Laufwerk: {result}")
|
||||
Return result
|
||||
Else
|
||||
LOGGER.Error($"❌ Kein freier Laufwerksbuchstabe verfügbar")
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler in MapDriveAutomatic: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
''' <summary>
|
||||
''' Zentrale Klasse für Dokumentenpfad-Verwaltung mit optionalem Laufwerks-Mapping und Temp-Kopie
|
||||
''' </summary>
|
||||
Public Class ClassDocumentPathHandler
|
||||
|
||||
Private ReadOnly _logger As Logger
|
||||
Private _mappedDrive As String = ""
|
||||
|
||||
''' <summary>
|
||||
''' Initialisiert den DocumentPathHandler
|
||||
''' </summary>
|
||||
''' <param name="logger">Logger-Instanz</param>
|
||||
Public Sub New(logger As Logger)
|
||||
_logger = logger
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Verarbeitet einen Dokumentenpfad: Optional Mapping, dann Temp-Kopie
|
||||
''' </summary>
|
||||
''' <param name="sourcePath">Quell-Pfad der Datei (UNC oder lokal)</param>
|
||||
''' <param name="options">Optionen für die Verarbeitung</param>
|
||||
''' <returns>DocumentPathResult mit finalem Pfad und Mapping-Info</returns>
|
||||
Public Function ProcessDocumentPath(sourcePath As String, options As DocumentPathOptions) As DocumentPathResult
|
||||
Dim result As New DocumentPathResult With {
|
||||
.SourcePath = sourcePath,
|
||||
.FinalPath = sourcePath,
|
||||
.Success = False,
|
||||
.WasMapped = False,
|
||||
.WasCopiedToTemp = False
|
||||
}
|
||||
|
||||
Try
|
||||
' Validierung
|
||||
If String.IsNullOrEmpty(sourcePath) Then
|
||||
result.ErrorMessage = "Quell-Pfad ist leer"
|
||||
_logger.Error("❌ ProcessDocumentPath: Quell-Pfad ist leer")
|
||||
Return result
|
||||
End If
|
||||
|
||||
Dim workingPath As String = sourcePath
|
||||
|
||||
' ========== SCHRITT 1: OPTIONALES LAUFWERKS-MAPPING ==========
|
||||
If options.EnableMapping AndAlso Not String.IsNullOrEmpty(options.WMSuffix) Then
|
||||
Dim mappingResult = TryMapNetworkDrive(sourcePath, options)
|
||||
If mappingResult.Success Then
|
||||
workingPath = mappingResult.MappedPath
|
||||
_mappedDrive = mappingResult.DriveLetter
|
||||
result.WasMapped = True
|
||||
result.MappedDrive = _mappedDrive
|
||||
_logger.Info($"✓ Laufwerk gemappt: {_mappedDrive}")
|
||||
Else
|
||||
_logger.Warn("⚠️ Laufwerks-Mapping fehlgeschlagen - verwende Original-UNC-Pfad")
|
||||
workingPath = sourcePath
|
||||
End If
|
||||
End If
|
||||
|
||||
' ========== SCHRITT 2: PRÜFEN OB DATEI EXISTIERT ==========
|
||||
If Not File.Exists(workingPath) Then
|
||||
result.ErrorMessage = $"Datei nicht gefunden: [{workingPath}]"
|
||||
_logger.Error($"❌ {result.ErrorMessage}")
|
||||
|
||||
' Cleanup bei Fehler
|
||||
If result.WasMapped Then
|
||||
UnmapDrive()
|
||||
End If
|
||||
|
||||
Return result
|
||||
End If
|
||||
|
||||
' ========== SCHRITT 3: OPTIONALE TEMP-KOPIE ==========
|
||||
If options.CopyToTemp Then
|
||||
Dim tempResult = CopyToTempFolder(workingPath, options.TempFolder)
|
||||
If tempResult.Success Then
|
||||
result.FinalPath = tempResult.TempPath
|
||||
result.WasCopiedToTemp = True
|
||||
result.TempPath = tempResult.TempPath
|
||||
_logger.Info($"✓ Datei in Temp kopiert: [{Path.GetFileName(tempResult.TempPath)}]")
|
||||
|
||||
' Laufwerk unmappen nach erfolgreicher Kopie
|
||||
If result.WasMapped AndAlso options.UnmapAfterCopy Then
|
||||
UnmapDrive()
|
||||
result.WasMapped = False ' Wurde bereits getrennt
|
||||
End If
|
||||
Else
|
||||
_logger.Warn($"⚠️ Temp-Kopie fehlgeschlagen: {tempResult.ErrorMessage}")
|
||||
result.FinalPath = workingPath
|
||||
|
||||
' Cleanup bei Fehler
|
||||
If result.WasMapped Then
|
||||
UnmapDrive()
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
result.FinalPath = workingPath
|
||||
_logger.Debug($"📄 Verwende Pfad ohne Temp-Kopie: [{workingPath}]")
|
||||
End If
|
||||
|
||||
result.Success = True
|
||||
Return result
|
||||
|
||||
Catch ex As Exception
|
||||
result.ErrorMessage = $"Unerwarteter Fehler: {ex.Message}"
|
||||
_logger.Error($"❌ ProcessDocumentPath: {ex.Message}")
|
||||
_logger.Error(ex)
|
||||
|
||||
' Cleanup bei Exception
|
||||
If result.WasMapped Then
|
||||
UnmapDrive()
|
||||
End If
|
||||
|
||||
Return result
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Versucht ein Netzlaufwerk zu mappen
|
||||
''' </summary>
|
||||
Private Function TryMapNetworkDrive(sourcePath As String, options As DocumentPathOptions) As MappingResult
|
||||
Dim result As New MappingResult With {.Success = False}
|
||||
|
||||
Try
|
||||
' Prüfen ob Pfad mit WMSUFFIX beginnt
|
||||
If Not sourcePath.StartsWith(options.WMSuffix, StringComparison.OrdinalIgnoreCase) Then
|
||||
_logger.Debug($"📄 Pfad beginnt nicht mit WMSUFFIX - kein Mapping erforderlich")
|
||||
Return result
|
||||
End If
|
||||
|
||||
_logger.Debug($"📂 WMSUFFIX erkannt - starte Laufwerks-Mapping")
|
||||
|
||||
' Laufwerk mappen
|
||||
Dim mappedDrive As String = ""
|
||||
Dim allgFunk As New ClassAllgemeineFunktionen()
|
||||
|
||||
If Not String.IsNullOrEmpty(options.SpecificDrive) AndAlso options.SpecificDrive.Length = 1 Then
|
||||
' Spezifisches Laufwerk
|
||||
If allgFunk.MapSpecificDrive(options.SpecificDrive, options.DriveBlacklist, options.WMSuffix) Then
|
||||
mappedDrive = options.SpecificDrive & ":"
|
||||
End If
|
||||
Else
|
||||
' Automatisches Mapping
|
||||
mappedDrive = allgFunk.MapDriveAutomatic(options.DriveBlacklist, options.WMSuffix)
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(mappedDrive) Then
|
||||
_logger.Warn("⚠️ Kein Laufwerk gemappt")
|
||||
Return result
|
||||
End If
|
||||
|
||||
' Pfad umschreiben
|
||||
Dim relativePath As String = sourcePath.Substring(options.WMSuffix.Length)
|
||||
If relativePath.StartsWith("\") Then
|
||||
relativePath = relativePath.Substring(1)
|
||||
End If
|
||||
|
||||
Dim mappedPath As String = mappedDrive.TrimEnd(":"c, "\"c) & ":\" & relativePath
|
||||
|
||||
_logger.Debug($"📄 Original: [{sourcePath}]")
|
||||
_logger.Debug($"📄 Gemappt: [{mappedPath}]")
|
||||
|
||||
result.Success = True
|
||||
result.DriveLetter = mappedDrive
|
||||
result.MappedPath = mappedPath
|
||||
Return result
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error($"Fehler beim Mapping: {ex.Message}")
|
||||
_logger.Error(ex)
|
||||
Return result
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Kopiert Datei in Temp-Ordner mit eindeutigem Zeitstempel
|
||||
''' </summary>
|
||||
Private Function CopyToTempFolder(sourcePath As String, tempFolder As String) As TempCopyResult
|
||||
Dim result As New TempCopyResult With {.Success = False}
|
||||
|
||||
Try
|
||||
' Temp-Ordner validieren
|
||||
If String.IsNullOrEmpty(tempFolder) Then
|
||||
result.ErrorMessage = "Temp-Ordner nicht gesetzt"
|
||||
_logger.Warn("⚠️ TEMP_DOCUMENT_FOLDER ist nicht gesetzt")
|
||||
|
||||
If Not frmValidator.InitializeTempFolder() Then
|
||||
result.ErrorMessage = "Temp-Ordner konnte nicht initialisiert werden"
|
||||
Return result
|
||||
End If
|
||||
|
||||
tempFolder = TEMP_DOCUMENT_FOLDER
|
||||
End If
|
||||
|
||||
If Not Directory.Exists(tempFolder) Then
|
||||
result.ErrorMessage = $"Temp-Ordner existiert nicht: [{tempFolder}]"
|
||||
_logger.Error($"❌ {result.ErrorMessage}")
|
||||
Return result
|
||||
End If
|
||||
|
||||
' Eindeutigen Dateinamen generieren
|
||||
Dim originalFileName As String = Path.GetFileName(sourcePath)
|
||||
Dim fileNameWithoutExt As String = Path.GetFileNameWithoutExtension(originalFileName)
|
||||
Dim extension As String = Path.GetExtension(originalFileName)
|
||||
Dim timestamp As String = DateTime.Now.ToString("yyyyMMdd_HHmmss_fff")
|
||||
Dim uniqueFileName As String = $"{fileNameWithoutExt}_{timestamp}{extension}"
|
||||
Dim targetPath As String = Path.Combine(tempFolder, uniqueFileName)
|
||||
|
||||
_logger.Debug($"📄 Kopiere nach Temp:")
|
||||
_logger.Debug($" Von: [{sourcePath}]")
|
||||
_logger.Debug($" Nach: [{targetPath}]")
|
||||
|
||||
' Datei kopieren
|
||||
File.Copy(sourcePath, targetPath, overwrite:=True)
|
||||
|
||||
result.Success = True
|
||||
result.TempPath = targetPath
|
||||
result.TempFileName = uniqueFileName
|
||||
Return result
|
||||
|
||||
Catch ex As Exception
|
||||
result.ErrorMessage = $"Fehler beim Kopieren: {ex.Message}"
|
||||
_logger.Error($"❌ {result.ErrorMessage}")
|
||||
_logger.Error(ex)
|
||||
Return result
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Trennt das gemappte Laufwerk
|
||||
''' </summary>
|
||||
Public Sub UnmapDrive()
|
||||
If Not String.IsNullOrEmpty(_mappedDrive) Then
|
||||
Try
|
||||
If ClassAllgemeineFunktionen.DisconnectNetworkDrive(_mappedDrive, force:=True) Then
|
||||
_logger.Info($"🔌 Laufwerk {_mappedDrive} getrennt")
|
||||
Else
|
||||
_logger.Warn($"⚠️ Warnung beim Trennen von {_mappedDrive}")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_logger.Debug($"Fehler beim Trennen von {_mappedDrive}: {ex.Message}")
|
||||
Finally
|
||||
_mappedDrive = ""
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Cleanup-Methode (z.B. beim Schließen des Forms)
|
||||
''' </summary>
|
||||
Public Sub Cleanup()
|
||||
UnmapDrive()
|
||||
End Sub
|
||||
|
||||
#Region "Nested Classes für Optionen und Ergebnisse"
|
||||
|
||||
''' <summary>
|
||||
''' Optionen für die Dokumentenpfad-Verarbeitung
|
||||
''' </summary>
|
||||
Public Class DocumentPathOptions
|
||||
''' <summary>Soll Laufwerks-Mapping versucht werden?</summary>
|
||||
Public Property EnableMapping As Boolean = False
|
||||
|
||||
''' <summary>WMSUFFIX für Mapping-Erkennung (z.B. "\\windream\objects")</summary>
|
||||
Public Property WMSuffix As String = ""
|
||||
|
||||
''' <summary>Spezifischer Laufwerksbuchstabe (z.B. "V") oder leer für automatisch</summary>
|
||||
Public Property SpecificDrive As String = ""
|
||||
|
||||
''' <summary>Blacklist für Laufwerksbuchstaben (z.B. "Y,M,V")</summary>
|
||||
Public Property DriveBlacklist As String = ""
|
||||
|
||||
''' <summary>Soll Datei in Temp kopiert werden?</summary>
|
||||
Public Property CopyToTemp As Boolean = False
|
||||
|
||||
''' <summary>Temp-Ordner-Pfad</summary>
|
||||
Public Property TempFolder As String = ""
|
||||
|
||||
''' <summary>Laufwerk nach erfolgreicher Temp-Kopie unmappen?</summary>
|
||||
Public Property UnmapAfterCopy As Boolean = True
|
||||
End Class
|
||||
|
||||
''' <summary>
|
||||
''' Ergebnis der Dokumentenpfad-Verarbeitung
|
||||
''' </summary>
|
||||
Public Class DocumentPathResult
|
||||
Public Property Success As Boolean
|
||||
Public Property SourcePath As String
|
||||
Public Property FinalPath As String
|
||||
Public Property ErrorMessage As String
|
||||
Public Property WasMapped As Boolean
|
||||
Public Property MappedDrive As String
|
||||
Public Property WasCopiedToTemp As Boolean
|
||||
Public Property TempPath As String
|
||||
End Class
|
||||
|
||||
Private Class MappingResult
|
||||
Public Property Success As Boolean
|
||||
Public Property DriveLetter As String
|
||||
Public Property MappedPath As String
|
||||
End Class
|
||||
|
||||
Private Class TempCopyResult
|
||||
Public Property Success As Boolean
|
||||
Public Property TempPath As String
|
||||
Public Property TempFileName As String
|
||||
Public Property ErrorMessage As String
|
||||
End Class
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -155,52 +155,64 @@
|
||||
End Function
|
||||
Public Function GetVariableValue(oAttributeName As String, Optional oIDBTyp As Integer = 0, Optional FromIDB As Boolean = False) As Object
|
||||
Try
|
||||
Dim oSingleAttribute As Boolean = True
|
||||
Select Case oIDBTyp
|
||||
Case 8
|
||||
oSingleAttribute = False
|
||||
Case 9
|
||||
oSingleAttribute = False
|
||||
End Select
|
||||
Dim oAttributeValue
|
||||
LOGGER.Debug($"IDBData - GetVariableValue - oSingleAttribute [{oSingleAttribute.ToString}] - FromIDB [{FromIDB.ToString}]")
|
||||
If oSingleAttribute = True And IDB_DT_DOC_DATA.Rows.Count = 1 And FromIDB = False Then
|
||||
' Bestimme, ob es sich um ein Single-Value-Attribut handelt (nicht Typ 8 oder 9)
|
||||
Dim oIsSingleAttribute As Boolean = (oIDBTyp <> 8 AndAlso oIDBTyp <> 9)
|
||||
|
||||
LOGGER.Debug($"IDBData - GetVariableValue - Attribute: [{oAttributeName}] - IsSingleAttribute: [{oIsSingleAttribute}] - FromIDB: [{FromIDB}]")
|
||||
|
||||
' Schnellpfad: Direkt aus gecachter DataTable holen
|
||||
If oIsSingleAttribute AndAlso IDB_DT_DOC_DATA.Rows.Count = 1 AndAlso Not FromIDB Then
|
||||
Try
|
||||
If oAttributeName = "IDBCreatedWhen" Then
|
||||
oAttributeName = "ADDED_WHEN"
|
||||
ElseIf oAttributeName = "IDBCreatedWho" Then
|
||||
oAttributeName = "ADDED_WHO"
|
||||
ElseIf oAttributeName = "IDBChangedWhen" Then
|
||||
oAttributeName = "CHANGED_WHEN"
|
||||
ElseIf oAttributeName = "IDBChangedWho" Then
|
||||
oAttributeName = "CHANGED_WHO"
|
||||
End If
|
||||
LOGGER.Debug($"IDBData - GetVariableValue - IDB_DT_DOC_DATA.Rows.Count = 1")
|
||||
oAttributeValue = IDB_DT_DOC_DATA.Rows(0).Item(oAttributeName)
|
||||
Dim oMappedName As String = MapSystemAttributeName(oAttributeName)
|
||||
Dim oValue As Object = IDB_DT_DOC_DATA.Rows(0).Item(oMappedName)
|
||||
LOGGER.Debug($"IDBData - GetVariableValue - Retrieved from cache: Attribute=[{oAttributeName}] MappedName=[{oMappedName}] Value=[{oValue}]")
|
||||
Return oValue
|
||||
Catch ex As Exception
|
||||
LOGGER.Debug($"Error getting Attribute from IDB_DT_DOC_DATA: {ex.Message}")
|
||||
' Fallthrough zum Datenbank-Fallback
|
||||
End Try
|
||||
End If
|
||||
|
||||
End If
|
||||
If Not IsNothing(oAttributeValue) Then
|
||||
LOGGER.Debug($"IDBData - GetVariableValue - Returning value: [{oAttributeValue}]")
|
||||
Return oAttributeValue
|
||||
' Fallback: Wert aus Datenbank über Funktion holen
|
||||
LOGGER.Debug($"Retrieving value for attribute [{oAttributeName}] via FNIDB_PM_GET_VARIABLE_VALUE")
|
||||
|
||||
Dim oSQL As String = $"SELECT * FROM [dbo].[FNIDB_PM_GET_VARIABLE_VALUE] ({CURRENT_DOC_ID},'{oAttributeName}','{USER_LANGUAGE}',CONVERT(BIT,'{IDB_USES_WMFILESTORE}'))"
|
||||
LOGGER.Debug($"SQL: {oSQL}")
|
||||
|
||||
Dim oResultTable As DataTable = DatabaseFallback.GetDatatableIDB(oSQL)
|
||||
|
||||
If oResultTable IsNot Nothing AndAlso oResultTable.Rows.Count = 1 Then
|
||||
Dim oValue As Object = oResultTable.Rows(0).Item(0)
|
||||
LOGGER.Debug($"IDBData - GetVariableValue - Retrieved from DB: [{oValue}]")
|
||||
Return oValue
|
||||
Else
|
||||
LOGGER.Debug($"oAttributeValue for Attribute [{oAttributeName}] is so far nothing..Now trying FNIDB_PM_GET_VARIABLE_VALUE ")
|
||||
LOGGER.Info($"IDBData - GetVariableValue - No value found in DB for attribute [{oAttributeName}] - SQL [{oSQL}]")
|
||||
End If
|
||||
Dim oFNSQL = $"SELECT * FROM [dbo].[FNIDB_PM_GET_VARIABLE_VALUE] ({CURRENT_DOC_ID},'{oAttributeName}','{USER_LANGUAGE}',CONVERT(BIT,'{IDB_USES_WMFILESTORE}'))"
|
||||
LOGGER.Debug($": {oFNSQL}")
|
||||
oAttributeValue = DatabaseFallback.GetDatatableIDB(oFNSQL)
|
||||
Dim odt As DataTable = oAttributeValue
|
||||
If odt.Rows.Count = 1 Then
|
||||
oAttributeValue = odt.Rows(0).Item(0)
|
||||
End If
|
||||
Return oAttributeValue
|
||||
|
||||
Return oResultTable
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Mappt System-Attributnamen auf interne Spaltennamen.
|
||||
''' </summary>
|
||||
Private Function MapSystemAttributeName(attributeName As String) As String
|
||||
Select Case attributeName
|
||||
Case "IDBCreatedWhen"
|
||||
Return "ADDED_WHEN"
|
||||
Case "IDBCreatedWho"
|
||||
Return "ADDED_WHO"
|
||||
Case "IDBChangedWhen"
|
||||
Return "CHANGED_WHEN"
|
||||
Case "IDBChangedWho"
|
||||
Return "CHANGED_WHO"
|
||||
Case Else
|
||||
Return attributeName
|
||||
End Select
|
||||
End Function
|
||||
Public Function Delete_Term_Object_From_Metadata(oAttributeName As String, oTerm2Delete As String) As Object
|
||||
Try
|
||||
|
||||
@@ -35,7 +35,7 @@ Public Class ClassPMWindream
|
||||
#End Region
|
||||
|
||||
#Region "+++++ Variablen +++++"
|
||||
Private oController As New WMOSearchController
|
||||
'Private oController As New WMOSearchController
|
||||
#End Region
|
||||
|
||||
#Region "+++++ Allgemeine Methoden und Funktionen +++++"
|
||||
|
||||
@@ -60,241 +60,242 @@ Public Class ClassParamRefresh
|
||||
' Use For Each loop over words and display them.
|
||||
Dim oMode As String
|
||||
For Each oMode In oSplitWorkMode
|
||||
LOGGER.Debug($"oWorkingMode Parameter: {oMode}")
|
||||
If oMode = "PM.FORCE_LAYOUT_OVERVIEW" Then
|
||||
FORCE_LAYOUT_OVERVIEW = True
|
||||
LOGGER.Debug($"FORCE_LAYOUT_OVERVIEW [{FORCE_LAYOUT_OVERVIEW}]")
|
||||
ElseIf oMode = "PM.NO_MASS_VALIDATOR" Then
|
||||
SHOW_MASS_VALIDATOR = False
|
||||
LOGGER.Info($"SHOW_MASS_VALIDATOR [{SHOW_MASS_VALIDATOR}]")
|
||||
ElseIf oMode = "PM.NO_CHARTS" Then
|
||||
SHOW_CHARTS = False
|
||||
LOGGER.Debug($"SHOW_CHARTS [{SHOW_CHARTS}]")
|
||||
ElseIf oMode = "PM.DEBUG_LOG" Then
|
||||
DEBUG = True
|
||||
LOGCONFIG.Debug = True
|
||||
ElseIf oMode = "PM.LOG_HOTSPOTS" Then
|
||||
LOG_HOTSPOTS = True
|
||||
ElseIf oMode.StartsWith("OPERATION_MODE_FS") Then
|
||||
OPERATION_MODE_FS = oMode.Replace("OPERATION_MODE_FS=", "")
|
||||
If OPERATION_MODE_FS = ClassConstants.OpModeFS_IDBWM Then
|
||||
IDB_USES_WMFILESTORE = True
|
||||
End If
|
||||
LOGGER.Info("OPERATION_MODE_FS: " + OPERATION_MODE_FS)
|
||||
ElseIf oMode = "PM.IDBWITHWMFS" Then
|
||||
IDB_USES_WMFILESTORE = True
|
||||
ElseIf oMode = "PM.NO_BASICCONF" Then
|
||||
BASIC_CONF_VISIBLE = False
|
||||
LOGGER.Info($"BASIC_CONF_VISIBLE [{BASIC_CONF_VISIBLE}]")
|
||||
ElseIf oMode = "PM.SYS_LOCKED_MAINTENANCE" Then
|
||||
SYS_LOCKED_MAINTENANCE = True
|
||||
ElseIf oMode.StartsWith("PM.IDB_CONID!") Then
|
||||
If CONNECTION_STRING_IDB <> "" And dbIDBInitialized = True Then
|
||||
IDB_ACTIVE = True
|
||||
Continue For
|
||||
Else
|
||||
Dim Database_IDB As MSSQLServer = Nothing
|
||||
Dim CON_ID = oMode.Replace("PM.IDB_CONID!", "")
|
||||
Dim oConString = DatabaseFallback.GetConnectionString(CON_ID)
|
||||
CONNECTION_STRING_IDB = oConString
|
||||
Database_IDB = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_IDB)
|
||||
If Database_IDB.DBInitialized = True Then
|
||||
IDB_ACTIVE = True
|
||||
LOGGER.Info($"IDB is active - IDB-Connection [{CON_ID}]!")
|
||||
DatabaseFallback.InitializeIDB(Database_IDB)
|
||||
Else
|
||||
IDB_ACTIVE = False
|
||||
End If
|
||||
End If
|
||||
ElseIf oMode = "PM.EXCEL_OVERVIEW" Then
|
||||
EXCEL_OVERVIEW = True
|
||||
LOGGER.Info($"EXCEL_OVERVIEW [{EXCEL_OVERVIEW}]")
|
||||
ElseIf oMode = "PM.MONITORING" Then
|
||||
MONITORING_ACTIVE = True
|
||||
LOGGER.Debug($"MONITORING_ACTIVE [{MONITORING_ACTIVE}]")
|
||||
ElseIf oMode = "PM.GHOSTMODE" Then
|
||||
GHOSTMODE_ACTIVE = True
|
||||
LOGGER.Info($"GHOSTMODE_ACTIVE [{GHOSTMODE_ACTIVE}]")
|
||||
ElseIf oMode.StartsWith("PM.COLORSCHEME") Then
|
||||
Dim oColorScheme = oMode.Replace("PM.COLORSCHEME=", "")
|
||||
RIBBON_COLOR_SCHEME = oColorScheme.ToUpper
|
||||
LOGGER.Debug($"RIBBON_COLOR_SCHEME [{RIBBON_COLOR_SCHEME}]")
|
||||
ElseIf oMode.StartsWith("PM.NO_DETAIL_PROFILES") Then
|
||||
NO_DETAIL_PROFILES = True
|
||||
LOGGER.Debug($"NO_DETAIL_PROFILES [{NO_DETAIL_PROFILES}]")
|
||||
ElseIf oMode = "PM.NO_POPUP" Then
|
||||
POPUP_REMINDER_ACTIVE = False
|
||||
LOGGER.Debug($"POPUP_REMINDER_ACTIVE [{POPUP_REMINDER_ACTIVE}]")
|
||||
ElseIf oMode.StartsWith("PM.POPUP_TIMELAPS_OVERRIDE") Then
|
||||
Dim oTimeLapse = oMode.Replace("PM.POPUP_TIMELAPS_OVERRIDE=", "")
|
||||
LOGGER.Info($"CENTRAL POPUP_TIMELAPS_OVERRIDE [{oTimeLapse}]")
|
||||
Try
|
||||
CONFIG.Config.ReminderTimer = oTimeLapse
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
ProcessWorkingModeParameter(oMode, pMode)
|
||||
'LOGGER.Debug($"oWorkingMode Parameter: {oMode}")
|
||||
'If oMode = "PM.FORCE_LAYOUT_OVERVIEW" Then
|
||||
' FORCE_LAYOUT_OVERVIEW = True
|
||||
' LOGGER.Debug($"FORCE_LAYOUT_OVERVIEW [{FORCE_LAYOUT_OVERVIEW}]")
|
||||
'ElseIf oMode = "PM.NO_MASS_VALIDATOR" Then
|
||||
' SHOW_MASS_VALIDATOR = False
|
||||
' LOGGER.Info($"SHOW_MASS_VALIDATOR [{SHOW_MASS_VALIDATOR}]")
|
||||
'ElseIf oMode = "PM.NO_CHARTS" Then
|
||||
' SHOW_CHARTS = False
|
||||
' LOGGER.Debug($"SHOW_CHARTS [{SHOW_CHARTS}]")
|
||||
'ElseIf oMode = "PM.DEBUG_LOG" Then
|
||||
' DEBUG = True
|
||||
' LOGCONFIG.Debug = True
|
||||
'ElseIf oMode = "PM.LOG_HOTSPOTS" Then
|
||||
' LOG_HOTSPOTS = True
|
||||
'ElseIf oMode.StartsWith("OPERATION_MODE_FS") Then
|
||||
' OPERATION_MODE_FS = oMode.Replace("OPERATION_MODE_FS=", "")
|
||||
' If OPERATION_MODE_FS = ClassConstants.OpModeFS_IDBWM Then
|
||||
' IDB_USES_WMFILESTORE = True
|
||||
' End If
|
||||
' LOGGER.Info("OPERATION_MODE_FS: " + OPERATION_MODE_FS)
|
||||
'ElseIf oMode = "PM.IDBWITHWMFS" Then
|
||||
' IDB_USES_WMFILESTORE = True
|
||||
'ElseIf oMode = "PM.NO_BASICCONF" Then
|
||||
' BASIC_CONF_VISIBLE = False
|
||||
' LOGGER.Info($"BASIC_CONF_VISIBLE [{BASIC_CONF_VISIBLE}]")
|
||||
'ElseIf oMode = "PM.SYS_LOCKED_MAINTENANCE" Then
|
||||
' SYS_LOCKED_MAINTENANCE = True
|
||||
'ElseIf oMode.StartsWith("PM.IDB_CONID!") Then
|
||||
' If CONNECTION_STRING_IDB <> "" And dbIDBInitialized = True Then
|
||||
' IDB_ACTIVE = True
|
||||
' Continue For
|
||||
' Else
|
||||
' Dim Database_IDB As MSSQLServer = Nothing
|
||||
' Dim CON_ID = oMode.Replace("PM.IDB_CONID!", "")
|
||||
' Dim oConString = DatabaseFallback.GetConnectionString(CON_ID)
|
||||
' CONNECTION_STRING_IDB = oConString
|
||||
' Database_IDB = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_IDB)
|
||||
' If Database_IDB.DBInitialized = True Then
|
||||
' IDB_ACTIVE = True
|
||||
' LOGGER.Info($"IDB is active - IDB-Connection [{CON_ID}]!")
|
||||
' DatabaseFallback.InitializeIDB(Database_IDB)
|
||||
' Else
|
||||
' IDB_ACTIVE = False
|
||||
' End If
|
||||
' End If
|
||||
'ElseIf oMode = "PM.EXCEL_OVERVIEW" Then
|
||||
' EXCEL_OVERVIEW = True
|
||||
' LOGGER.Info($"EXCEL_OVERVIEW [{EXCEL_OVERVIEW}]")
|
||||
'ElseIf oMode = "PM.MONITORING" Then
|
||||
' MONITORING_ACTIVE = True
|
||||
' LOGGER.Debug($"MONITORING_ACTIVE [{MONITORING_ACTIVE}]")
|
||||
'ElseIf oMode = "PM.GHOSTMODE" Then
|
||||
' GHOSTMODE_ACTIVE = True
|
||||
' LOGGER.Info($"GHOSTMODE_ACTIVE [{GHOSTMODE_ACTIVE}]")
|
||||
'ElseIf oMode.StartsWith("PM.COLORSCHEME") Then
|
||||
' Dim oColorScheme = oMode.Replace("PM.COLORSCHEME=", "")
|
||||
' RIBBON_COLOR_SCHEME = oColorScheme.ToUpper
|
||||
' LOGGER.Debug($"RIBBON_COLOR_SCHEME [{RIBBON_COLOR_SCHEME}]")
|
||||
'ElseIf oMode.StartsWith("PM.NO_DETAIL_PROFILES") Then
|
||||
' NO_DETAIL_PROFILES = True
|
||||
' LOGGER.Debug($"NO_DETAIL_PROFILES [{NO_DETAIL_PROFILES}]")
|
||||
'ElseIf oMode = "PM.NO_POPUP" Then
|
||||
' POPUP_REMINDER_ACTIVE = False
|
||||
' LOGGER.Debug($"POPUP_REMINDER_ACTIVE [{POPUP_REMINDER_ACTIVE}]")
|
||||
'ElseIf oMode.StartsWith("PM.POPUP_TIMELAPS_OVERRIDE") Then
|
||||
' Dim oTimeLapse = oMode.Replace("PM.POPUP_TIMELAPS_OVERRIDE=", "")
|
||||
' LOGGER.Info($"CENTRAL POPUP_TIMELAPS_OVERRIDE [{oTimeLapse}]")
|
||||
' Try
|
||||
' CONFIG.Config.ReminderTimer = oTimeLapse
|
||||
' Catch ex As Exception
|
||||
' End Try
|
||||
|
||||
ElseIf oMode.StartsWith("PM.CONV_IDENTIFICATION") Then
|
||||
Dim oIdent = oMode.Replace("PM.CONV_IDENTIFICATION=", "")
|
||||
CONV_IDENTIFICATION = oIdent
|
||||
ElseIf oMode.StartsWith("PM.INACTIVITY_DURATION") Then
|
||||
Dim oInactivityDuration = oMode.Replace("PM.INACTIVITY_DURATION=", "")
|
||||
Try
|
||||
INACTIVITY_DURATION = CInt(oInactivityDuration)
|
||||
LOGGER.Debug($"InactivityDuration [{INACTIVITY_DURATION}]")
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"INACTIVITY_DURATION = 0 - {ex.Message}")
|
||||
INACTIVITY_DURATION = 0
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.COL_LAST_EDITED") Then
|
||||
Dim oLEDITEDCOL = oMode.Replace("PM.COL_LAST_EDITED=", "")
|
||||
Try
|
||||
LAST_EDITED_COLUMN = oLEDITEDCOL
|
||||
LOGGER.Debug($"LAST_EDITED_COLUMN: {oLEDITEDCOL}")
|
||||
Catch ex As Exception
|
||||
LAST_EDITED_COLUMN = ""
|
||||
'ElseIf oMode.StartsWith("PM.CONV_IDENTIFICATION") Then
|
||||
' Dim oIdent = oMode.Replace("PM.CONV_IDENTIFICATION=", "")
|
||||
' CONV_IDENTIFICATION = oIdent
|
||||
'ElseIf oMode.StartsWith("PM.INACTIVITY_DURATION") Then
|
||||
' Dim oInactivityDuration = oMode.Replace("PM.INACTIVITY_DURATION=", "")
|
||||
' Try
|
||||
' INACTIVITY_DURATION = CInt(oInactivityDuration)
|
||||
' LOGGER.Debug($"InactivityDuration [{INACTIVITY_DURATION}]")
|
||||
' Catch ex As Exception
|
||||
' LOGGER.Warn($"INACTIVITY_DURATION = 0 - {ex.Message}")
|
||||
' INACTIVITY_DURATION = 0
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.COL_LAST_EDITED") Then
|
||||
' Dim oLEDITEDCOL = oMode.Replace("PM.COL_LAST_EDITED=", "")
|
||||
' Try
|
||||
' LAST_EDITED_COLUMN = oLEDITEDCOL
|
||||
' LOGGER.Debug($"LAST_EDITED_COLUMN: {oLEDITEDCOL}")
|
||||
' Catch ex As Exception
|
||||
' LAST_EDITED_COLUMN = ""
|
||||
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.COL_LAST_ADDED") Then
|
||||
Dim oLEDITEDCOL = oMode.Replace("PM.COL_LAST_ADDED=", "")
|
||||
Try
|
||||
LAST_ADDED_COLUMN = oLEDITEDCOL
|
||||
LOGGER.Debug($"LAST_ADDED_COLUMN: {oLEDITEDCOL}")
|
||||
Catch ex As Exception
|
||||
LAST_ADDED_COLUMN = ""
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.COL_LAST_ADDED") Then
|
||||
' Dim oLEDITEDCOL = oMode.Replace("PM.COL_LAST_ADDED=", "")
|
||||
' Try
|
||||
' LAST_ADDED_COLUMN = oLEDITEDCOL
|
||||
' LOGGER.Debug($"LAST_ADDED_COLUMN: {oLEDITEDCOL}")
|
||||
' Catch ex As Exception
|
||||
' LAST_ADDED_COLUMN = ""
|
||||
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.MON_COL_CHANGED_WHEN") Then
|
||||
Dim oLEDITEDCOL = oMode.Replace("PM.MON_COL_CHANGED_WHEN=", "")
|
||||
Try
|
||||
MON_EDITED_COLUMN = oLEDITEDCOL
|
||||
LOGGER.Debug($"MON_EDITED_COLUMN: {oLEDITEDCOL}")
|
||||
Catch ex As Exception
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.MON_COL_CHANGED_WHEN") Then
|
||||
' Dim oLEDITEDCOL = oMode.Replace("PM.MON_COL_CHANGED_WHEN=", "")
|
||||
' Try
|
||||
' MON_EDITED_COLUMN = oLEDITEDCOL
|
||||
' LOGGER.Debug($"MON_EDITED_COLUMN: {oLEDITEDCOL}")
|
||||
' Catch ex As Exception
|
||||
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.MON_COL_ADDED_WHEN") Then
|
||||
Dim oLEDITEDCOL = oMode.Replace("PM.MON_COL_ADDED_WHEN=", "")
|
||||
Try
|
||||
MON_ADDED_COLUMN = oLEDITEDCOL
|
||||
LOGGER.Debug($"MON_COL_ADDED_WHEN: {oLEDITEDCOL}")
|
||||
Catch ex As Exception
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.MON_COL_ADDED_WHEN") Then
|
||||
' Dim oLEDITEDCOL = oMode.Replace("PM.MON_COL_ADDED_WHEN=", "")
|
||||
' Try
|
||||
' MON_ADDED_COLUMN = oLEDITEDCOL
|
||||
' LOGGER.Debug($"MON_COL_ADDED_WHEN: {oLEDITEDCOL}")
|
||||
' Catch ex As Exception
|
||||
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.USE_APPSERVER") Then
|
||||
Dim oUSE_APPSERVER = oMode.Replace("PM.USE_APPSERVER=", "")
|
||||
Try
|
||||
USE_APPSERVER = CBool(oUSE_APPSERVER)
|
||||
Catch ex As Exception
|
||||
USE_APPSERVER = False
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.COPYWM2TEMP") Then
|
||||
Dim oCOPYWM2TEMP = oMode.Replace("PM.COPYWM2TEMP=", "")
|
||||
Try
|
||||
COPY_WMFILE_2TEMP = CBool(oCOPYWM2TEMP)
|
||||
Catch ex As Exception
|
||||
COPY_WMFILE_2TEMP = False
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.MAP_SHARE_DRIVE") Then
|
||||
Dim oMAP_SHARE_DRIVE = oMode.Replace("PM.MAP_SHARE_DRIVE=", "")
|
||||
Try
|
||||
MAP_SHARE_DRIVE = oMAP_SHARE_DRIVE
|
||||
Catch ex As Exception
|
||||
oMAP_SHARE_DRIVE = String.Empty
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.MAP_BLACKLIST") Then
|
||||
Dim oMAP_BLACKLIST = oMode.Replace("PM.MAP_BLACKLIST=", "")
|
||||
Try
|
||||
MAP_BLACKLIST = oMAP_BLACKLIST
|
||||
Catch ex As Exception
|
||||
MAP_BLACKLIST = String.Empty
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.SEARCH1") Then
|
||||
Dim oSearch1 = oMode.Replace("PM.SEARCH1=", "")
|
||||
Try
|
||||
SEARCH1 = oSearch1
|
||||
Catch ex As Exception
|
||||
SEARCH1 = ""
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.SEARCH2") Then
|
||||
Dim oSearch2 = oMode.Replace("PM.SEARCH2=", "")
|
||||
Try
|
||||
SEARCH2 = oSearch2
|
||||
Catch ex As Exception
|
||||
SEARCH2 = ""
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.TRAFFICLIGHT_ICON") Then
|
||||
Dim oParam = oMode.Replace("PM.TRAFFICLIGHT_ICON=", "")
|
||||
Try
|
||||
TL_ICON = CBool(oParam)
|
||||
Catch ex As Exception
|
||||
TL_ICON = False
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.TITLE_NOTIFICATIONS") Then
|
||||
Dim oParam = oMode.Replace("PM.TITLE_NOTIFICATIONS=", "")
|
||||
Try
|
||||
TITLE_NOTIFICATIONS = oParam
|
||||
Catch ex As Exception
|
||||
TITLE_NOTIFICATIONS = ""
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("TF.InheritanceMsgAmount") And pMode = "Load" Then
|
||||
Dim oParam = oMode.Replace("TF.InheritanceMsgAmount=", "")
|
||||
Try
|
||||
InheritanceMsgAmount = oParam
|
||||
Catch ex As Exception
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.USE_APPSERVER") Then
|
||||
' Dim oUSE_APPSERVER = oMode.Replace("PM.USE_APPSERVER=", "")
|
||||
' Try
|
||||
' USE_APPSERVER = CBool(oUSE_APPSERVER)
|
||||
' Catch ex As Exception
|
||||
' USE_APPSERVER = False
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.COPYWM2TEMP") Then
|
||||
' Dim oCOPYWM2TEMP = oMode.Replace("PM.COPYWM2TEMP=", "")
|
||||
' Try
|
||||
' COPY_WMFILE_2TEMP = CBool(oCOPYWM2TEMP)
|
||||
' Catch ex As Exception
|
||||
' COPY_WMFILE_2TEMP = False
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.MAP_SHARE_DRIVE") Then
|
||||
' Dim oMAP_SHARE_DRIVE = oMode.Replace("PM.MAP_SHARE_DRIVE=", "")
|
||||
' Try
|
||||
' MAP_SHARE_DRIVE = oMAP_SHARE_DRIVE
|
||||
' Catch ex As Exception
|
||||
' oMAP_SHARE_DRIVE = String.Empty
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.MAP_BLACKLIST") Then
|
||||
' Dim oMAP_BLACKLIST = oMode.Replace("PM.MAP_BLACKLIST=", "")
|
||||
' Try
|
||||
' MAP_BLACKLIST = oMAP_BLACKLIST
|
||||
' Catch ex As Exception
|
||||
' MAP_BLACKLIST = String.Empty
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.SEARCH1") Then
|
||||
' Dim oSearch1 = oMode.Replace("PM.SEARCH1=", "")
|
||||
' Try
|
||||
' SEARCH1 = oSearch1
|
||||
' Catch ex As Exception
|
||||
' SEARCH1 = ""
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.SEARCH2") Then
|
||||
' Dim oSearch2 = oMode.Replace("PM.SEARCH2=", "")
|
||||
' Try
|
||||
' SEARCH2 = oSearch2
|
||||
' Catch ex As Exception
|
||||
' SEARCH2 = ""
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.TRAFFICLIGHT_ICON") Then
|
||||
' Dim oParam = oMode.Replace("PM.TRAFFICLIGHT_ICON=", "")
|
||||
' Try
|
||||
' TL_ICON = CBool(oParam)
|
||||
' Catch ex As Exception
|
||||
' TL_ICON = False
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.TITLE_NOTIFICATIONS") Then
|
||||
' Dim oParam = oMode.Replace("PM.TITLE_NOTIFICATIONS=", "")
|
||||
' Try
|
||||
' TITLE_NOTIFICATIONS = oParam
|
||||
' Catch ex As Exception
|
||||
' TITLE_NOTIFICATIONS = ""
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("TF.InheritanceMsgAmount") And pMode = "Load" Then
|
||||
' Dim oParam = oMode.Replace("TF.InheritanceMsgAmount=", "")
|
||||
' Try
|
||||
' InheritanceMsgAmount = oParam
|
||||
' Catch ex As Exception
|
||||
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("TF.InheritanceCalcReset") And pMode = "Load" Then
|
||||
Dim oParam = oMode.Replace("TF.InheritanceCalcReset=", "")
|
||||
Try
|
||||
If CBool(oParam) = True Then
|
||||
LOGGER.Info("Inheritance_Counts werden auf 0 zurückgesetzt bzw gelöscht")
|
||||
Dim oDELETESQL = "DELETE FROM TBDD_USER_KEY_VALUE_PAIR
|
||||
WHERE FK_USER_ID = " & USER_ID & " And [FK_MODULE_ID] = '" & USER_MODULE_ID & "' AND KEY_NAME LIKE 'INHERITANCE_CONFIRM_%'"
|
||||
DatabaseECM.ExecuteNonQuery(oDELETESQL)
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("TF.InheritanceCalcReset") And pMode = "Load" Then
|
||||
' Dim oParam = oMode.Replace("TF.InheritanceCalcReset=", "")
|
||||
' Try
|
||||
' If CBool(oParam) = True Then
|
||||
' LOGGER.Info("Inheritance_Counts werden auf 0 zurückgesetzt bzw gelöscht")
|
||||
' Dim oDELETESQL = "DELETE FROM TBDD_USER_KEY_VALUE_PAIR
|
||||
' WHERE FK_USER_ID = " & USER_ID & " And [FK_MODULE_ID] = '" & USER_MODULE_ID & "' AND KEY_NAME LIKE 'INHERITANCE_CONFIRM_%'"
|
||||
' DatabaseECM.ExecuteNonQuery(oDELETESQL)
|
||||
|
||||
UserInheritance_ConfirmationByColumn = Nothing
|
||||
CONFIG.Save()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
' UserInheritance_ConfirmationByColumn = Nothing
|
||||
' CONFIG.Save()
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.START_CW") Then
|
||||
Dim oAfterReplace = oMode.Replace("PM.START_CW=", "")
|
||||
Try
|
||||
START_CW = True
|
||||
LOGGER.Debug("PM.START_CW = True")
|
||||
Dim oSplit As String() = oAfterReplace.Split("~")
|
||||
START_CW_CAPTION = oSplit(0)
|
||||
Try
|
||||
START_CW_LOC_VARIANT = oSplit(1)
|
||||
Catch ex As Exception
|
||||
START_CW_LOC_VARIANT = "-1"
|
||||
LOGGER.Warn($"Could not read START_CW_LOCVARIANT : {ex.Message}")
|
||||
End Try
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.START_CW") Then
|
||||
' Dim oAfterReplace = oMode.Replace("PM.START_CW=", "")
|
||||
' Try
|
||||
' START_CW = True
|
||||
' LOGGER.Debug("PM.START_CW = True")
|
||||
' Dim oSplit As String() = oAfterReplace.Split("~")
|
||||
' START_CW_CAPTION = oSplit(0)
|
||||
' Try
|
||||
' START_CW_LOC_VARIANT = oSplit(1)
|
||||
' Catch ex As Exception
|
||||
' START_CW_LOC_VARIANT = "-1"
|
||||
' LOGGER.Warn($"Could not read START_CW_LOCVARIANT : {ex.Message}")
|
||||
' End Try
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"Could not read START_CW Param: {ex.Message}")
|
||||
START_CW = False
|
||||
End Try
|
||||
ElseIf oMode.StartsWith("PM.RibbonPageCustTitle") Then
|
||||
Dim oAfterReplace = oMode.Replace("PM.RibbonPageCustTitle=", "")
|
||||
RibbonPageCustTitle = oAfterReplace
|
||||
ElseIf oMode.StartsWith("PM.RibbonPageCustItm1") Then
|
||||
Dim oAfterReplace = oMode.Replace("PM.RibbonPageCustItm1=", "")
|
||||
RibbonPageCustItm1 = oAfterReplace
|
||||
ElseIf oMode.StartsWith("PM.ButtonExport2FolderCaption") Then
|
||||
Dim oAfterReplace = oMode.Replace("PM.ButtonExport2FolderCaption=", "")
|
||||
ButtonExport2Folder_Caption = oAfterReplace
|
||||
ElseIf oMode.StartsWith("PM.ButtonExport2Folder_Mode") Then
|
||||
Dim oAfterReplace = oMode.Replace("PM.ButtonExport2Folder_Mode=", "")
|
||||
ButtonExport2Folder_Mode = oAfterReplace
|
||||
ElseIf oMode.StartsWith("PM.ButtonExport2Folder_RootFolder") Then
|
||||
Dim oAfterReplace = oMode.Replace("PM.ButtonExport2Folder_RootFolder=", "")
|
||||
ButtonExport2Folder_RootFolder = oAfterReplace
|
||||
ElseIf oMode = "MAINFORM_ALLOW_LOGFILES" Then
|
||||
MAINFORM_CREATE_LOG_FILES = True
|
||||
Else
|
||||
LOGGER.Info($"Wrong oMode: {oMode}")
|
||||
End If
|
||||
' Catch ex As Exception
|
||||
' LOGGER.Warn($"Could not read START_CW Param: {ex.Message}")
|
||||
' START_CW = False
|
||||
' End Try
|
||||
'ElseIf oMode.StartsWith("PM.RibbonPageCustTitle") Then
|
||||
' Dim oAfterReplace = oMode.Replace("PM.RibbonPageCustTitle=", "")
|
||||
' RibbonPageCustTitle = oAfterReplace
|
||||
'ElseIf oMode.StartsWith("PM.RibbonPageCustItm1") Then
|
||||
' Dim oAfterReplace = oMode.Replace("PM.RibbonPageCustItm1=", "")
|
||||
' RibbonPageCustItm1 = oAfterReplace
|
||||
'ElseIf oMode.StartsWith("PM.ButtonExport2FolderCaption") Then
|
||||
' Dim oAfterReplace = oMode.Replace("PM.ButtonExport2FolderCaption=", "")
|
||||
' ButtonExport2Folder_Caption = oAfterReplace
|
||||
'ElseIf oMode.StartsWith("PM.ButtonExport2Folder_Mode") Then
|
||||
' Dim oAfterReplace = oMode.Replace("PM.ButtonExport2Folder_Mode=", "")
|
||||
' ButtonExport2Folder_Mode = oAfterReplace
|
||||
'ElseIf oMode.StartsWith("PM.ButtonExport2Folder_RootFolder") Then
|
||||
' Dim oAfterReplace = oMode.Replace("PM.ButtonExport2Folder_RootFolder=", "")
|
||||
' ButtonExport2Folder_RootFolder = oAfterReplace
|
||||
'ElseIf oMode = "MAINFORM_ALLOW_LOGFILES" Then
|
||||
' MAINFORM_CREATE_LOG_FILES = True
|
||||
'Else
|
||||
' LOGGER.Info($"Wrong oMode: {oMode}")
|
||||
'End If
|
||||
Next
|
||||
'If IDB_ACTIVE Then
|
||||
' If CONNECTION_STRING_APP_SERVER <> String.Empty Then
|
||||
@@ -312,4 +313,267 @@ Public Class ClassParamRefresh
|
||||
End If
|
||||
oStopwatch.Done()
|
||||
End Sub
|
||||
Private Shared Sub ProcessWorkingModeParameter(oMode As String, pMode As String)
|
||||
LOGGER.Debug($"Processing Working Mode Parameter: {oMode}")
|
||||
|
||||
Select Case True
|
||||
Case oMode = "PM.FORCE_LAYOUT_OVERVIEW"
|
||||
SetBooleanParameter(FORCE_LAYOUT_OVERVIEW, True, "FORCE_LAYOUT_OVERVIEW")
|
||||
|
||||
Case oMode = "PM.NO_MASS_VALIDATOR"
|
||||
SetBooleanParameter(SHOW_MASS_VALIDATOR, False, "SHOW_MASS_VALIDATOR", LogLevel.Info)
|
||||
|
||||
Case oMode = "PM.NO_CHARTS"
|
||||
SetBooleanParameter(SHOW_CHARTS, False, "SHOW_CHARTS")
|
||||
|
||||
Case oMode = "PM.DEBUG_LOG"
|
||||
DEBUG = True
|
||||
LOGCONFIG.Debug = True
|
||||
LOGGER.Debug($"DEBUG_LOG = True")
|
||||
|
||||
Case oMode = "PM.LOG_HOTSPOTS"
|
||||
SetBooleanParameter(LOG_HOTSPOTS, True, "LOG_HOTSPOTS")
|
||||
|
||||
Case oMode.StartsWith("OPERATION_MODE_FS")
|
||||
OPERATION_MODE_FS = ExtractParameterValue(oMode, "OPERATION_MODE_FS")
|
||||
If OPERATION_MODE_FS = ClassConstants.OpModeFS_IDBWM Then
|
||||
IDB_USES_WMFILESTORE = True
|
||||
End If
|
||||
LOGGER.Info($"OPERATION_MODE_FS = {OPERATION_MODE_FS}")
|
||||
|
||||
Case oMode = "PM.IDBWITHWMFS"
|
||||
SetBooleanParameter(IDB_USES_WMFILESTORE, True, "IDB_USES_WMFILESTORE", LogLevel.Info)
|
||||
|
||||
Case oMode = "PM.NO_BASICCONF"
|
||||
SetBooleanParameter(BASIC_CONF_VISIBLE, False, "BASIC_CONF_VISIBLE", LogLevel.Info)
|
||||
|
||||
Case oMode = "PM.SYS_LOCKED_MAINTENANCE"
|
||||
SetBooleanParameter(SYS_LOCKED_MAINTENANCE, True, "SYS_LOCKED_MAINTENANCE")
|
||||
|
||||
Case oMode.StartsWith("PM.IDB_CONID!")
|
||||
ProcessIDBConnection(oMode)
|
||||
|
||||
Case oMode = "PM.EXCEL_OVERVIEW"
|
||||
SetBooleanParameter(EXCEL_OVERVIEW, True, "EXCEL_OVERVIEW", LogLevel.Info)
|
||||
|
||||
Case oMode = "PM.MONITORING"
|
||||
SetBooleanParameter(MONITORING_ACTIVE, True, "MONITORING_ACTIVE")
|
||||
|
||||
Case oMode = "PM.GHOSTMODE"
|
||||
SetBooleanParameter(GHOSTMODE_ACTIVE, True, "GHOSTMODE_ACTIVE", LogLevel.Info)
|
||||
|
||||
Case oMode.StartsWith("PM.COLORSCHEME")
|
||||
RIBBON_COLOR_SCHEME = ExtractParameterValue(oMode, "PM.COLORSCHEME").ToUpper
|
||||
LOGGER.Debug($"RIBBON_COLOR_SCHEME = {RIBBON_COLOR_SCHEME}")
|
||||
|
||||
Case oMode.StartsWith("PM.NO_DETAIL_PROFILES")
|
||||
SetBooleanParameter(NO_DETAIL_PROFILES, True, "NO_DETAIL_PROFILES")
|
||||
|
||||
Case oMode = "PM.NO_POPUP"
|
||||
SetBooleanParameter(POPUP_REMINDER_ACTIVE, False, "POPUP_REMINDER_ACTIVE")
|
||||
|
||||
Case oMode.StartsWith("PM.POPUP_TIMELAPS_OVERRIDE")
|
||||
ProcessPopupTimeLapse(oMode)
|
||||
|
||||
Case oMode.StartsWith("PM.CONV_IDENTIFICATION")
|
||||
CONV_IDENTIFICATION = ExtractParameterValue(oMode, "PM.CONV_IDENTIFICATION")
|
||||
LOGGER.Debug($"CONV_IDENTIFICATION = {CONV_IDENTIFICATION}")
|
||||
|
||||
Case oMode.StartsWith("PM.INACTIVITY_DURATION")
|
||||
ProcessIntegerParameter(oMode, "PM.INACTIVITY_DURATION", INACTIVITY_DURATION, "InactivityDuration")
|
||||
|
||||
Case oMode.StartsWith("PM.COL_LAST_EDITED")
|
||||
LAST_EDITED_COLUMN = ExtractParameterValue(oMode, "PM.COL_LAST_EDITED")
|
||||
LOGGER.Debug($"LAST_EDITED_COLUMN = {LAST_EDITED_COLUMN}")
|
||||
|
||||
Case oMode.StartsWith("PM.COL_LAST_ADDED")
|
||||
LAST_ADDED_COLUMN = ExtractParameterValue(oMode, "PM.COL_LAST_ADDED")
|
||||
LOGGER.Debug($"LAST_ADDED_COLUMN = {LAST_ADDED_COLUMN}")
|
||||
|
||||
Case oMode.StartsWith("PM.MON_COL_CHANGED_WHEN")
|
||||
MON_EDITED_COLUMN = ExtractParameterValue(oMode, "PM.MON_COL_CHANGED_WHEN")
|
||||
LOGGER.Debug($"MON_EDITED_COLUMN = {MON_EDITED_COLUMN}")
|
||||
|
||||
Case oMode.StartsWith("PM.MON_COL_ADDED_WHEN")
|
||||
MON_ADDED_COLUMN = ExtractParameterValue(oMode, "PM.MON_COL_ADDED_WHEN")
|
||||
LOGGER.Debug($"MON_ADDED_COLUMN = {MON_ADDED_COLUMN}")
|
||||
|
||||
Case oMode.StartsWith("PM.USE_APPSERVER")
|
||||
ProcessBooleanParameter(oMode, "PM.USE_APPSERVER", USE_APPSERVER, "USE_APPSERVER")
|
||||
|
||||
Case oMode.StartsWith("PM.COPYWM2TEMP")
|
||||
ProcessBooleanParameter(oMode, "PM.COPYWM2TEMP", COPY_WMFILE_2TEMP, "COPY_WMFILE_2TEMP")
|
||||
|
||||
Case oMode.StartsWith("PM.MAP_SHARE_DRIVE")
|
||||
MAP_SHARE_DRIVE = ExtractParameterValue(oMode, "PM.MAP_SHARE_DRIVE")
|
||||
LOGGER.Debug($"MAP_SHARE_DRIVE = {MAP_SHARE_DRIVE}")
|
||||
|
||||
Case oMode.StartsWith("PM.MAP_BLACKLIST")
|
||||
MAP_BLACKLIST = ExtractParameterValue(oMode, "PM.MAP_BLACKLIST")
|
||||
LOGGER.Debug($"MAP_BLACKLIST = {MAP_BLACKLIST}")
|
||||
|
||||
Case oMode.StartsWith("PM.SEARCH1")
|
||||
SEARCH1 = ExtractParameterValue(oMode, "PM.SEARCH1")
|
||||
LOGGER.Debug($"SEARCH1 = {SEARCH1}")
|
||||
|
||||
Case oMode.StartsWith("PM.SEARCH2")
|
||||
SEARCH2 = ExtractParameterValue(oMode, "PM.SEARCH2")
|
||||
LOGGER.Debug($"SEARCH2 = {SEARCH2}")
|
||||
|
||||
Case oMode.StartsWith("PM.TRAFFICLIGHT_ICON")
|
||||
ProcessBooleanParameter(oMode, "PM.TRAFFICLIGHT_ICON", TL_ICON, "TL_ICON")
|
||||
|
||||
Case oMode.StartsWith("PM.TITLE_NOTIFICATIONS")
|
||||
TITLE_NOTIFICATIONS = ExtractParameterValue(oMode, "PM.TITLE_NOTIFICATIONS")
|
||||
LOGGER.Debug($"TITLE_NOTIFICATIONS = {TITLE_NOTIFICATIONS}")
|
||||
|
||||
Case oMode.StartsWith("TF.InheritanceMsgAmount") AndAlso pMode = "Load"
|
||||
InheritanceMsgAmount = ExtractParameterValue(oMode, "TF.InheritanceMsgAmount")
|
||||
LOGGER.Debug($"InheritanceMsgAmount = {InheritanceMsgAmount}")
|
||||
|
||||
Case oMode.StartsWith("TF.InheritanceCalcReset") AndAlso pMode = "Load"
|
||||
ProcessInheritanceReset(oMode)
|
||||
|
||||
Case oMode.StartsWith("PM.START_CW")
|
||||
ProcessStartCW(oMode)
|
||||
|
||||
Case oMode.StartsWith("PM.RibbonPageCustTitle")
|
||||
RibbonPageCustTitle = ExtractParameterValue(oMode, "PM.RibbonPageCustTitle")
|
||||
LOGGER.Debug($"RibbonPageCustTitle = {RibbonPageCustTitle}")
|
||||
|
||||
Case oMode.StartsWith("PM.RibbonPageCustItm1")
|
||||
RibbonPageCustItm1 = ExtractParameterValue(oMode, "PM.RibbonPageCustItm1")
|
||||
LOGGER.Debug($"RibbonPageCustItm1 = {RibbonPageCustItm1}")
|
||||
|
||||
Case oMode.StartsWith("PM.ButtonExport2FolderCaption")
|
||||
ButtonExport2Folder_Caption = ExtractParameterValue(oMode, "PM.ButtonExport2FolderCaption")
|
||||
LOGGER.Debug($"ButtonExport2FolderCaption = {ButtonExport2Folder_Caption}")
|
||||
|
||||
Case oMode.StartsWith("PM.ButtonExport2Folder_Mode")
|
||||
ButtonExport2Folder_Mode = ExtractParameterValue(oMode, "PM.ButtonExport2Folder_Mode")
|
||||
LOGGER.Debug($"ButtonExport2Folder_Mode = {ButtonExport2Folder_Mode}")
|
||||
|
||||
Case oMode.StartsWith("PM.ButtonExport2Folder_RootFolder")
|
||||
ButtonExport2Folder_RootFolder = ExtractParameterValue(oMode, "PM.ButtonExport2Folder_RootFolder")
|
||||
LOGGER.Debug($"ButtonExport2Folder_RootFolder = {ButtonExport2Folder_RootFolder}")
|
||||
|
||||
Case oMode = "MAINFORM_ALLOW_LOGFILES"
|
||||
SetBooleanParameter(MAINFORM_CREATE_LOG_FILES, True, "MAINFORM_CREATE_LOG_FILES")
|
||||
|
||||
Case Else
|
||||
LOGGER.Info($"Unknown Working Mode Parameter: {oMode}")
|
||||
End Select
|
||||
End Sub
|
||||
Private Shared Function ExtractParameterValue(parameterString As String, prefix As String) As String
|
||||
Return parameterString.Replace($"{prefix}=", "")
|
||||
End Function
|
||||
|
||||
Private Shared Sub SetBooleanParameter(ByRef target As Boolean, value As Boolean, paramName As String, Optional logLevel As LogLevel = LogLevel.Debug)
|
||||
target = value
|
||||
LogParameterValue(paramName, value.ToString(), logLevel)
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessBooleanParameter(oMode As String, prefix As String, ByRef target As Boolean, paramName As String)
|
||||
Dim value = ExtractParameterValue(oMode, prefix)
|
||||
Try
|
||||
target = CBool(value)
|
||||
LOGGER.Debug($"{paramName} = {target}")
|
||||
Catch ex As Exception
|
||||
target = False
|
||||
LOGGER.Warn($"Failed to parse {paramName}: {ex.Message}")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessIntegerParameter(oMode As String, prefix As String, ByRef target As Integer, paramName As String)
|
||||
Dim value = ExtractParameterValue(oMode, prefix)
|
||||
Try
|
||||
target = CInt(value)
|
||||
LOGGER.Debug($"{paramName} = {target}")
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"Failed to parse {paramName}: {ex.Message}. Setting to 0")
|
||||
target = 0
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessIDBConnection(oMode As String)
|
||||
Dim Database_IDB As MSSQLServer = Nothing
|
||||
Dim CON_ID = oMode.Replace("PM.IDB_CONID!", "")
|
||||
Dim oConString = DatabaseFallback.GetConnectionString(CON_ID)
|
||||
CONNECTION_STRING_IDB = oConString
|
||||
Database_IDB = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_IDB)
|
||||
|
||||
If Database_IDB.DBInitialized = True Then
|
||||
IDB_ACTIVE = True
|
||||
LOGGER.Info($"IDB is active - IDB-Connection [{CON_ID}]")
|
||||
DatabaseFallback.InitializeIDB(Database_IDB)
|
||||
Else
|
||||
IDB_ACTIVE = False
|
||||
LOGGER.Warn($"Failed to initialize IDB with Connection [{CON_ID}]")
|
||||
End If
|
||||
If CONNECTION_STRING_IDB <> "" AndAlso Database_IDB.DBInitialized = True Then
|
||||
IDB_ACTIVE = True
|
||||
LOGGER.Debug("IDB already initialized and active")
|
||||
Return
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessPopupTimeLapse(oMode As String)
|
||||
Dim oTimeLapse = ExtractParameterValue(oMode, "PM.POPUP_TIMELAPS_OVERRIDE")
|
||||
LOGGER.Info($"POPUP_TIMELAPS_OVERRIDE = {oTimeLapse}")
|
||||
Try
|
||||
CONFIG.Config.ReminderTimer = oTimeLapse
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"Failed to set ReminderTimer: {ex.Message}")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessInheritanceReset(oMode As String)
|
||||
Dim oParam = ExtractParameterValue(oMode, "TF.InheritanceCalcReset")
|
||||
Try
|
||||
If CBool(oParam) = True Then
|
||||
LOGGER.Info("Inheritance_Counts werden auf 0 zurückgesetzt bzw gelöscht")
|
||||
Dim oDELETESQL = "DELETE FROM TBDD_USER_KEY_VALUE_PAIR
|
||||
WHERE FK_USER_ID = " & USER_ID & " And [FK_MODULE_ID] = '" & USER_MODULE_ID & "' AND KEY_NAME LIKE 'INHERITANCE_CONFIRM_%'"
|
||||
DatabaseECM.ExecuteNonQuery(oDELETESQL)
|
||||
UserInheritance_ConfirmationByColumn = Nothing
|
||||
CONFIG.Save()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"Failed to process InheritanceCalcReset: {ex.Message}")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessStartCW(oMode As String)
|
||||
Dim oAfterReplace = ExtractParameterValue(oMode, "PM.START_CW")
|
||||
Try
|
||||
START_CW = True
|
||||
LOGGER.Debug("PM.START_CW = True")
|
||||
Dim oSplit As String() = oAfterReplace.Split("~")
|
||||
START_CW_CAPTION = oSplit(0)
|
||||
Try
|
||||
START_CW_LOC_VARIANT = oSplit(1)
|
||||
LOGGER.Debug($"START_CW_LOC_VARIANT = {START_CW_LOC_VARIANT}")
|
||||
Catch ex As Exception
|
||||
START_CW_LOC_VARIANT = "-1"
|
||||
LOGGER.Warn($"Could not read START_CW_LOC_VARIANT: {ex.Message}")
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"Could not read START_CW Param: {ex.Message}")
|
||||
START_CW = False
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Shared Sub LogParameterValue(paramName As String, value As String, logLevel As LogLevel)
|
||||
Select Case logLevel
|
||||
Case LogLevel.Info
|
||||
LOGGER.Info($"{paramName} = {value}")
|
||||
Case Else
|
||||
LOGGER.Debug($"{paramName} = {value}")
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Enum LogLevel
|
||||
Debug
|
||||
Info
|
||||
End Enum
|
||||
End Class
|
||||
|
||||
@@ -124,7 +124,7 @@ Public Class ClassWindream_allgemein
|
||||
Public Function Start_WMCC_andCo()
|
||||
Try
|
||||
' 04.10.18: Überprüft, ob der Benutzer Mitglied der SERVER_USER Gruppe ist
|
||||
Dim sql = "SELECT T.GUID FROM TBDD_GROUPS_USER T INNER JOIN TBDD_GROUPS T1 on T1.GUID = T.GROUP_ID WHERE T1.NAME = 'SERVER_USER' AND T.USER_ID = " & USER_ID
|
||||
Dim sql = "SELECT T.GUID FROM TBDD_GROUPS_USER T WITH (NOLOCK) INNER JOIN TBDD_GROUPS T1 WITH (NOLOCK) on T1.GUID = T.GROUP_ID WHERE T1.NAME = 'SERVER_USER' AND T.USER_ID = " & USER_ID
|
||||
Dim userExistsInServerUserGroup = DatabaseFallback.GetScalarValueECM(sql) ', CONNECTION_STRING_ECM, "StartWMCC-userExistsInServerUserGroup")
|
||||
|
||||
If WMSESSION_STARTSTOP_STARTUP = True Then
|
||||
|
||||
@@ -30,8 +30,8 @@ Module ModuleRuntimeVariables
|
||||
Public Property BASEDATA_DT_PROFILES_SEARCHES_DOC As DataTable
|
||||
Public Property DT_FILTERED_PROFILE_SEARCHES_DOC As DataTable
|
||||
|
||||
Public Property BASEDATA_DT_PROFILES_SEARCHES_SQL As DataTable
|
||||
Public Property BASEDATA_DT_PROFILE_SEARCHES_SQL As DataTable
|
||||
Public Property BASEDATA_DT_PROFILES_SEARCHES_DATA As DataTable
|
||||
Public Property DT_FILTERED_PROFILE_SEARCHES_DATA As DataTable
|
||||
Public Property BASEDATA_DT_VW_PROFILE_USER As DataTable
|
||||
|
||||
Public Property BASEDATA_TBDD_COLUMNS_FORMAT As DataTable
|
||||
|
||||
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.8.7.1")>
|
||||
<Assembly: AssemblyVersion("2.9.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
<Assembly: NeutralResourcesLanguage("")>
|
||||
|
||||
@@ -151,9 +151,9 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraVerticalGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Controls.DocumentViewer, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="DigitalData.Controls.DocumentViewer, Version=2.6.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\2_DLL Projekte\Controls.DocumentViewer\obj\Debug\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||
<HintPath>..\..\..\..\2_DLL Projekte\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Controls.LookupGrid">
|
||||
<HintPath>..\..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll</HintPath>
|
||||
@@ -1256,7 +1256,7 @@
|
||||
<None Include="Resources\PM_mit_slogan.JPG" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="taskFLOW-TEST-Debug.txt" />
|
||||
<Content Include="logtaskflow.txt" />
|
||||
<None Include="Changelog.md" />
|
||||
<Content Include="DataColumnExpression.txt" />
|
||||
<Content Include="DD_Icons_ICO_PMANAGER_48px.ico" />
|
||||
|
||||
@@ -2044,12 +2044,12 @@ Public Class frmMain
|
||||
End If
|
||||
|
||||
' ========== SEARCH SQL PREPARATION ==========
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL = Nothing
|
||||
rows = BASEDATA_DT_PROFILES_SEARCHES_SQL.Select(oExpression, "TAB_INDEX")
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA = Nothing
|
||||
rows = BASEDATA_DT_PROFILES_SEARCHES_DATA.Select(oExpression, "TAB_INDEX")
|
||||
If rows.Length > 0 Then
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL = rows.CopyToDataTable()
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA = rows.CopyToDataTable()
|
||||
Else
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL = BASEDATA_DT_PROFILES_SEARCHES_SQL.Clone()
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA = BASEDATA_DT_PROFILES_SEARCHES_DATA.Clone()
|
||||
End If
|
||||
|
||||
' ========== VALIDATOR-FORM ÖFFNEN ==========
|
||||
@@ -3178,6 +3178,7 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_G
|
||||
End If
|
||||
|
||||
BASEDATA_DT_PROFILES_SEARCHES_DOC = DatabaseECM.GetDatatable(oSQL)
|
||||
EnsureProfileSearchType(BASEDATA_DT_PROFILES_SEARCHES_DOC, "DOC", NameOf(BASEDATA_DT_PROFILES_SEARCHES_DOC))
|
||||
|
||||
If pMode = "Load" Then
|
||||
DT_FILTERED_PROFILE_SEARCHES_DOC = BASEDATA_DT_PROFILES_SEARCHES_DOC.Clone()
|
||||
@@ -3185,16 +3186,18 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_G
|
||||
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(50)
|
||||
oSQL = "select * from TBPM_PROFILE_SEARCH WITH (NOLOCK) where TYPE = 'SQL' AND ACTIVE = 1 ORDER BY PROFILE_ID,TAB_INDEX"
|
||||
|
||||
BASEDATA_DT_PROFILES_SEARCHES_SQL = DatabaseFallback.GetDatatable("TBPM_PROFILE_SEARCH", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
||||
.FilterExpression = "TYPE = 'SQL'",
|
||||
.SortByColumn = "PROFILE_ID,TAB_INDEX"
|
||||
BASEDATA_DT_PROFILES_SEARCHES_DATA = DatabaseFallback.GetDatatable("TBPM_PROFILE_SEARCH", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
||||
.FilterExpression = "TYPE = 'SQL'",
|
||||
.SortByColumn = "PROFILE_ID,TAB_INDEX"
|
||||
})
|
||||
EnsureProfileSearchType(BASEDATA_DT_PROFILES_SEARCHES_DATA, "SQL", NameOf(BASEDATA_DT_PROFILES_SEARCHES_DATA))
|
||||
|
||||
oSQL = String.Format("SELECT [dbo].[FNPM_LANGUAGE_CONTROL_TEXT] (NAME,'{0}',CTRL_TYPE,CTRL_TEXT) CTRL_CAPTION_LANG, '{0}' as LANGUAGE, * FROM TBPM_PROFILE_CONTROLS WITH (NOLOCK)", {USER_LANGUAGE})
|
||||
BASEDATA_TBPM_PROFILE_CONTROLS = DatabaseFallback.GetDatatable("TBPM_PROFILE_CONTROLS_LANGUAGE", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
||||
.FilterExpression = String.Format("LANGUAGE = '{0}'", {USER_LANGUAGE})
|
||||
})
|
||||
If pMode = "Load" Then
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL = BASEDATA_DT_PROFILES_SEARCHES_SQL.Clone()
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA = BASEDATA_DT_PROFILES_SEARCHES_DATA.Clone()
|
||||
End If
|
||||
If pMode = "bwBasicData" Then bwBasicData.ReportProgress(60)
|
||||
LoadVWPM_CONTROL_INDEX()
|
||||
@@ -3215,6 +3218,53 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_G
|
||||
End Try
|
||||
oStopWatch.Done()
|
||||
End Sub
|
||||
Private Sub EnsureProfileSearchType(ByRef pTable As DataTable, expectedType As String, tableName As String)
|
||||
Try
|
||||
If pTable Is Nothing Then
|
||||
LOGGER.Warn($"{tableName} is Nothing - type guard skipped")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If pTable.Columns.Contains("TYPE") = False Then
|
||||
LOGGER.Warn($"{tableName} has no TYPE column - type guard skipped")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim cleanedTable As DataTable = pTable.Clone()
|
||||
Dim removedCount As Integer = 0
|
||||
Dim sampleInvalidSql As String = String.Empty
|
||||
|
||||
For Each row As DataRow In pTable.Rows
|
||||
Dim rowType As String = String.Empty
|
||||
If row("TYPE") IsNot DBNull.Value Then
|
||||
rowType = row("TYPE").ToString().Trim().ToUpperInvariant()
|
||||
End If
|
||||
|
||||
If rowType = expectedType.ToUpperInvariant() Then
|
||||
cleanedTable.ImportRow(row)
|
||||
Else
|
||||
removedCount += 1
|
||||
If sampleInvalidSql = String.Empty AndAlso pTable.Columns.Contains("SQL_COMMAND") Then
|
||||
If row("SQL_COMMAND") IsNot DBNull.Value Then
|
||||
sampleInvalidSql = row("SQL_COMMAND").ToString()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If removedCount > 0 Then
|
||||
LOGGER.Warn($"{tableName}: removed {removedCount} row(s) with unexpected TYPE. Expected TYPE='{expectedType}'.")
|
||||
If sampleInvalidSql <> String.Empty Then
|
||||
LOGGER.Warn($"{tableName}: sample unexpected SQL_COMMAND => {sampleInvalidSql}")
|
||||
End If
|
||||
End If
|
||||
LOGGER.Debug($"{tableName}: {cleanedTable.Rows.Count} rows with TYPE='{expectedType}' after type guard.")
|
||||
pTable = cleanedTable
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Warn($"EnsureProfileSearchType failed for {tableName}")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub ConfigureGlobalLookAndFeel()
|
||||
If RIBBON_COLOR_SCHEME <> "" Then
|
||||
UserLookAndFeel.Default.UseDefaultLookAndFeel = False
|
||||
@@ -4082,10 +4132,10 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_G
|
||||
oExpression = $"PROFILE_ID = {CURRENT_ProfilGUID}"
|
||||
BASEDATA_DT_PROFILES_SEARCHES_DOC.Select(oExpression, "TAB_INDEX").CopyToDataTable(DT_FILTERED_PROFILE_SEARCHES_DOC, LoadOption.PreserveChanges)
|
||||
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL = Nothing
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL = BASEDATA_DT_PROFILES_SEARCHES_SQL.Copy
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL.Clear()
|
||||
BASEDATA_DT_PROFILES_SEARCHES_SQL.Select(oExpression, "TAB_INDEX").CopyToDataTable(BASEDATA_DT_PROFILE_SEARCHES_SQL, LoadOption.PreserveChanges)
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA = Nothing
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA = BASEDATA_DT_PROFILES_SEARCHES_DATA.Copy
|
||||
DT_FILTERED_PROFILE_SEARCHES_DATA.Clear()
|
||||
BASEDATA_DT_PROFILES_SEARCHES_DATA.Select(oExpression, "TAB_INDEX").CopyToDataTable(DT_FILTERED_PROFILE_SEARCHES_DATA, LoadOption.PreserveChanges)
|
||||
|
||||
Try
|
||||
Dim oEnvironment = GetEnvironment()
|
||||
|
||||
1
app/TaskFlow/frmValidator.Designer.vb
generated
1
app/TaskFlow/frmValidator.Designer.vb
generated
@@ -762,7 +762,6 @@ Partial Class frmValidator
|
||||
Me.rbnPgGroupAttmt.ItemLinks.Add(Me.Attmnt_bbtnitm_LoadonClick)
|
||||
Me.rbnPgGroupAttmt.Name = "rbnPgGroupAttmt"
|
||||
resources.ApplyResources(Me.rbnPgGroupAttmt, "rbnPgGroupAttmt")
|
||||
Me.rbnPgGroupAttmt.Visible = False
|
||||
'
|
||||
'RibbonPageGroupCustom
|
||||
'
|
||||
|
||||
@@ -616,7 +616,7 @@
|
||||
<value>DocumentViewer1</value>
|
||||
</data>
|
||||
<data name=">>DocumentViewer1.Type" xml:space="preserve">
|
||||
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=2.7.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>DocumentViewer1.Parent" xml:space="preserve">
|
||||
<value>SplitContainer1.Panel2</value>
|
||||
|
||||
@@ -140,7 +140,8 @@ Public Class frmValidator
|
||||
Private _overlayHandle As Object = Nothing ' ← NEU: Klassenvariable
|
||||
Private _overlayRefCount As Integer = 0 ' ← NEU: Zähler für verschachtelte Calls
|
||||
Private _overlayLock As New Object() ' ← NEU: Thread-Safe Lock
|
||||
Private _documentPathHandler As ClassDocumentPathHandler
|
||||
Private _documentPathHandler As DocumentPathHandler
|
||||
Private _isLoadingAdditionalSearches As Boolean = False
|
||||
|
||||
|
||||
Private Class Translation_Strings
|
||||
@@ -213,7 +214,7 @@ Public Class frmValidator
|
||||
|
||||
''' <summary>
|
||||
''' Erzwingt sofortiges Schließen (nur für Fehlerfall / FormClosing)
|
||||
''' </summary>
|
||||
''' </summary>DetachAllGridEvents
|
||||
Private Sub ForceCloseOverlay()
|
||||
SyncLock _overlayLock
|
||||
If _overlayHandle IsNot Nothing Then
|
||||
@@ -274,7 +275,7 @@ Public Class frmValidator
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
MyValidationLogger.Error(ex)
|
||||
' Bei Fehler sicherheitshalber zentrieren
|
||||
CenterFormOnScreen()
|
||||
End Try
|
||||
@@ -308,8 +309,7 @@ Public Class frmValidator
|
||||
DD_Documentloader = New Loader(LOGCONFIG, OperationMode, Environment.Service.Client, Environment.User)
|
||||
ControlCreator = New ClassControlCreator(LOGCONFIG)
|
||||
Validator = New Validator(LOGCONFIG)
|
||||
_documentPathHandler = New ClassDocumentPathHandler(MyValidationLogger)
|
||||
|
||||
_documentPathHandler = New DocumentPathHandler(LOGCONFIG)
|
||||
Override = False
|
||||
SplitContainer1.Panel2Collapsed = True
|
||||
first_control = Nothing
|
||||
@@ -330,18 +330,7 @@ Public Class frmValidator
|
||||
MyValidationLogger.Info($"[PERF frmValidation_Load] Nach Initialisierung: {(DateTime.Now - perfLastCheck).TotalMilliseconds}ms")
|
||||
perfLastCheck = DateTime.Now
|
||||
End If
|
||||
If COPY_WMFILE_2TEMP = True Then
|
||||
If String.IsNullOrEmpty(TEMP_DOCUMENT_FOLDER) OrElse Not System.IO.Directory.Exists(TEMP_DOCUMENT_FOLDER) Then
|
||||
MyValidationLogger.Warn("⚠️ TEMP_DOCUMENT_FOLDER nicht initialisiert → Versuche erneut zu erstellen")
|
||||
If Not InitializeTempFolder() Then
|
||||
MyValidationLogger.Error("❌ Temp-Ordner konnte nicht erstellt werden!")
|
||||
' Optional: Fallback oder Fehlerbehandlung
|
||||
End If
|
||||
Else
|
||||
MyValidationLogger.Debug($"✓ Temp-Ordner verfügbar: [{TEMP_DOCUMENT_FOLDER}]")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Warn($"⚠️ Error in frmValidation_load1: {ex.Message}")
|
||||
@@ -694,35 +683,7 @@ Public Class frmValidator
|
||||
End Try
|
||||
End Sub
|
||||
Private _isClosingGuard As Boolean = False
|
||||
Public Shared Function InitializeTempFolder() As Boolean
|
||||
Try
|
||||
If COPY_WMFILE_2TEMP = True Then
|
||||
' Basis-Temp-Pfad ermitteln
|
||||
Dim baseTempPath As String = System.IO.Path.GetTempPath()
|
||||
|
||||
' Application-spezifischen Ordner erstellen (z.B. "TaskFlow_Temp")
|
||||
TEMP_DOCUMENT_FOLDER = System.IO.Path.Combine(baseTempPath, "DD_VALIDATOR_Documents")
|
||||
|
||||
' Ordner erstellen, falls nicht vorhanden
|
||||
If Not System.IO.Directory.Exists(TEMP_DOCUMENT_FOLDER) Then
|
||||
System.IO.Directory.CreateDirectory(TEMP_DOCUMENT_FOLDER)
|
||||
LOGGER.Info($"Temporärer Dokumentordner erstellt: [{TEMP_DOCUMENT_FOLDER}]")
|
||||
Else
|
||||
LOGGER.Debug($"Temporärer Dokumentordner existiert bereits: [{TEMP_DOCUMENT_FOLDER}]")
|
||||
End If
|
||||
|
||||
Return True
|
||||
Else
|
||||
LOGGER.Debug("COPY_WMFILE_2TEMP = False → Kein Temp-Ordner nötig")
|
||||
Return True
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"Fehler beim Erstellen des Temp-Ordners: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Sub DetachAllGridEvents(parent As Control)
|
||||
For Each ctrl As Control In parent.Controls
|
||||
If TypeOf ctrl Is GridControl Then
|
||||
@@ -776,9 +737,11 @@ Public Class frmValidator
|
||||
MyValidationLogger.Debug($"CloseReason: {e.CloseReason}")
|
||||
MyValidationLogger.Debug($"Cancel: {e.Cancel}")
|
||||
|
||||
' *** KORREKTUR: StackTrace richtig erstellen ***
|
||||
Dim st As New StackTrace(True)
|
||||
MyValidationLogger.Debug($"StackTrace: {st.ToString()}")
|
||||
Try
|
||||
MyValidationLogger?.Debug($"StackTrace: {System.Environment.StackTrace}")
|
||||
Catch ex As Exception
|
||||
MyValidationLogger?.Debug($"StackTrace konnte nicht ermittelt werden: {ex.Message}")
|
||||
End Try
|
||||
|
||||
' Zusätzliche Diagnostik
|
||||
MyValidationLogger.Debug($"_FormClosing-Flag: {_FormClosing}")
|
||||
@@ -898,15 +861,33 @@ Public Class frmValidator
|
||||
MyValidationLogger.Info($"[PERF frmValidation_FormClosing] nach ValidatorSearch.Close: {(DateTime.Now - perfLastCheck).TotalMilliseconds}ms")
|
||||
perfLastCheck = DateTime.Now
|
||||
End If
|
||||
' ========== NEU: Temp-Ordner bereinigen ==========
|
||||
Try
|
||||
If COPY_WMFILE_2TEMP = True Then
|
||||
MyValidationLogger.Debug("🗑️ Bereinige Temp-Ordner beim Schließen...")
|
||||
CleanupTempFolder()
|
||||
End If
|
||||
Catch cleanupEx As Exception
|
||||
MyValidationLogger.Warn($"⚠️ Fehler beim Bereinigen des Temp-Ordners: {cleanupEx.Message}")
|
||||
End Try
|
||||
' ========== ENDE NEU ==========
|
||||
|
||||
If LOG_HOTSPOTS Then
|
||||
MyValidationLogger.Info($"[PERF frmValidation_FormClosing] GESAMT: {(DateTime.Now - perfStart).TotalMilliseconds}ms")
|
||||
End If
|
||||
' Overlay schließen (falls vorhanden)
|
||||
Try
|
||||
ForceCloseOverlay()
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Debug($"Overlay-Cleanup-Fehler ignoriert: {ex.Message}")
|
||||
End Try
|
||||
' Cleanup DocumentPathHandler
|
||||
If _documentPathHandler IsNot Nothing Then
|
||||
_documentPathHandler.Cleanup()
|
||||
End If
|
||||
|
||||
If LOG_HOTSPOTS Then
|
||||
MyValidationLogger.Info($"[PERF frmValidation_FormClosing] GESAMT: {(DateTime.Now - perfStart).TotalMilliseconds}ms")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Finally
|
||||
' WICHTIG: Guard wird NICHT zurückgesetzt, da die Form nun wirklich schließt.
|
||||
@@ -919,6 +900,7 @@ Public Class frmValidator
|
||||
DT_AdditionalSearches_Resultset_Docs.Clear()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CleanupTempFolder()
|
||||
Try
|
||||
If String.IsNullOrEmpty(TEMP_DOCUMENT_FOLDER) Then
|
||||
@@ -967,21 +949,20 @@ Public Class frmValidator
|
||||
End Sub
|
||||
|
||||
Public Function Test_Additional_Data_Searches_Exist() As Boolean
|
||||
If BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows.Count > 0 Then
|
||||
If DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0 Then
|
||||
Dim oDataResultCommand As String
|
||||
Dim oDatatableDataResult As DataTable = Nothing
|
||||
|
||||
If BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows.Count > 0 Then
|
||||
If DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0 Then
|
||||
'Check whether DocData is there
|
||||
Dim oConID = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("CONN_ID")
|
||||
oDataResultCommand = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("SQL_COMMAND")
|
||||
oDataResultCommand = DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(0).Item("SQL_COMMAND")
|
||||
oDataResultCommand = clsPatterns.ReplaceAllValues(oDataResultCommand, PanelValidatorControl, True)
|
||||
oDatatableDataResult = DatabaseFallback.GetDatatableWithConnection(oDataResultCommand, oConID)
|
||||
oDatatableDataResult = DatabaseFallback.GetDatatable(New GetDatatableOptions(oDataResultCommand, DatabaseType.ECM))
|
||||
End If
|
||||
|
||||
Dim oDataResultsExist As Boolean = False
|
||||
|
||||
If BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows.Count > 0 Then
|
||||
If DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0 Then
|
||||
If Not IsNothing(oDatatableDataResult) Then
|
||||
If oDatatableDataResult.Rows.Count > 0 Then
|
||||
oDataResultsExist = True
|
||||
@@ -1019,68 +1000,162 @@ Public Class frmValidator
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function IsValidDocSearchResult(pDt As DataTable) As Boolean
|
||||
If pDt Is Nothing Then Return False
|
||||
Return pDt.Columns.Contains("DocID") AndAlso pDt.Columns.Contains("FULL_FILENAME")
|
||||
End Function
|
||||
Public Sub Load_Additional_Searches(Preload As Boolean)
|
||||
If _isLoadingAdditionalSearches Then
|
||||
MyValidationLogger.Debug("Load_Additional_Searches: Reentrance erkannt, Aufruf wird übersprungen.")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
_isLoadingAdditionalSearches = True
|
||||
Try
|
||||
AdditionalDocResultsExist = Test_Additional_Doc_Searches_Exist()
|
||||
AdditionalDataResultsExist = Test_Additional_Data_Searches_Exist()
|
||||
'If Test_Additional_Searches_Exist() Then
|
||||
If AdditionalDataResultsExist = True Or AdditionalDocResultsExist = True Then
|
||||
Try
|
||||
If RibbonPageCustItm1 <> "" Then
|
||||
Attmt_bbtnitmShow.Caption = RibbonPageCustItm1
|
||||
End If
|
||||
rbnPgGroupAttmt.Visible = True
|
||||
Attmnt_bbtnitm_LoadonClick.Checked = CONFIG.Config.ADDITIONAL_SEARCHES_LOAD_ONCLICK
|
||||
MyValidationLogger.Debug("========================================")
|
||||
MyValidationLogger.Debug("=== Load_Additional_Searches START ===")
|
||||
MyValidationLogger.Debug($"Parameter: Preload={Preload}")
|
||||
MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}")
|
||||
MyValidationLogger.Debug("========================================")
|
||||
|
||||
Dim oConID As Int16
|
||||
Dim oCommand As String
|
||||
Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA
|
||||
Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC
|
||||
|
||||
If Preload = True Then
|
||||
_frmValidatorSearch.TabPreload(BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows.Count, DT_FILTERED_PROFILE_SEARCHES_DOC.Rows.Count,
|
||||
BASEDATA_DT_PROFILE_SEARCHES_SQL, DT_FILTERED_PROFILE_SEARCHES_DOC)
|
||||
If AdditionalDocResultsExist Then
|
||||
_frmValidatorSearch._DTDocSearches = DT_FILTERED_PROFILE_SEARCHES_DOC
|
||||
oConID = DT_FILTERED_PROFILE_SEARCHES_DOC.Rows(0).Item("CONN_ID")
|
||||
oCommand = DT_FILTERED_PROFILE_SEARCHES_DOC.Rows(0).Item("SQL_COMMAND")
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, PanelValidatorControl, True)
|
||||
_frmValidatorSearch.RefreshTabDoc(oConID, oCommand, 0, DT_FILTERED_PROFILE_SEARCHES_DOC.Rows(0).Item("TAB_TITLE"))
|
||||
End If
|
||||
If allSQLSearches Is Nothing Then allSQLSearches = New DataTable()
|
||||
If allDocSearches Is Nothing Then allDocSearches = New DataTable()
|
||||
|
||||
Dim hasDATASearches As Boolean = allSQLSearches.Rows.Count > 0
|
||||
Dim hasDOCSearches As Boolean = allDocSearches.Rows.Count > 0
|
||||
Dim hasConfiguredSearches As Boolean = hasDATASearches OrElse hasDOCSearches
|
||||
|
||||
If AdditionalDataResultsExist Then
|
||||
_frmValidatorSearch._DTSQLSearches = BASEDATA_DT_PROFILE_SEARCHES_SQL
|
||||
oConID = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("CONN_ID")
|
||||
oCommand = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("SQL_COMMAND")
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, PanelValidatorControl, True)
|
||||
_frmValidatorSearch.Refresh_Load_GridSQL(oConID, oCommand, 0, BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("TAB_TITLE"))
|
||||
|
||||
End If
|
||||
Else
|
||||
MyValidationLogger.Info("There are additional searches configured, but PRELOAD is false. So they won't be load!")
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Error(ex)
|
||||
End Try
|
||||
|
||||
bbtniRefreshSearches.Visibility = BarItemVisibility.Always
|
||||
|
||||
Else
|
||||
MyValidationLogger.Debug("AdditionalData/Docresults = false!")
|
||||
bbtniRefreshSearches.Visibility = BarItemVisibility.Never
|
||||
If Not hasConfiguredSearches Then
|
||||
AdditionalDataResultsExist = False
|
||||
AdditionalDocResultsExist = False
|
||||
rbnPgGroupAttmt.Visible = False
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Else
|
||||
' Logger.Debug("Not loading AdditionalSearches 2...!")
|
||||
' bbtniRefreshSearches.Visibility = BarItemVisibility.Never
|
||||
'End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
||||
End Try
|
||||
If RibbonPageCustItm1 <> "" Then
|
||||
Attmt_bbtnitmShow.Caption = RibbonPageCustItm1
|
||||
End If
|
||||
rbnPgGroupAttmt.Visible = True
|
||||
Attmnt_bbtnitm_LoadonClick.Checked = CONFIG.Config.ADDITIONAL_SEARCHES_LOAD_ONCLICK
|
||||
|
||||
If _frmValidatorSearch Is Nothing OrElse _frmValidatorSearch.IsDisposed Then
|
||||
_frmValidatorSearch = New frmValidatorSearch(Me, Environment)
|
||||
End If
|
||||
|
||||
MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---")
|
||||
Dim validSQLSearches As DataTable = allSQLSearches.Clone()
|
||||
Dim validDocSearches As DataTable = allDocSearches.Clone()
|
||||
|
||||
If hasDATASearches Then
|
||||
For i As Integer = 0 To allSQLSearches.Rows.Count - 1
|
||||
Dim searchRow = allSQLSearches.Rows(i)
|
||||
Try
|
||||
Dim tabTitle As String = If(searchRow.Item("TAB_TITLE")?.ToString(), $"SQL-Tab {i}")
|
||||
Dim sqlCommand As String = searchRow.Item("SQL_COMMAND")?.ToString()
|
||||
Dim connId As Integer = If(IsDBNull(searchRow.Item("CONN_ID")), 1, CInt(searchRow.Item("CONN_ID")))
|
||||
|
||||
If String.IsNullOrEmpty(sqlCommand) Then Continue For
|
||||
|
||||
Dim replacedSql As String = clsPatterns.ReplaceAllValues(sqlCommand, Me.PanelValidatorControl, True)
|
||||
Dim testDT = DatabaseFallback.GetDatatable(New GetDatatableOptions(replacedSql, DatabaseType.ECM) With {.ConnectionId = connId})
|
||||
|
||||
If testDT IsNot Nothing AndAlso testDT.Rows.Count > 0 Then
|
||||
validSQLSearches.ImportRow(searchRow)
|
||||
MyValidationLogger.Info($"✓ SQL-Search '{tabTitle}': {testDT.Rows.Count} Ergebnisse gefunden")
|
||||
Else
|
||||
MyValidationLogger.Debug($"ℹ️ SQL-Search '{tabTitle}': Keine Ergebnisse gefunden")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Error($"❌ Fehler beim Verarbeiten von SQL-Search Index {i}", ex)
|
||||
End Try
|
||||
Next
|
||||
End If
|
||||
|
||||
If hasDOCSearches Then
|
||||
For i As Integer = 0 To allDocSearches.Rows.Count - 1
|
||||
Dim searchRow = allDocSearches.Rows(i)
|
||||
Try
|
||||
Dim tabTitle As String = If(searchRow.Item("TAB_TITLE")?.ToString(), $"Doc-Tab {i}")
|
||||
Dim sqlCommand As String = searchRow.Item("SQL_COMMAND")?.ToString()
|
||||
Dim connId As Integer = If(IsDBNull(searchRow.Item("CONN_ID")), 1, CInt(searchRow.Item("CONN_ID")))
|
||||
|
||||
If String.IsNullOrEmpty(sqlCommand) Then Continue For
|
||||
|
||||
Dim replacedSql As String = clsPatterns.ReplaceAllValues(sqlCommand, Me.PanelValidatorControl, True)
|
||||
Dim testDT = DatabaseFallback.GetDatatable(New GetDatatableOptions(replacedSql, DatabaseType.ECM) With {.ConnectionId = connId})
|
||||
|
||||
If testDT IsNot Nothing AndAlso testDT.Rows.Count > 0 Then
|
||||
If IsValidDocSearchResult(testDT) Then
|
||||
validDocSearches.ImportRow(searchRow)
|
||||
MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden")
|
||||
Else
|
||||
MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.")
|
||||
End If
|
||||
Else
|
||||
MyValidationLogger.Debug($"ℹ️ Doc-Search '{tabTitle}': Keine Ergebnisse gefunden")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Error($"❌ Fehler beim Verarbeiten von Doc-Search Index {i}", ex)
|
||||
End Try
|
||||
Next
|
||||
End If
|
||||
|
||||
AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0
|
||||
AdditionalDocResultsExist = validDocSearches.Rows.Count > 0
|
||||
MyValidationLogger.Debug($"Ergebnisprüfung abgeschlossen: AdditionalDataResultsExist={AdditionalDataResultsExist}, AdditionalDocResultsExist={AdditionalDocResultsExist}")
|
||||
rbnPgGroupAttmt.Visible = AdditionalDataResultsExist OrElse AdditionalDocResultsExist
|
||||
MyValidationLogger.Debug($"rbnPgGroupAttmt.Visible gesetzt auf: {rbnPgGroupAttmt.Visible} | Stack: {New System.Diagnostics.StackTrace(True).ToString().Split(vbCrLf)(1)}")
|
||||
|
||||
If Not AdditionalDataResultsExist AndAlso Not AdditionalDocResultsExist Then
|
||||
If _frmValidatorSearch IsNot Nothing AndAlso Not _frmValidatorSearch.IsDisposed Then
|
||||
Dim emptySql As DataTable = allSQLSearches.Clone()
|
||||
Dim emptyDoc As DataTable = allDocSearches.Clone()
|
||||
_frmValidatorSearch._DTDATASearches = emptySql
|
||||
_frmValidatorSearch._DTDocSearches = emptyDoc
|
||||
_frmValidatorSearch.TabPreload(0, 0, emptySql, emptyDoc)
|
||||
End If
|
||||
|
||||
MyValidationLogger.Debug("Load_Additional_Searches: Keine Ergebnisse (DATA/DOC) -> Exit.")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Preload Then
|
||||
MyValidationLogger.Debug("--- PRELOAD-MODUS aktiviert (mit Show) ---")
|
||||
Dim preloadSQL As DataTable = If(allSQLSearches.Rows.Count > 0, allSQLSearches.Copy(), allSQLSearches.Clone())
|
||||
Dim preloadDoc As DataTable = If(allDocSearches.Rows.Count > 0, allDocSearches.Copy(), allDocSearches.Clone())
|
||||
|
||||
_frmValidatorSearch._DTDATASearches = preloadSQL
|
||||
_frmValidatorSearch._DTDocSearches = preloadDoc
|
||||
_frmValidatorSearch.TabPreload(preloadSQL.Rows.Count, preloadDoc.Rows.Count, preloadSQL, preloadDoc)
|
||||
|
||||
' Vorgabe: Preload=True => Formular öffnen
|
||||
If Not _frmValidatorSearch.Visible Then
|
||||
_frmValidatorSearch.Show()
|
||||
End If
|
||||
|
||||
Return
|
||||
End If
|
||||
|
||||
MyValidationLogger.Debug("--- NORMAL-MODUS aktiviert (nur vorbereiten, NICHT Show) ---")
|
||||
Dim sqlForUi As DataTable = If(validSQLSearches.Rows.Count > 0, validSQLSearches.Copy(), validSQLSearches.Clone())
|
||||
Dim docForUi As DataTable = If(validDocSearches.Rows.Count > 0, validDocSearches.Copy(), validDocSearches.Clone())
|
||||
|
||||
_frmValidatorSearch._DTDATASearches = sqlForUi
|
||||
_frmValidatorSearch._DTDocSearches = docForUi
|
||||
_frmValidatorSearch.TabPreload(sqlForUi.Rows.Count, docForUi.Rows.Count, sqlForUi, docForUi)
|
||||
|
||||
' Vorgabe: Preload=False => nur vorbereiten, KEIN Show hier
|
||||
MyValidationLogger.Debug("Load_Additional_Searches: Vorbereitung abgeschlossen (Preload=False), Formular bleibt geschlossen.")
|
||||
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Error("❌ Kritischer Fehler in Load_Additional_Searches", ex)
|
||||
Finally
|
||||
_isLoadingAdditionalSearches = False
|
||||
MyValidationLogger.Debug("=== Load_Additional_Searches END ===")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub EnsureSqlControlLookup()
|
||||
If _CachedSqlControlsByGuid IsNot Nothing Then
|
||||
@@ -1336,14 +1411,14 @@ Public Class frmValidator
|
||||
End If
|
||||
' ========== ENDE ==========
|
||||
|
||||
oSQL = $"SELECT IIF(LANG.CAPTION IS NULL,T.SPALTEN_HEADER,LANG.CAPTION) SPALTEN_HEADER_LANG, T.* from TBPM_CONTROL_TABLE T INNER JOIN TBPM_PROFILE_CONTROLS T1 ON T.CONTROL_ID = T1.GUID
|
||||
oSQL = $"SELECT IIF(LANG.CAPTION IS NULL,T.SPALTEN_HEADER,LANG.CAPTION) SPALTEN_HEADER_LANG, T.* from TBPM_CONTROL_TABLE T WITH (NOLOCK) INNER JOIN TBPM_PROFILE_CONTROLS T1 WITH (NOLOCK) ON T.CONTROL_ID = T1.GUID
|
||||
LEFT JOIN (SELECT * FROM TBPM_CONTOL_TABLE_LANG WHERE LANG_CODE = '{USER_LANGUAGE}') LANG ON T.GUID = LANG.COL_ID WHERE T1.CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY T.SEQUENCE"
|
||||
DT_COLUMNS_GRID = DatabaseFallback.GetDatatable("TBPM_CONTROL_TABLE", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
||||
.FilterExpression = $"PROFIL_ID = {CURRENT_ProfilGUID} AND LANG_CODE = '{USER_LANGUAGE}' ",
|
||||
.SortByColumn = "SEQUENCE"
|
||||
})
|
||||
|
||||
oSQL = "SELECT T1.GUID As CONTROL_ID, T1.PROFIL_ID, T.CONNECTION_ID, T.SQL_COMMAND, T.SPALTENNAME,T.FORMATTYPE,T.FORMATSTRING, T.ADVANCED_LOOKUP from TBPM_CONTROL_TABLE T, TBPM_PROFILE_CONTROLS T1 WHERE T1.CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = " & CURRENT_ProfilGUID & " AND LEN(T.SQL_COMMAND) > 0 ORDER BY T.SEQUENCE"
|
||||
oSQL = "SELECT T1.GUID As CONTROL_ID, T1.PROFIL_ID, T.CONNECTION_ID, T.SQL_COMMAND, T.SPALTENNAME,T.FORMATTYPE,T.FORMATSTRING, T.ADVANCED_LOOKUP from TBPM_CONTROL_TABLE T WITH (NOLOCK), TBPM_PROFILE_CONTROLS T1 WITH (NOLOCK) WHERE T1.CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = " & CURRENT_ProfilGUID & " AND LEN(T.SQL_COMMAND) > 0 ORDER BY T.SEQUENCE"
|
||||
'DT_COLUMNS_GRID_WITH_SQL = DataASorDB.GetDatatable("DD_ECM", oSQL, "DTGRID_SQL_DEFINITION", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
|
||||
DT_COLUMNS_GRID_WITH_SQL = DatabaseFallback.GetDatatable("DTGRID_SQL_DEFINITION", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
||||
.FilterExpression = $"PROFIL_ID = {CURRENT_ProfilGUID}",
|
||||
@@ -1664,7 +1739,7 @@ Public Class frmValidator
|
||||
Catch ex As Exception
|
||||
Dim st As New StackTrace(True)
|
||||
st = New StackTrace(ex, True)
|
||||
'Logger.Error(ex)
|
||||
'MyValidationLogger.Error(ex)
|
||||
Dim omsg = $"Unexpected Error in Create_Controls (Select Case) [{oControlInfo}] - ERROR: {ex.Message}"
|
||||
MyValidationLogger.Warn(omsg)
|
||||
If DEBUG = False Then MsgBox(omsg, MsgBoxStyle.Critical, "Attention:")
|
||||
@@ -2783,7 +2858,8 @@ Public Class frmValidator
|
||||
' KstVerantwortliche bereits befüllt wurde.
|
||||
If changedControlNames.Count > 0 Then
|
||||
MyValidationLogger.Debug($"[SetControlValues_FromControl] Führe Controls2beEnabled für {changedControlNames.Count} geänderte Controls aus...")
|
||||
_CachedSqlScalarCache.Clear() ' SQL_ENABLE-Cache invalidieren, damit frische Werte geprüft werden
|
||||
' WICHTIG: SQL-Cache leeren ist NICHT nötig, da Controls2beEnabled bereits frische DB-Werte holt
|
||||
' _CachedSqlScalarCache.Clear() wurde entfernt, um Performance zu verbessern
|
||||
For Each changedName As String In changedControlNames
|
||||
Try
|
||||
Controls2beEnabled(changedName)
|
||||
@@ -2946,7 +3022,7 @@ Public Class frmValidator
|
||||
Finally
|
||||
_suppressLookupEvents = wasSuppressed
|
||||
_DependingControl_In_Action = False
|
||||
LOGGER.Debug($"[LookupControl_DependingControls] _suppressLookupEvents zurückgesetzt auf [{wasSuppressed}]")
|
||||
MyValidationLogger.Debug($"[LookupControl_DependingControls] _suppressLookupEvents zurückgesetzt auf [{wasSuppressed}]")
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
@@ -3425,16 +3501,16 @@ Public Class frmValidator
|
||||
MyValidationLogger.Debug("Skipping: Invalid SQL_ENABLE_ON_LOAD")
|
||||
Continue For
|
||||
End If
|
||||
LOGGER.Debug($"[Controls2B_EnDisabled_onLoad] BEFORE ReplaceAllValues for Control [{oENABLE_CtrlName}]")
|
||||
LOGGER.Debug($" SQL Command: [{oSqlCommand}]")
|
||||
LOGGER.Debug($" Panel Controls Count: [{PanelValidatorControl?.Controls?.Count - 1}]")
|
||||
MyValidationLogger.Debug($"[Controls2B_EnDisabled_onLoad] BEFORE ReplaceAllValues for Control [{oENABLE_CtrlName}]")
|
||||
MyValidationLogger.Debug($" SQL Command: [{oSqlCommand}]")
|
||||
MyValidationLogger.Debug($" Panel Controls Count: [{PanelValidatorControl?.Controls?.Count - 1}]")
|
||||
Try
|
||||
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
|
||||
LOGGER.Debug($"[Controls2B_EnDisabled_onLoad] AFTER ReplaceAllValues: [{oSqlCommand}]")
|
||||
MyValidationLogger.Debug($"[Controls2B_EnDisabled_onLoad] AFTER ReplaceAllValues: [{oSqlCommand}]")
|
||||
Catch replaceEx As Exception
|
||||
LOGGER.Error(replaceEx)
|
||||
MyValidationLogger.Error(replaceEx)
|
||||
MyValidationLogger.Error($"❌ [Controls2B_EnDisabled_onLoad] ReplaceAllValues CRASH für [{oENABLE_CtrlName}]: {replaceEx.Message}")
|
||||
LOGGER.Error($" Original SQL: [{oSqlCommand}]")
|
||||
MyValidationLogger.Error($" Original SQL: [{oSqlCommand}]")
|
||||
Continue For ' ← Überspringe dieses Control und mache weiter
|
||||
End Try
|
||||
' FIX: Null/Empty-Check nach ReplaceAllValues — verhindert Crash bei leeren Control-Werten
|
||||
@@ -3680,14 +3756,14 @@ Public Class frmValidator
|
||||
Dim cs As String = DatabaseFallback.GetConnectionString(oConnectionId)
|
||||
|
||||
If allgFunk.CheckValue_Exists(dr.Item("SQL_UEBERPRUEFUNG"), "@Eingabe", control.Text, dr.Item("TYP"), cs, CURRENT_ProfilGUID) = True Then
|
||||
Return True
|
||||
Else
|
||||
errormessage = "the input-value '" & control.Text & "' is not existing in database!"
|
||||
My.Settings.Save()
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return True
|
||||
Else
|
||||
errormessage = "the input-value '" & control.Text & "' is not existing in database!"
|
||||
My.Settings.Save()
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -3878,28 +3954,42 @@ Public Class frmValidator
|
||||
MyValidationLogger.Debug($"GetDocPathWindows: Filestore is {ClassConstants.OpModeFS_ZF}")
|
||||
End If
|
||||
|
||||
|
||||
If COPY_WMFILE_2TEMP = True Then
|
||||
' Optionen konfigurieren
|
||||
Dim options As New ClassDocumentPathHandler.DocumentPathOptions With {
|
||||
.EnableMapping = True,
|
||||
.WMSuffix = WMSUFFIX,
|
||||
.SpecificDrive = If(Len(MAP_SHARE_DRIVE) = 1, MAP_SHARE_DRIVE, ""),
|
||||
.DriveBlacklist = MAP_BLACKLIST,
|
||||
.CopyToTemp = True,
|
||||
.TempFolder = TEMP_DOCUMENT_FOLDER,
|
||||
.UnmapAfterCopy = True
|
||||
}
|
||||
Dim options As New DocumentPathHandler.DocumentPathOptions With {
|
||||
.EnableMapping = True,
|
||||
.WMSuffix = WMSUFFIX,
|
||||
.SpecificDrive = If(Len(MAP_SHARE_DRIVE) = 1, MAP_SHARE_DRIVE, ""),
|
||||
.DriveBlacklist = MAP_BLACKLIST,
|
||||
.CopyToTemp = True,
|
||||
.TempFolder = TEMP_DOCUMENT_FOLDER,
|
||||
.UnmapAfterCopy = True
|
||||
}
|
||||
|
||||
' Verarbeiten
|
||||
Dim result = _documentPathHandler.ProcessDocumentPath(oFilePath_from_DB, options)
|
||||
|
||||
If result.Success Then
|
||||
' Guard: FinalPath muss nutzbar sein
|
||||
If result.Success AndAlso
|
||||
Not String.IsNullOrWhiteSpace(result.FinalPath) AndAlso
|
||||
File.Exists(result.FinalPath) Then
|
||||
|
||||
DocPathWindows = result.FinalPath
|
||||
WMDocPathWindows = oFilePath_from_DB
|
||||
MyValidationLogger.Info($"✓ Dokument verarbeitet: [{Path.GetFileName(result.FinalPath)}]")
|
||||
Else
|
||||
MyValidationLogger.Error($"❌ Fehler: {result.ErrorMessage}")
|
||||
MyValidationLogger.Warn($"⚠️ Dokumentpfad-Verarbeitung fehlgeschlagen: {result.ErrorMessage}")
|
||||
MyValidationLogger.Warn($"⚠️ Fallback auf Originalpfad: [{oFilePath_from_DB}]")
|
||||
|
||||
DocPathWindows = oFilePath_from_DB
|
||||
WMDocPathWindows = oFilePath_from_DB
|
||||
|
||||
' Sicherheitsprüfung des Fallbacks
|
||||
If Not File.Exists(DocPathWindows) Then
|
||||
MyValidationLogger.Error($"❌ Auch Fallback-Pfad existiert nicht: [{DocPathWindows}]")
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
DocPathWindows = oFilePath_from_DB
|
||||
@@ -3982,9 +4072,12 @@ Public Class frmValidator
|
||||
OverrideAll = False
|
||||
_Indexe_Loaded = False
|
||||
MyValidationLogger.Debug("In Load_Next_Document")
|
||||
' Alte Temp-Datei aufräumen (falls vorhanden)
|
||||
If Not first Then
|
||||
CleanupCurrentTempFile()
|
||||
If Not first AndAlso COPY_WMFILE_2TEMP = True Then
|
||||
Try
|
||||
CleanupCurrentTempFile()
|
||||
Catch cleanupEx As Exception
|
||||
MyValidationLogger.Warn($"⚠️ Fehler beim Löschen der vorherigen Temp-Datei: {cleanupEx.Message}")
|
||||
End Try
|
||||
End If
|
||||
Dim layoutSuspended As Boolean = False
|
||||
Try
|
||||
@@ -4857,7 +4950,7 @@ Public Class frmValidator
|
||||
End If
|
||||
|
||||
Else
|
||||
MyValidationLogger.Debug($"GetVariableValuefromSource - IDBCase...")
|
||||
MyValidationLogger.Debug($"GetVariableValuefromSource - IDBCase - IndexName: {oSourceIndexName}, IDBTyp: {oIDBTyp}, FromIDB: {FromIDB}")
|
||||
oValuefromSource = IDBData.GetVariableValue(oSourceIndexName, oIDBTyp, FromIDB)
|
||||
End If
|
||||
Return oValuefromSource
|
||||
@@ -4870,7 +4963,7 @@ Public Class frmValidator
|
||||
|
||||
Sub FillIndexValues(first As Boolean, Optional SingleAttribute As String = "")
|
||||
If _SetControlValue_In_Action AndAlso Not String.IsNullOrWhiteSpace(SingleAttribute) Then
|
||||
MyValidationLogger.Debug("FillIndexValues", $"Übersprungen: SetControlValue läuft für [{SingleAttribute}]")
|
||||
MyValidationLogger.Debug("FillIndexValues", $"⛔ BLOCKIERT während SetControlValue - Attribut [{SingleAttribute}] nicht aus IDB neu laden")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -5702,11 +5795,16 @@ Public Class frmValidator
|
||||
Dim oDEPENDING_COLUMN = oRow.Item("SPALTENNAME")
|
||||
Dim oSqlCommand = oRow.Item("SQL_COMMAND")
|
||||
Dim oCONNID = 1
|
||||
If Not IsNullOrEmpty(oRow.Item("CONN_ID")) Then
|
||||
oCONNID = CInt(oRow.Item("CONN_ID"))
|
||||
Else
|
||||
MyValidationLogger.Warn($"⚠️ CONN_ID is null or empty for CONTROL_ID {oDEPENDING_CTRL_ID} - defaulting to 1")
|
||||
End If
|
||||
Try
|
||||
If Not IsNullOrEmpty(oRow.Item("CONNECTION_ID")) Then
|
||||
oCONNID = CInt(oRow.Item("CONNECTION_ID"))
|
||||
Else
|
||||
MyValidationLogger.Warn($"⚠️ CONN_ID is null or empty for CONTROL_ID {oDEPENDING_CTRL_ID} - defaulting to 1")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Warn($"⚠️ FillIndexValues - Error in creating dropdown for Grid - CONTROL_ID {oDEPENDING_CTRL_ID}: " & ex.Message)
|
||||
End Try
|
||||
|
||||
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
|
||||
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
|
||||
|
||||
@@ -5815,7 +5913,7 @@ Public Class frmValidator
|
||||
_Indexe_Loaded = True
|
||||
|
||||
Load_Additional_Searches(Not CONFIG.Config.ADDITIONAL_SEARCHES_LOAD_ONCLICK)
|
||||
|
||||
MyValidationLogger.Debug($"[FillIndexValues] Nach Load_Additional_Searches: rbnPgGroupAttmt.Visible={rbnPgGroupAttmt.Visible}")
|
||||
If LOG_HOTSPOTS Then
|
||||
MyValidationLogger.Info($"[PERF FillIndexValues] Nach Load_Additional_Searches: {(DateTime.Now - perfLastCheck).TotalMilliseconds}ms")
|
||||
perfLastCheck = DateTime.Now
|
||||
@@ -7623,7 +7721,7 @@ Public Class frmValidator
|
||||
If IDB_ACTIVE Then
|
||||
If oMissing = False Then
|
||||
If Not IDBData.CommitBatch() Then
|
||||
LOGGER.Warn("CommitBatch failed in Check_UpdateIndexe")
|
||||
MyValidationLogger.Warn("CommitBatch failed in Check_UpdateIndexe")
|
||||
oMissing = True
|
||||
End If
|
||||
Else
|
||||
@@ -8231,13 +8329,50 @@ Public Class frmValidator
|
||||
End Sub
|
||||
Sub TryOpen_Additional_Searches()
|
||||
Try
|
||||
_frmValidatorSearch?.Close()
|
||||
_frmValidatorSearch = New frmValidatorSearch(Me, Environment)
|
||||
_frmValidatorSearch.Show()
|
||||
MyValidationLogger.Debug("=== TryOpen_Additional_Searches START ===")
|
||||
|
||||
Dim hasDATASearches As Boolean = (DT_FILTERED_PROFILE_SEARCHES_DATA IsNot Nothing AndAlso DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0)
|
||||
Dim hasDOCSearches As Boolean = (DT_FILTERED_PROFILE_SEARCHES_DOC IsNot Nothing AndAlso DT_FILTERED_PROFILE_SEARCHES_DOC.Rows.Count > 0)
|
||||
|
||||
If Not hasDATASearches AndAlso Not hasDOCSearches Then Exit Sub
|
||||
|
||||
' 1) Immer vorbereiten (ohne Show)
|
||||
Load_Additional_Searches(False)
|
||||
|
||||
If _frmValidatorSearch Is Nothing OrElse _frmValidatorSearch.IsDisposed Then
|
||||
MyValidationLogger.Debug("Instantiating frmValidatorSearch for additional searches...")
|
||||
_frmValidatorSearch = New frmValidatorSearch(Me, Environment)
|
||||
End If
|
||||
|
||||
' 2) Öffnen nur hier per User-Aktion
|
||||
Dim wasVisible As Boolean = _frmValidatorSearch.Visible
|
||||
If Not wasVisible Then
|
||||
MyValidationLogger.Debug("Showing frmValidatorSearch for additional searches...")
|
||||
_frmValidatorSearch.Show()
|
||||
Else
|
||||
MyValidationLogger.Debug("Bringing frmValidatorSearch to front for additional searches...")
|
||||
_frmValidatorSearch.BringToFront()
|
||||
End If
|
||||
|
||||
' 3) WICHTIG: Nach erstem Show erneut binden (UI ist jetzt vollständig initialisiert)
|
||||
If Not wasVisible Then
|
||||
Me.BeginInvoke(New Action(Sub()
|
||||
Try
|
||||
If _frmValidatorSearch IsNot Nothing AndAlso
|
||||
Not _frmValidatorSearch.IsDisposed AndAlso
|
||||
_frmValidatorSearch.Visible Then
|
||||
MyValidationLogger.Debug("TryOpen_Additional_Searches: Post-Show Rebind gestartet")
|
||||
Load_Additional_Searches(False)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Error("❌ Fehler beim Post-Show Rebind in TryOpen_Additional_Searches", ex)
|
||||
End Try
|
||||
End Sub))
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MyValidationLogger.Error(ex)
|
||||
MyValidationLogger.Error("❌ Fehler in TryOpen_Additional_Searches", ex)
|
||||
End Try
|
||||
Load_Additional_Searches(True)
|
||||
End Sub
|
||||
Private Sub bbtniRefresh_ItemClick(sender As Object, e As ItemClickEventArgs) Handles bbtniRefresh.ItemClick
|
||||
' ========== KRITISCH: Events KOMPLETT blockieren während Refresh ==========
|
||||
@@ -8416,6 +8551,7 @@ Public Class frmValidator
|
||||
End Sub
|
||||
|
||||
Private Sub Attmt_bbtnitmShow_Click(sender As Object, e As ItemClickEventArgs) Handles Attmt_bbtnitmShow.ItemClick
|
||||
MyValidationLogger.Debug("Attmt_bbtnitmShow.ItemClick...")
|
||||
TryOpen_Additional_Searches()
|
||||
End Sub
|
||||
|
||||
@@ -8627,13 +8763,13 @@ Public Class frmValidator
|
||||
'For Each oControl As Control In PanelValidatorControl.Controls
|
||||
' If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Attribute = PROFIL_NOT_RESP_COMMENT_ATTR Then
|
||||
' Dim oName = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Name
|
||||
' Logger.Debug($"Got the control for the NR Attribute :{oName}..Gettin the value...")
|
||||
' MyValidationLogger.Debug($"Got the control for the NR Attribute :{oName}..Gettin the value...")
|
||||
' If oControl.GetType() = GetType(DevExpress.XtraEditors.TextEdit) Or oControl.GetType() = GetType(MemoEdit) Then
|
||||
' Try
|
||||
' DirectCast(oControl, DevExpress.XtraEditors.TextEdit).EditValue = frmDialog.oComment
|
||||
' Exit For
|
||||
' Catch ex As Exception
|
||||
' Logger.Warn($"⚠️ Unexpected error in Setting EditValue NotResponsible: {ex.Message}")
|
||||
' MyValidationLogger.Warn($"⚠️ Unexpected error in Setting EditValue NotResponsible: {ex.Message}")
|
||||
' End Try
|
||||
' End If
|
||||
' End If
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>349, 557</value>
|
||||
<value>279, 446</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="GridControlDocSearch1.TabIndex" type="System.Int32, mscorlib">
|
||||
@@ -187,7 +187,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>349, 557</value>
|
||||
<value>279, 446</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
@@ -229,7 +229,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>349, 557</value>
|
||||
<value>279, 446</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
@@ -271,7 +271,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>349, 557</value>
|
||||
<value>279, 446</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
@@ -313,7 +313,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>349, 557</value>
|
||||
<value>279, 446</value>
|
||||
</data>
|
||||
<data name="GridControlDocSearch5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
@@ -454,7 +454,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlSearch1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>344, 560</value>
|
||||
<value>275, 448</value>
|
||||
</data>
|
||||
<data name="GridControlSearch1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
@@ -502,7 +502,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlSearch2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>275, 448</value>
|
||||
</data>
|
||||
<data name="GridControlSearch2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
@@ -520,7 +520,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>344, 560</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch2.Text" xml:space="preserve">
|
||||
<value>Search2</value>
|
||||
@@ -544,7 +544,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlSearch3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>275, 448</value>
|
||||
</data>
|
||||
<data name="GridControlSearch3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
@@ -562,7 +562,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>344, 560</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch3.Text" xml:space="preserve">
|
||||
<value>XtraTabPage1</value>
|
||||
@@ -586,7 +586,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlSearch4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>275, 448</value>
|
||||
</data>
|
||||
<data name="GridControlSearch4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
@@ -604,7 +604,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>344, 560</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch4.Text" xml:space="preserve">
|
||||
<value>XtraTabPage2</value>
|
||||
@@ -628,7 +628,7 @@
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="GridControlSearch5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>275, 448</value>
|
||||
</data>
|
||||
<data name="GridControlSearch5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
@@ -646,7 +646,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>511, 560</value>
|
||||
<value>344, 560</value>
|
||||
</data>
|
||||
<data name="XtraTabPageSearch5.Text" xml:space="preserve">
|
||||
<value>XtraTabPage3</value>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports DevExpress.Utils
|
||||
@@ -7,12 +8,13 @@ Imports DevExpress.XtraGrid.Columns
|
||||
Imports DevExpress.XtraGrid.Views.Base
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraTab
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.GUIs.Common.DocumentResultList
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.EDMI.API.Constants
|
||||
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
|
||||
Imports DigitalData.Modules.ZooFlow.Constants
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.Modules.ZooFlow.Constants
|
||||
|
||||
Public Class frmValidatorSearch
|
||||
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)>
|
||||
@@ -43,7 +45,7 @@ Public Class frmValidatorSearch
|
||||
#End Region
|
||||
Public formLoaded As Boolean = False
|
||||
Public _DTDocSearches As DataTable
|
||||
Public _DTSQLSearches As DataTable
|
||||
Public _DTDATASearches As DataTable
|
||||
Private _frmValidator As frmValidator 'You need a reference to Form1
|
||||
Private Shared BW_DocPath As String
|
||||
Private Shared BW_DocID As Integer
|
||||
@@ -51,7 +53,8 @@ Public Class frmValidatorSearch
|
||||
Private Documentloader As Loader
|
||||
Private Property OperationMode As OperationMode
|
||||
Private ReadOnly Environment As Environment
|
||||
Private _documentPathHandler As ClassDocumentPathHandler
|
||||
Private _documentPathHandler As DocumentPathHandler
|
||||
Private _suppressTabEvents As Boolean = False
|
||||
|
||||
Public Sub New(pfrmValidator As frmValidator, pEnvironment As Environment)
|
||||
|
||||
@@ -80,52 +83,354 @@ Public Class frmValidatorSearch
|
||||
End Function
|
||||
Public Sub TabPreload(TabCountSQL As Integer, TabCountDoc As Integer, DTSQL As DataTable, DTDOC As DataTable)
|
||||
Try
|
||||
SplitContainerSearches.Panel1Collapsed = IIf(DTSQL.Rows.Count > 0, False, True)
|
||||
SplitContainerSearches.Panel2Collapsed = IIf(DTDOC.Rows.Count > 0, False, True)
|
||||
If Me.InvokeRequired() Then
|
||||
Me.Invoke(Sub() TabPreload(TabCountSQL, TabCountDoc, DTSQL, DTDOC))
|
||||
Else
|
||||
'#### SQL Tabs Design Laden
|
||||
|
||||
If DTSQL.Rows.Count > 0 Then
|
||||
LOGGER.Debug(String.Format("[{0} SQL-Definitions]", DTSQL.Rows.Count))
|
||||
For p As Integer = 0 To XtraTabControlSQL.TabPages.Count - 1
|
||||
If XtraTabControlSQL.TabPages(p).TabIndex >= TabCountSQL Then
|
||||
XtraTabControlSQL.TabPages(p).PageVisible = False
|
||||
End If
|
||||
Next
|
||||
For p As Integer = 0 To XtraTabControlSQL.TabPages.Count - 1
|
||||
If XtraTabControlSQL.TabPages(p).TabIndex >= TabCountSQL Then
|
||||
Exit For
|
||||
End If
|
||||
XtraTabControlSQL.TabPages(p).Text = DTSQL.Rows(p).Item("TAB_TITLE")
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
If DTDOC.Rows.Count > 0 Then
|
||||
LOGGER.Debug(String.Format("[{0} Doc-Definitions]", DTDOC.Rows.Count))
|
||||
'#### Doc Tabs Design Laden
|
||||
For p As Integer = 0 To XtraTabControlDocs.TabPages.Count - 1
|
||||
If XtraTabControlDocs.TabPages(p).TabIndex >= TabCountDoc Then
|
||||
XtraTabControlDocs.TabPages(p).PageVisible = False
|
||||
End If
|
||||
Next
|
||||
For p As Integer = 0 To XtraTabControlDocs.TabPages.Count - 1
|
||||
If XtraTabControlDocs.TabPages(p).TabIndex >= TabCountDoc Then
|
||||
Exit For
|
||||
End If
|
||||
XtraTabControlDocs.TabPages(p).Text = DTDOC.Rows(p).Item("TAB_TITLE")
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
LOGGER.Debug("=== TabPreload START ===")
|
||||
LOGGER.Debug($"Parameters: TabCountSQL={TabCountSQL}, TabCountDoc={TabCountDoc}, DTSQL.Rows={If(DTSQL?.Rows.Count, 0)}, DTDOC.Rows={If(DTDOC?.Rows.Count, 0)}")
|
||||
|
||||
' Validierung der Parameter
|
||||
If DTSQL Is Nothing Then
|
||||
LOGGER.Warn("⚠️ DTSQL ist Nothing")
|
||||
DTSQL = New DataTable()
|
||||
End If
|
||||
If DTDOC Is Nothing Then
|
||||
LOGGER.Warn("⚠️ DTDOC ist Nothing")
|
||||
DTDOC = New DataTable()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
End Try
|
||||
|
||||
' Thread-Synchronisation
|
||||
If Me.InvokeRequired() Then
|
||||
LOGGER.Debug("InvokeRequired=True, rufe auf UI-Thread auf")
|
||||
Me.Invoke(Sub() TabPreload(TabCountSQL, TabCountDoc, DTSQL, DTDOC))
|
||||
Return
|
||||
End If
|
||||
|
||||
LOGGER.Debug("Ausführung auf UI-Thread")
|
||||
|
||||
' ============================================================
|
||||
' WICHTIG: Variablen VOR Try-Block deklarieren
|
||||
' ============================================================
|
||||
Dim hasSQLData As Boolean = False
|
||||
Dim hasDocData As Boolean = False
|
||||
Dim actualSQLTabCount As Integer = 0
|
||||
Dim actualDocTabCount As Integer = 0
|
||||
|
||||
' ============================================================
|
||||
' KRITISCH: Events DEAKTIVIEREN während der Rekonfiguration
|
||||
' ============================================================
|
||||
_suppressTabEvents = True
|
||||
LOGGER.Debug("🚫 Tab-Events deaktiviert")
|
||||
|
||||
Try
|
||||
' KRITISCH: DataTables SOFORT zuweisen
|
||||
_DTDATASearches = DTSQL
|
||||
_DTDocSearches = DTDOC
|
||||
LOGGER.Debug($"✓ _DTDATASearches und _DTDocSearches zugewiesen: SQL={_DTDATASearches.Rows.Count}, Doc={_DTDocSearches.Rows.Count}")
|
||||
|
||||
' TabCount-Validierung
|
||||
actualSQLTabCount = Math.Min(TabCountSQL, DTSQL.Rows.Count)
|
||||
actualDocTabCount = Math.Min(TabCountDoc, DTDOC.Rows.Count)
|
||||
|
||||
If actualSQLTabCount <> TabCountSQL Then
|
||||
LOGGER.Warn($"⚠️ TabCountSQL korrigiert: {TabCountSQL} → {actualSQLTabCount}")
|
||||
End If
|
||||
If actualDocTabCount <> TabCountDoc Then
|
||||
LOGGER.Warn($"⚠️ TabCountDoc korrigiert: {TabCountDoc} → {actualDocTabCount}")
|
||||
End If
|
||||
|
||||
' Panel-Sichtbarkeit
|
||||
hasSQLData = DTSQL.Rows.Count > 0 AndAlso actualSQLTabCount > 0
|
||||
hasDocData = DTDOC.Rows.Count > 0 AndAlso actualDocTabCount > 0
|
||||
|
||||
SplitContainerSearches.Panel1Collapsed = Not hasSQLData
|
||||
SplitContainerSearches.Panel2Collapsed = Not hasDocData
|
||||
|
||||
LOGGER.Debug($"Panel1Collapsed (SQL)={SplitContainerSearches.Panel1Collapsed}, Panel2Collapsed (Doc)={SplitContainerSearches.Panel2Collapsed}")
|
||||
|
||||
' ============================================================
|
||||
' KRITISCH: DocumentViewer nur bei Doc-Searches sichtbar
|
||||
' ============================================================
|
||||
If hasDocData Then
|
||||
If Not DocumentViewer1.Visible Then
|
||||
DocumentViewer1.Visible = True
|
||||
LOGGER.Debug("✓ DocumentViewer1 sichtbar gemacht (Doc-Searches vorhanden)")
|
||||
End If
|
||||
Else
|
||||
If DocumentViewer1.Visible Then
|
||||
DocumentViewer1.Visible = False
|
||||
LOGGER.Debug("✓ DocumentViewer1 ausgeblendet (keine Doc-Searches)")
|
||||
End If
|
||||
End If
|
||||
|
||||
' #### SQL Tabs konfigurieren
|
||||
If hasSQLData Then
|
||||
LOGGER.Debug($"Konfiguriere SQL-Tabs: {DTSQL.Rows.Count} Definitionen")
|
||||
|
||||
' ALLE Tabs unsichtbar machen
|
||||
For p As Integer = 0 To XtraTabControlSQL.TabPages.Count - 1
|
||||
XtraTabControlSQL.TabPages(p).PageVisible = False
|
||||
Next
|
||||
LOGGER.Debug($"Alle {XtraTabControlSQL.TabPages.Count} SQL-Tabs auf PageVisible=False gesetzt")
|
||||
|
||||
' Nur benötigte Tabs sichtbar machen
|
||||
Dim processedTabs As Integer = 0
|
||||
For p As Integer = 0 To Math.Min(actualSQLTabCount - 1, XtraTabControlSQL.TabPages.Count - 1)
|
||||
If p < DTSQL.Rows.Count Then
|
||||
Try
|
||||
Dim tabTitle As String = If(DTSQL.Rows(p).Item("TAB_TITLE")?.ToString(), $"Tab {p + 1}")
|
||||
XtraTabControlSQL.TabPages(p).Text = tabTitle
|
||||
XtraTabControlSQL.TabPages(p).PageVisible = True
|
||||
processedTabs += 1
|
||||
LOGGER.Debug($"SQL-Tab {p}: Text='{tabTitle}', PageVisible=True")
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"❌ Fehler beim Konfigurieren von SQL-Tab {p}", ex)
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
|
||||
LOGGER.Info($"✓ {processedTabs} SQL-Tabs konfiguriert")
|
||||
Else
|
||||
LOGGER.Debug("Keine SQL-Daten, alle Tabs ausblenden")
|
||||
For p As Integer = 0 To XtraTabControlSQL.TabPages.Count - 1
|
||||
XtraTabControlSQL.TabPages(p).PageVisible = False
|
||||
Next
|
||||
End If
|
||||
|
||||
' #### Doc Tabs konfigurieren
|
||||
If hasDocData Then
|
||||
LOGGER.Debug($"Konfiguriere Doc-Tabs: {DTDOC.Rows.Count} Definitionen")
|
||||
|
||||
' ALLE Tabs unsichtbar machen
|
||||
For p As Integer = 0 To XtraTabControlDocs.TabPages.Count - 1
|
||||
XtraTabControlDocs.TabPages(p).PageVisible = False
|
||||
Next
|
||||
LOGGER.Debug($"Alle {XtraTabControlDocs.TabPages.Count} Doc-Tabs auf PageVisible=False gesetzt")
|
||||
|
||||
' Nur benötigte Tabs sichtbar machen
|
||||
Dim processedTabs As Integer = 0
|
||||
For p As Integer = 0 To Math.Min(actualDocTabCount - 1, XtraTabControlDocs.TabPages.Count - 1)
|
||||
If p < DTDOC.Rows.Count Then
|
||||
Try
|
||||
Dim tabTitle As String = If(DTDOC.Rows(p).Item("TAB_TITLE")?.ToString(), $"Tab {p + 1}")
|
||||
XtraTabControlDocs.TabPages(p).Text = tabTitle
|
||||
XtraTabControlDocs.TabPages(p).PageVisible = True
|
||||
processedTabs += 1
|
||||
LOGGER.Debug($"Doc-Tab {p}: Text='{tabTitle}', PageVisible=True")
|
||||
Catch ex As Exception
|
||||
LOGGER.Error($"❌ Fehler beim Konfigurieren von Doc-Tab {p}", ex)
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
|
||||
LOGGER.Info($"✓ {processedTabs} Doc-Tabs konfiguriert")
|
||||
Else
|
||||
LOGGER.Debug("Keine Doc-Daten, alle Tabs ausblenden")
|
||||
For p As Integer = 0 To XtraTabControlDocs.TabPages.Count - 1
|
||||
XtraTabControlDocs.TabPages(p).PageVisible = False
|
||||
Next
|
||||
End If
|
||||
|
||||
Finally
|
||||
' ============================================================
|
||||
' KRITISCH: Events REAKTIVIEREN nach Rekonfiguration
|
||||
' ============================================================
|
||||
_suppressTabEvents = False
|
||||
LOGGER.Debug("✓ Tab-Events reaktiviert")
|
||||
End Try
|
||||
|
||||
' JETZT manuell den ersten sichtbaren Tab aktivieren
|
||||
' ERSETZE im unteren Teil von TabPreload den SQL-Block:
|
||||
If hasSQLData AndAlso XtraTabControlSQL.TabPages.Count > 0 Then
|
||||
Dim firstVisibleSqlIndex As Integer = -1
|
||||
For i As Integer = 0 To XtraTabControlSQL.TabPages.Count - 1
|
||||
If XtraTabControlSQL.TabPages(i).PageVisible Then
|
||||
firstVisibleSqlIndex = i
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If firstVisibleSqlIndex >= 0 AndAlso _DTDATASearches IsNot Nothing AndAlso firstVisibleSqlIndex < _DTDATASearches.Rows.Count Then
|
||||
LOGGER.Debug($"Setze SQL SelectedTabPageIndex manuell auf {firstVisibleSqlIndex}")
|
||||
|
||||
Dim prevSuppress As Boolean = _suppressTabEvents
|
||||
_suppressTabEvents = True
|
||||
XtraTabControlSQL.SelectedTabPageIndex = firstVisibleSqlIndex
|
||||
_suppressTabEvents = prevSuppress
|
||||
|
||||
Try
|
||||
Dim selectedRow As DataRow = _DTDATASearches.Rows(firstVisibleSqlIndex)
|
||||
Dim oConID As Integer = If(IsDBNull(selectedRow.Item("CONN_ID")), 1, CInt(selectedRow.Item("CONN_ID")))
|
||||
Dim oCommand As String = selectedRow.Item("SQL_COMMAND")?.ToString()
|
||||
Dim oTabCaption As String = If(selectedRow.Item("TAB_TITLE")?.ToString(), $"Tab {firstVisibleSqlIndex}")
|
||||
|
||||
If Not String.IsNullOrEmpty(oCommand) Then
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
LOGGER.Debug($"SQL-Tab {firstVisibleSqlIndex}: erzwungener Initial-Refresh")
|
||||
RefreshTabSQL(oConID, oCommand, firstVisibleSqlIndex, oTabCaption)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error("❌ Fehler beim SQL-Initial-Refresh in TabPreload", ex)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
' ERSETZE im unteren Teil von TabPreload den Doc-Block:
|
||||
If hasDocData AndAlso XtraTabControlDocs.TabPages.Count > 0 Then
|
||||
Dim firstVisibleDocIndex As Integer = -1
|
||||
For i As Integer = 0 To XtraTabControlDocs.TabPages.Count - 1
|
||||
If XtraTabControlDocs.TabPages(i).PageVisible Then
|
||||
firstVisibleDocIndex = i
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If firstVisibleDocIndex >= 0 AndAlso _DTDocSearches IsNot Nothing AndAlso firstVisibleDocIndex < _DTDocSearches.Rows.Count Then
|
||||
LOGGER.Debug($"Setze Doc SelectedTabPageIndex manuell auf {firstVisibleDocIndex}")
|
||||
|
||||
Dim prevSuppress As Boolean = _suppressTabEvents
|
||||
_suppressTabEvents = True
|
||||
XtraTabControlDocs.SelectedTabPageIndex = firstVisibleDocIndex
|
||||
_suppressTabEvents = prevSuppress
|
||||
|
||||
Try
|
||||
Dim selectedRow As DataRow = _DTDocSearches.Rows(firstVisibleDocIndex)
|
||||
Dim oConID As Integer = If(IsDBNull(selectedRow.Item("CONN_ID")), 1, CInt(selectedRow.Item("CONN_ID")))
|
||||
Dim oCommand As String = selectedRow.Item("SQL_COMMAND")?.ToString()
|
||||
Dim oTabCaption As String = If(selectedRow.Item("TAB_TITLE")?.ToString(), $"Tab {firstVisibleDocIndex}")
|
||||
|
||||
If Not String.IsNullOrEmpty(oCommand) Then
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
LOGGER.Debug($"Doc-Tab {firstVisibleDocIndex}: erzwungener Initial-Refresh")
|
||||
RefreshTabDoc(oConID, oCommand, firstVisibleDocIndex, oTabCaption)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error("❌ Fehler beim Doc-Initial-Refresh in TabPreload", ex)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
LOGGER.Debug("=== TabPreload END ===")
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error("❌ Fehler in TabPreload", ex)
|
||||
LOGGER.Error($"Stack Trace: {ex.StackTrace}")
|
||||
_suppressTabEvents = False ' Sicherstellung
|
||||
|
||||
Try
|
||||
SplitContainerSearches.Panel1Collapsed = True
|
||||
SplitContainerSearches.Panel2Collapsed = True
|
||||
DocumentViewer1.Visible = False
|
||||
Catch collapseEx As Exception
|
||||
LOGGER.Error("❌ Fehler beim Kollabieren der Panels", collapseEx)
|
||||
End Try
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub XtraTabControlSQL_SelectedPageChanged(sender As Object, e As TabPageChangedEventArgs) Handles XtraTabControlSQL.SelectedPageChanged
|
||||
Try
|
||||
' KRITISCH: Event unterdrücken während TabPreload läuft
|
||||
If _suppressTabEvents Then
|
||||
LOGGER.Debug($"🚫 XtraTabControlSQL_SelectedPageChanged unterdrückt (SelectedTabPageIndex={XtraTabControlSQL.SelectedTabPageIndex})")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
LOGGER.Debug($"=== XtraTabControlSQL_SelectedPageChanged START - SelectedTabPageIndex={XtraTabControlSQL.SelectedTabPageIndex} ===")
|
||||
|
||||
If _DTDATASearches Is Nothing Then
|
||||
LOGGER.Warn("⚠️ _DTDATASearches ist Nothing - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
If XtraTabControlSQL.SelectedTabPageIndex >= 0 AndAlso
|
||||
Not XtraTabControlSQL.TabPages(XtraTabControlSQL.SelectedTabPageIndex).PageVisible Then
|
||||
LOGGER.Debug("SQL-Tab ist nicht sichtbar - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If XtraTabControlSQL.SelectedTabPageIndex >= _DTDATASearches.Rows.Count Then
|
||||
LOGGER.Error($"❌ SelectedTabPageIndex ({XtraTabControlSQL.SelectedTabPageIndex}) >= _DTDATASearches.Rows.Count ({_DTDATASearches.Rows.Count}) - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim selectedRow As DataRow = _DTDATASearches.Rows(XtraTabControlSQL.SelectedTabPageIndex)
|
||||
Dim oConID As Integer = If(IsDBNull(selectedRow.Item("CONN_ID")), 1, CInt(selectedRow.Item("CONN_ID")))
|
||||
Dim oCommand As String = selectedRow.Item("SQL_COMMAND")?.ToString()
|
||||
Dim oTabIndex As Integer = XtraTabControlSQL.SelectedTabPageIndex
|
||||
Dim oTabCaption As String = If(selectedRow.Item("TAB_TITLE")?.ToString(), $"Tab {oTabIndex}")
|
||||
|
||||
LOGGER.Debug($"Tab-Info: '{oTabCaption}', ConID={oConID}, TabIndex={oTabIndex}")
|
||||
|
||||
If String.IsNullOrEmpty(oCommand) Then
|
||||
LOGGER.Warn($"⚠️ SQL_COMMAND ist leer für Tab '{oTabCaption}' - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
LOGGER.Debug($"SQL ersetzt, Länge={oCommand.Length} Zeichen")
|
||||
|
||||
' ============================================================
|
||||
' KRITISCH: RefreshTabSQL aufrufen!
|
||||
' ============================================================
|
||||
LOGGER.Debug($"Rufe RefreshTabSQL auf für Tab '{oTabCaption}'")
|
||||
RefreshTabSQL(oConID, oCommand, oTabIndex, oTabCaption)
|
||||
|
||||
LOGGER.Debug("=== XtraTabControlSQL_SelectedPageChanged END ===")
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error("❌ Fehler in XtraTabControlSQL_SelectedPageChanged", ex)
|
||||
LOGGER.Error($"Details: SelectedTabPageIndex={XtraTabControlSQL.SelectedTabPageIndex}, _DTDATASearches.Rows.Count={If(_DTDATASearches?.Rows.Count, 0)}")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub XtraTabControlDocs_SelectedPageChanged_1(sender As Object, e As TabPageChangedEventArgs) Handles XtraTabControlDocs.SelectedPageChanged
|
||||
Try
|
||||
' KRITISCH: Event unterdrücken während TabPreload läuft
|
||||
If _suppressTabEvents Then
|
||||
LOGGER.Debug($"🚫 XtraTabControlDocs_SelectedPageChanged unterdrückt (SelectedTabPageIndex={XtraTabControlDocs.SelectedTabPageIndex})")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
LOGGER.Debug($"=== XtraTabControlDocs_SelectedPageChanged START - SelectedTabPageIndex={XtraTabControlDocs.SelectedTabPageIndex} ===")
|
||||
|
||||
If _DTDocSearches Is Nothing Then
|
||||
LOGGER.Warn("⚠️ _DTDocSearches ist Nothing - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If XtraTabControlDocs.SelectedTabPageIndex < 0 Then
|
||||
LOGGER.Debug("SelectedTabPageIndex < 0 - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If XtraTabControlDocs.SelectedTabPageIndex >= _DTDocSearches.Rows.Count Then
|
||||
LOGGER.Error($"❌ SelectedTabPageIndex ({XtraTabControlDocs.SelectedTabPageIndex}) >= _DTDocSearches.Rows.Count ({_DTDocSearches.Rows.Count}) - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim selectedRow As DataRow = _DTDocSearches.Rows(XtraTabControlDocs.SelectedTabPageIndex)
|
||||
Dim oConID As Integer = If(IsDBNull(selectedRow.Item("CONN_ID")), 1, CInt(selectedRow.Item("CONN_ID")))
|
||||
Dim oCommand As String = selectedRow.Item("SQL_COMMAND")?.ToString()
|
||||
Dim oTabIndex As Integer = XtraTabControlDocs.SelectedTabPageIndex
|
||||
Dim oTabCaption As String = If(selectedRow.Item("TAB_TITLE")?.ToString(), $"Tab {oTabIndex}")
|
||||
|
||||
LOGGER.Debug($"Tab-Info: '{oTabCaption}', ConID={oConID}, TabIndex={oTabIndex}")
|
||||
|
||||
If String.IsNullOrEmpty(oCommand) Then
|
||||
LOGGER.Warn($"⚠️ SQL_COMMAND ist leer für Tab '{oTabCaption}' - Exit Sub")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
LOGGER.Debug($"SQL ersetzt, Länge={oCommand.Length} Zeichen")
|
||||
|
||||
' ============================================================
|
||||
' KRITISCH: RefreshTabDoc aufrufen!
|
||||
' ============================================================
|
||||
LOGGER.Debug($"Rufe RefreshTabDoc auf für Tab '{oTabCaption}'")
|
||||
RefreshTabDoc(oConID, oCommand, oTabIndex, oTabCaption)
|
||||
|
||||
LOGGER.Debug("=== XtraTabControlDocs_SelectedPageChanged END ===")
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error("❌ Fehler in XtraTabControlDocs_SelectedPageChanged", ex)
|
||||
LOGGER.Error($"Details: SelectedTabPageIndex={XtraTabControlDocs.SelectedTabPageIndex}, _DTDocSearches.Rows.Count={If(_DTDocSearches?.Rows.Count, 0)}")
|
||||
End Try
|
||||
End Sub
|
||||
Public Sub RefreshTabSQL(ConID As Integer, SQLCommand As String, TabIndex As Integer, TabCaption As String)
|
||||
If Me.InvokeRequired() Then
|
||||
@@ -238,28 +543,31 @@ Public Class frmValidatorSearch
|
||||
myGridview = GridViewDocSearch5
|
||||
End Select
|
||||
myGridControl.ContextMenuStrip = ContextMenuStripWMFile
|
||||
'Dim oDatatable As DataTable = ClassDatabase.Return_Datatable_ConId(SQLCommand, ConID)
|
||||
|
||||
Dim oDatatable As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(SQLCommand, DatabaseType.ECM) With {
|
||||
.ConnectionId = ConID
|
||||
})
|
||||
.ConnectionId = ConID
|
||||
})
|
||||
|
||||
If Not IsNothing(oDatatable) Then
|
||||
XtraTabControlDocs.TabPages(TabIndex).Text = $"{TabCaption} ({oDatatable.Rows.Count})"
|
||||
clsWMDocGrid.DTDocuments = oDatatable
|
||||
'Select Case TabIndex
|
||||
' Case 0
|
||||
' GridControlDocSearch1.DataSource = oDatatable
|
||||
' Case 1
|
||||
' GridControlDocSearch2.DataSource = oDatatable
|
||||
' Case 2
|
||||
' GridControlDocSearch3.DataSource = oDatatable
|
||||
' Case 3
|
||||
' GridControlDocSearch4.DataSource = oDatatable
|
||||
' Case 4
|
||||
' GridControlDocSearch5.DataSource = oDatatable
|
||||
|
||||
'End Select
|
||||
' FIX: Nicht jedes Doc-Tab liefert echte Dokumentspalten
|
||||
Dim hasDocId As Boolean = oDatatable.Columns.Contains("DocID")
|
||||
Dim hasFullFilename As Boolean = oDatatable.Columns.Contains("FULL_FILENAME")
|
||||
|
||||
If Not hasDocId OrElse Not hasFullFilename Then
|
||||
LOGGER.Warn($"⚠️ Refresh_Load_GridDoc: Tab [{TabCaption}] liefert kein Dokument-Schema (DocID/FULL_FILENAME fehlt). Fallback auf Standard-Grid.")
|
||||
myGridControl.DataSource = oDatatable
|
||||
myGridview.BestFitColumns(True)
|
||||
clsWMDocGrid.DTDocuments = Nothing
|
||||
ToolStripDropDownButtonFile.Visible = False
|
||||
tslblState.Text = $"Tab [{TabCaption}] refreshed (fallback grid) - {Now}"
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
clsWMDocGrid.DTDocuments = oDatatable
|
||||
Create_GridControl(myGridview, oDatatable)
|
||||
|
||||
Dim oxmlPath As String = ""
|
||||
oxmlPath = Get_DocGrid_Layout_Filename(XtraTabControlDocs.SelectedTabPageIndex)
|
||||
|
||||
@@ -465,7 +773,7 @@ Public Class frmValidatorSearch
|
||||
SplitContainerSearches.SplitterDistance = My.Settings.frmValSearchSplitterDistance
|
||||
End If
|
||||
' DocumentPathHandler initialisieren
|
||||
_documentPathHandler = New ClassDocumentPathHandler(LOGGER)
|
||||
_documentPathHandler = New DocumentPathHandler(LOGCONFIG)
|
||||
|
||||
ToolStripDropDownButtonFile.Visible = False
|
||||
End Sub
|
||||
@@ -522,24 +830,7 @@ Public Class frmValidatorSearch
|
||||
formLoaded = True
|
||||
End Sub
|
||||
|
||||
Private Sub XtraTabControlSQL_SelectedPageChanged(sender As Object, e As TabPageChangedEventArgs) Handles XtraTabControlSQL.SelectedPageChanged
|
||||
If IsNothing(_DTSQLSearches) Then Exit Sub
|
||||
Dim oConID = _DTSQLSearches.Rows(XtraTabControlSQL.SelectedTabPageIndex).Item("CONN_ID")
|
||||
Dim oCommand = _DTSQLSearches.Rows(XtraTabControlSQL.SelectedTabPageIndex).Item("SQL_COMMAND")
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
Dim oTabIndex = _DTSQLSearches.Rows(XtraTabControlSQL.SelectedTabPageIndex).Item("TAB_INDEX")
|
||||
Dim oTabCaption = _DTSQLSearches.Rows(XtraTabControlSQL.SelectedTabPageIndex).Item("TAB_TITLE")
|
||||
RefreshTabSQL(oConID, oCommand, oTabIndex, oTabCaption)
|
||||
End Sub
|
||||
Private Sub XtraTabControlDocs_SelectedPageChanged_1(sender As Object, e As TabPageChangedEventArgs) Handles XtraTabControlDocs.SelectedPageChanged
|
||||
If IsNothing(_DTDocSearches) Then Exit Sub
|
||||
Dim oConID = _DTDocSearches.Rows(XtraTabControlDocs.SelectedTabPageIndex).Item("CONN_ID")
|
||||
Dim oCommand = _DTDocSearches.Rows(XtraTabControlDocs.SelectedTabPageIndex).Item("SQL_COMMAND")
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
Dim oTabIndex = _DTDocSearches.Rows(XtraTabControlDocs.SelectedTabPageIndex).Item("TAB_INDEX")
|
||||
Dim oTabCaption = _DTDocSearches.Rows(XtraTabControlDocs.SelectedTabPageIndex).Item("TAB_TITLE")
|
||||
RefreshTabDoc(oConID, oCommand, oTabIndex, oTabCaption)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub EigenschaftenDateiToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EigenschaftenDateiToolStripMenuItem.Click
|
||||
Show_File_Properties()
|
||||
@@ -568,99 +859,126 @@ Public Class frmValidatorSearch
|
||||
Next
|
||||
End Sub
|
||||
Sub Refresh_DocID(myGrid As GridView)
|
||||
Try
|
||||
If myGrid Is Nothing Then
|
||||
LOGGER.Warn("⚠️ Refresh_DocID: myGrid is Nothing - Exit Sub")
|
||||
Return
|
||||
End If
|
||||
|
||||
Try
|
||||
myGrid.ShowLoadingPanel()
|
||||
clsWMDocGrid.ActiveDocGrid = myGrid
|
||||
clsWMDocGrid.ActiveDocGrid.EndSelection()
|
||||
clsWMDocGrid.GetDocItems()
|
||||
|
||||
If ToolStripDropDownButtonFile.Visible = False Then
|
||||
ToolStripDropDownButtonFile.Visible = True
|
||||
End If
|
||||
If clsWMDocGrid.SELECTED_DOC_ID <> 0 Then
|
||||
If LastDocID = clsWMDocGrid.SELECTED_DOC_ID Then
|
||||
myGrid.HideLoadingPanel()
|
||||
Exit Sub
|
||||
End If
|
||||
Dim msg = "DocID: " & clsWMDocGrid.SELECTED_DOC_ID.ToString
|
||||
tslblDocID.Text = msg
|
||||
ToolStripDropDownButtonFile.Enabled = True
|
||||
Dim oDocument As DocumentResultList.Document = Nothing
|
||||
' Load DocumentInfo
|
||||
oDocument = Documentloader.Load(clsWMDocGrid.SELECTED_DOC_ID, clsWMDocGrid.SELECTED_DOC_PATH)
|
||||
|
||||
If Not IsNothing(DocumentViewer1) Then
|
||||
Dim oFileName = $"{clsWMDocGrid.SELECTED_DOC_ID}.{oDocument.Extension}"
|
||||
If Not IsNothing(DocumentViewer1) AndAlso Not IsNothing(oDocument.Contents) Then
|
||||
' Optionen konfigurieren
|
||||
Dim options As New ClassDocumentPathHandler.DocumentPathOptions With {
|
||||
.EnableMapping = False,
|
||||
.CopyToTemp = COPY_WMFILE_2TEMP,
|
||||
.TempFolder = TEMP_DOCUMENT_FOLDER,
|
||||
.UnmapAfterCopy = False
|
||||
}
|
||||
|
||||
' Verarbeiten
|
||||
Dim result = _documentPathHandler.ProcessDocumentPath(clsWMDocGrid.SELECTED_DOC_PATH, options)
|
||||
|
||||
If result.Success Then
|
||||
DocumentViewer1.LoadFile_FromPath(result.FinalPath)
|
||||
LastDocID = clsWMDocGrid.SELECTED_DOC_ID
|
||||
DocumentViewer1.RightViewOnly(USER_RIGHT_VIEW_ONLY)
|
||||
LOGGER.Info($"✓ [ValidatorSearch] Dokument geladen: [{Path.GetFileName(result.FinalPath)}]")
|
||||
Else
|
||||
LOGGER.Error($"❌ [ValidatorSearch] {result.ErrorMessage}")
|
||||
statlbl.Text = $"Fehler: {result.ErrorMessage}"
|
||||
End If
|
||||
Else
|
||||
statlbl.Text = "odocument.content is nothing, Check Your log"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
If clsWMDocGrid.SELECTED_DOC_ID = 0 Then
|
||||
tslblDocID.Text = "DocRow not selected"
|
||||
ToolStripDropDownButtonFile.Enabled = False
|
||||
Return
|
||||
End If
|
||||
|
||||
If LastDocID = clsWMDocGrid.SELECTED_DOC_ID Then
|
||||
Return
|
||||
End If
|
||||
|
||||
tslblDocID.Text = "DocID: " & clsWMDocGrid.SELECTED_DOC_ID.ToString
|
||||
ToolStripDropDownButtonFile.Enabled = True
|
||||
LOGGER.Debug($"✓ DocID aktualisiert: {clsWMDocGrid.SELECTED_DOC_ID}")
|
||||
If IsNothing(Documentloader) Then
|
||||
If OperationMode = Nothing Then
|
||||
OperationMode = GetOperationMode()
|
||||
End If
|
||||
Documentloader = New Loader(LOGCONFIG, OperationMode, Environment.Service.Client, Environment.User)
|
||||
End If
|
||||
|
||||
If _documentPathHandler Is Nothing Then
|
||||
_documentPathHandler = New DocumentPathHandler(LOGCONFIG)
|
||||
End If
|
||||
|
||||
Dim oDocument As DocumentResultList.Document = Documentloader.Load(clsWMDocGrid.SELECTED_DOC_ID, clsWMDocGrid.SELECTED_DOC_PATH)
|
||||
|
||||
If IsNothing(oDocument) Then
|
||||
LOGGER.Warn($"⚠️ Refresh_DocID: Documentloader.Load lieferte Nothing (DocID={clsWMDocGrid.SELECTED_DOC_ID})")
|
||||
statlbl.Text = "Dokument konnte nicht geladen werden."
|
||||
Return
|
||||
Else
|
||||
LOGGER.Debug($"✓ Documentloader.Load erfolgreich für DocID={clsWMDocGrid.SELECTED_DOC_ID}, Pfad: {clsWMDocGrid.SELECTED_DOC_PATH}")
|
||||
End If
|
||||
|
||||
If Not IsNothing(DocumentViewer1) AndAlso Not IsNothing(oDocument.Contents) Then
|
||||
Dim options As New DocumentPathHandler.DocumentPathOptions With {
|
||||
.EnableMapping = COPY_WMFILE_2TEMP AndAlso Not String.IsNullOrWhiteSpace(WMSUFFIX),
|
||||
.WMSuffix = WMSUFFIX,
|
||||
.SpecificDrive = If(Len(MAP_SHARE_DRIVE) = 1, MAP_SHARE_DRIVE, ""),
|
||||
.DriveBlacklist = MAP_BLACKLIST,
|
||||
.CopyToTemp = COPY_WMFILE_2TEMP,
|
||||
.TempFolder = TEMP_DOCUMENT_FOLDER,
|
||||
.UnmapAfterCopy = True
|
||||
}
|
||||
|
||||
Dim result = _documentPathHandler.ProcessDocumentPath(clsWMDocGrid.SELECTED_DOC_PATH, options)
|
||||
|
||||
If result.Success Then
|
||||
DocumentViewer1.LoadFile_FromPath(result.FinalPath)
|
||||
LastDocID = clsWMDocGrid.SELECTED_DOC_ID
|
||||
DocumentViewer1.RightViewOnly(USER_RIGHT_VIEW_ONLY)
|
||||
LOGGER.Debug($"✓ [ValidatorSearch] Dokument geladen: [{Path.GetFileName(result.FinalPath)}]")
|
||||
Else
|
||||
LOGGER.Error($"❌ [ValidatorSearch] {result.ErrorMessage}")
|
||||
statlbl.Text = $"Fehler: {result.ErrorMessage}"
|
||||
End If
|
||||
Else
|
||||
statlbl.Text = "Dokumentinhalt ist leer."
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Finally
|
||||
Try
|
||||
myGrid.HideLoadingPanel()
|
||||
Catch
|
||||
End Try
|
||||
End Try
|
||||
myGrid.HideLoadingPanel()
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch1_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewDocSearch1.FocusedRowChanged
|
||||
Refresh_DocID(GridViewDocSearch1)
|
||||
Private Sub GridViewDocSearch_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridViewDocSearch1.FocusedRowChanged,
|
||||
GridViewDocSearch2.FocusedRowChanged,
|
||||
GridViewDocSearch3.FocusedRowChanged,
|
||||
GridViewDocSearch4.FocusedRowChanged,
|
||||
GridViewDocSearch5.FocusedRowChanged
|
||||
|
||||
If Not Me.Visible Then
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim activeGrid As GridView = TryCast(sender, GridView)
|
||||
If activeGrid Is Nothing Then
|
||||
Return
|
||||
End If
|
||||
|
||||
LOGGER.Debug($"FocusedRowChanged ausgelöst: [{activeGrid.Name}]")
|
||||
Refresh_DocID(activeGrid)
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewDocSearch2_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridViewDocSearch2.FocusedRowChanged
|
||||
Refresh_DocID(GridViewDocSearch2)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch3_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridViewDocSearch3.FocusedRowChanged
|
||||
Refresh_DocID(GridViewDocSearch3)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch4_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridViewDocSearch4.FocusedRowChanged
|
||||
Refresh_DocID(GridViewDocSearch4)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch5_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridViewDocSearch5.FocusedRowChanged
|
||||
Refresh_DocID(GridViewDocSearch5)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDocSearch1.FocusedColumnChanged,
|
||||
GridViewDocSearch2.FocusedColumnChanged,
|
||||
GridViewDocSearch3.FocusedColumnChanged,
|
||||
GridViewDocSearch4.FocusedColumnChanged,
|
||||
GridViewDocSearch5.FocusedColumnChanged
|
||||
|
||||
Private Sub GridViewDocSearch1_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDocSearch1.FocusedColumnChanged
|
||||
Refresh_DocID(GridViewDocSearch1)
|
||||
End Sub
|
||||
If Not Me.Visible Then
|
||||
Return
|
||||
End If
|
||||
|
||||
Private Sub GridViewDocSearch2_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDocSearch2.FocusedColumnChanged
|
||||
Refresh_DocID(GridViewDocSearch2)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch3_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDocSearch3.FocusedColumnChanged
|
||||
Refresh_DocID(GridViewDocSearch3)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch4_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDocSearch4.FocusedColumnChanged
|
||||
Refresh_DocID(GridViewDocSearch4)
|
||||
End Sub
|
||||
Private Sub GridViewDocSearch5_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDocSearch5.FocusedColumnChanged
|
||||
Refresh_DocID(GridViewDocSearch5)
|
||||
Dim activeGrid As GridView = TryCast(sender, GridView)
|
||||
If activeGrid Is Nothing Then
|
||||
Return
|
||||
End If
|
||||
|
||||
LOGGER.Debug($"FocusedColumnChanged ausgelöst: [{activeGrid.Name}]")
|
||||
Refresh_DocID(activeGrid)
|
||||
End Sub
|
||||
|
||||
Private Sub DateiÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
|
||||
@@ -756,14 +1074,16 @@ Public Class frmValidatorSearch
|
||||
|
||||
End Sub
|
||||
Private Sub ToolStripButtonRefreshSearches_Click(sender As Object, e As EventArgs) Handles ToolStripButtonRefreshSearches.Click
|
||||
If BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows.Count > 0 Then
|
||||
LOGGER.Debug($"There are [{BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows.Count}] SQLSearches configured!")
|
||||
_DTSQLSearches = BASEDATA_DT_PROFILE_SEARCHES_SQL
|
||||
Dim oConID = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("CONN_ID")
|
||||
Dim oCommand = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("SQL_COMMAND")
|
||||
If DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0 Then
|
||||
LOGGER.Debug($"There are [{DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count}] DATASearches configured!")
|
||||
_DTDATASearches = DT_FILTERED_PROFILE_SEARCHES_DATA
|
||||
Dim oConID = DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(0).Item("CONN_ID")
|
||||
Dim oCommand = DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(0).Item("SQL_COMMAND")
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
XtraTabControlSQL.SelectedTabPageIndex = 0
|
||||
Refresh_Load_GridSQL(oConID, oCommand, 0, BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(0).Item("TAB_TITLE"))
|
||||
Refresh_Load_GridSQL(oConID, oCommand, 0, DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(0).Item("TAB_TITLE"))
|
||||
Else
|
||||
LOGGER.Debug("No DATASearches configured for this profile!")
|
||||
End If
|
||||
If DT_FILTERED_PROFILE_SEARCHES_DOC.Rows.Count > 0 Then
|
||||
LOGGER.Debug($"There are [{DT_FILTERED_PROFILE_SEARCHES_DOC.Rows.Count}] DocSearches configured!")
|
||||
@@ -773,6 +1093,8 @@ Public Class frmValidatorSearch
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
XtraTabControlDocs.SelectedTabPageIndex = 0
|
||||
RefreshTabDoc(oConID, oCommand, 0, DT_FILTERED_PROFILE_SEARCHES_DOC.Rows(0).Item("TAB_TITLE"))
|
||||
Else
|
||||
LOGGER.Debug("No DocSearches configured for this profile!")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -817,48 +1139,57 @@ Public Class frmValidatorSearch
|
||||
End Sub
|
||||
Sub ReLoad_Active_SQLTab()
|
||||
Dim oTabIndex = XtraTabControlSQL.SelectedTabPageIndex
|
||||
Dim oConID = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(oTabIndex).Item("CONN_ID")
|
||||
Dim oCommand = BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(oTabIndex).Item("SQL_COMMAND")
|
||||
Dim oConID = DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(oTabIndex).Item("CONN_ID")
|
||||
Dim oCommand = DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(oTabIndex).Item("SQL_COMMAND")
|
||||
oCommand = clsPatterns.ReplaceAllValues(oCommand, _frmValidator.PanelValidatorControl, True)
|
||||
RefreshTabSQL(oConID, oCommand, oTabIndex, BASEDATA_DT_PROFILE_SEARCHES_SQL.Rows(oTabIndex).Item("TAB_TITLE"))
|
||||
RefreshTabSQL(oConID, oCommand, oTabIndex, DT_FILTERED_PROFILE_SEARCHES_DATA.Rows(oTabIndex).Item("TAB_TITLE"))
|
||||
End Sub
|
||||
|
||||
Private Sub GridControlDocSearch1_DoubleClick(sender As Object, e As EventArgs) Handles GridControlDocSearch1.DoubleClick
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch1)
|
||||
FileShow()
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch2_DoubleClick(sender As Object, e As EventArgs) Handles GridControlDocSearch2.DoubleClick
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch2)
|
||||
FileShow()
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch3_DoubleClick(sender As Object, e As EventArgs) Handles GridControlDocSearch3.DoubleClick
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch3)
|
||||
FileShow()
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch4_DoubleClick(sender As Object, e As EventArgs) Handles GridControlDocSearch4.DoubleClick
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch4)
|
||||
FileShow()
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch5_DoubleClick(sender As Object, e As EventArgs) Handles GridControlDocSearch5.DoubleClick
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch5)
|
||||
FileShow()
|
||||
End Sub
|
||||
|
||||
Private Sub GridControlDocSearch1_Click(sender As Object, e As EventArgs) Handles GridControlDocSearch1.Click
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch1)
|
||||
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch2_Click(sender As Object, e As EventArgs) Handles GridControlDocSearch2.Click
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch2)
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch3_Click(sender As Object, e As EventArgs) Handles GridControlDocSearch3.Click
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch3)
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch4_Click(sender As Object, e As EventArgs) Handles GridControlDocSearch4.Click
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch4)
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch5_Click(sender As Object, e As EventArgs) Handles GridControlDocSearch5.Click
|
||||
|
||||
If Not Me.Visible Then Return
|
||||
Refresh_DocID(GridViewDocSearch5)
|
||||
End Sub
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -151,9 +151,9 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraVerticalGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Controls.DocumentViewer, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="DigitalData.Controls.DocumentViewer, Version=2.6.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\2_DLL Projekte\Controls.DocumentViewer\obj\Debug\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||
<HintPath>..\..\..\..\2_DLL Projekte\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Controls.LookupGrid">
|
||||
<HintPath>..\..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll</HintPath>
|
||||
@@ -462,7 +462,6 @@
|
||||
<Compile Include="ClassConfig.vb" />
|
||||
<Compile Include="ClassConstants.vb" />
|
||||
<Compile Include="ClassControlCreator.vb" />
|
||||
<Compile Include="ClassDocumentPathHandler.vb" />
|
||||
<Compile Include="ClassDragDrop.vb" />
|
||||
<Compile Include="ClassFinalIndex.vb" />
|
||||
<Compile Include="ClassFinalizeDoc.vb" />
|
||||
@@ -1258,7 +1257,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="logtaskflow.txt" />
|
||||
<Content Include="taskFLOW-TEST-Debug.txt" />
|
||||
<None Include="Changelog.md" />
|
||||
<Content Include="DataColumnExpression.txt" />
|
||||
<Content Include="DD_Icons_ICO_PMANAGER_48px.ico" />
|
||||
|
||||
Reference in New Issue
Block a user