Fix Sql Connection missing in Depending Controls, clean up Filesystem module use

This commit is contained in:
Jonathan Jenne
2023-09-11 15:16:10 +02:00
parent f727c0da9f
commit 123eaceb12
12 changed files with 442 additions and 140 deletions

View File

@@ -1,12 +1,19 @@
Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Public Class ClassPostprocessing
Inherits BaseClass
Private Const VBSPLIT = "VBSPLIT"
Private Const VBREPLACE = "VBREPLACE"
Private Const REGEXPRESSION = "REG. EXPRESSION"
Public Const VBSPLIT = "VBSPLIT"
Public Const VBREPLACE = "VBREPLACE"
Public Const REGEXPRESSION = "REG. EXPRESSION"
Public Shared Function Get_Nachbearbeitung_Wert(idxvalue As String, Datatable As DataTable) As String
Public Sub New(pLogConfig As LogConfig)
MyBase.New(pLogConfig)
End Sub
Public Function Get_Nachbearbeitung_Wert(idxvalue As String, Datatable As DataTable) As String
Dim oIndexValues As List(Of String) = idxvalue.Split(ClassConstants.VECTORSEPARATOR).ToList()
Try
@@ -14,9 +21,10 @@ Public Class ClassPostprocessing
Dim oResult As New List(Of String)
Dim oType As String = oDataRow.Item("TYPE").ToString.ToUpper
Logger.Info(" ...Nachbearbeitung mit [{0}]", oType)
Select Case oType
Case VBSPLIT
LOGGER.Info(" ...Nachbearbeitung mit VBSPLIT")
Dim oSeparator As String = oDataRow.Item("TEXT1")
Dim oSplitIndex As Integer = 0
@@ -31,34 +39,31 @@ Public Class ClassPostprocessing
Dim oFindString = oDataRow.Item("TEXT1")
Dim oReplaceString = oDataRow.Item("TEXT2")
LOGGER.Info(" ...Nachbearbeitung mit VBREPLACE")
LOGGER.Info(" ...Ersetze '" & oFindString & "' mit '" & oReplaceString & "'")
Logger.Info(" ...Ersetze '" & oFindString & "' mit '" & oReplaceString & "'")
For Each oIndexValue In oIndexValues
Dim oReplaceResult = oIndexValue.Replace(oFindString, oReplaceString)
oResult.Add(oReplaceResult)
Next
Case REGEXPRESSION
LOGGER.Info(" ...Nachbearbeitung mit RegEx")
Case REGEXPRESSION
Dim oRegexList As New List(Of Regex)
Dim oRegex As New Regex(oDataRow.Item("TEXT1"), RegexOptions.IgnoreCase)
oRegexList.Add(oRegex)
For Each oIndexValue In oIndexValues
Dim oProcessedString = extractFromStringviaRE(oIndexValue, oRegexList)
Dim oProcessedString = ExtractFromStringWithRegex(oIndexValue, oRegexList)
oResult.Add(oProcessedString)
LOGGER.Info(" ...Ergebnis des RegEx: " & oProcessedString)
Logger.Info(" ...Ergebnis des RegEx: " & oProcessedString)
Next
End Select
oIndexValues = oResult
Next
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Get_Nachbearbeitung_Wert:")
LOGGER.Info(" - Unvorhergesehener Unexpected error in Get_Nachbearbeitung_Wert - result: " & idxvalue & " - Fehler: " & vbNewLine & ex.Message)
Logger.Error(ex)
End Try
Return String.Join(ClassConstants.VECTORSEPARATOR, oIndexValues.ToArray)
@@ -71,7 +76,7 @@ Public Class ClassPostprocessing
''' <param name="RegexList">Eine Liste von Regular Expressions</param>
''' <param name="RegexGroup">Die Ergebnisgruppe, die die Adresse enthält</param>
''' <returns>Eine Emailadresse oder Nothing, wenn keine der Regular Expressions ein Ergebnis lieferte.</returns>
Public Shared Function extractFromStringviaRE(SearchString As String, RegexList As List(Of Regex), Optional RegexGroup As Integer = 1)
Private Function ExtractFromStringWithRegex(SearchString As String, RegexList As List(Of Regex), Optional RegexGroup As Integer = 1)
If IsNothing(SearchString) Then
Return Nothing
End If