Export report to Directory
This commit is contained in:
@@ -22,7 +22,7 @@ Namespace Winline
|
||||
Public Years As List(Of Integer)
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pConfig As GeneralConfig, pMappingConfig As MappingConfig, pMandatorConfig As MandatorConfig)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
MyBase.New(pLogConfig)
|
||||
Database = pDatabase
|
||||
Config = pConfig
|
||||
MandatorConfig = pMandatorConfig
|
||||
@@ -419,14 +419,15 @@ Namespace Winline
|
||||
Dim oArticleNumber As String = ItemEx(oRow, V21_MAINARTICLENUMBER, String.Empty)
|
||||
|
||||
' EAN was found, now we need to check it against the Regex of the current Mandantor, if one exists
|
||||
Dim oMappingConfigItem = MappingConfig.Items.
|
||||
Dim oMappingConfigItems = MappingConfig.Items.
|
||||
Where(Function(item) item.DestinationName = "MANDATOR" And item.DestinationValue = oMandator.Id And item.SourceName = "ARTICLE").
|
||||
SingleOrDefault()
|
||||
|
||||
If oMappingConfigItem IsNot Nothing Then
|
||||
ToList()
|
||||
|
||||
' If not match was found, continune to next mandator.
|
||||
' For a catch all mandator, a regex like ".+" is needed.
|
||||
For Each oItem In oMappingConfigItems
|
||||
Try
|
||||
Dim oRegex As New Regex(oMappingConfigItem.SourceRegex)
|
||||
Dim oRegex As New Regex(oItem.SourceRegex)
|
||||
Dim oMatch = oRegex.Match(oArticleNumber)
|
||||
|
||||
' If ArticleNumber matches the regex, we assign it and exit
|
||||
@@ -439,13 +440,9 @@ Namespace Winline
|
||||
Logger.Error(ex)
|
||||
Logger.Warn("Regex [{0}] could not be parsed. Skipping.", oMandator.Regex)
|
||||
End Try
|
||||
|
||||
Else
|
||||
Continue For
|
||||
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Next ' CONFIG ITEM
|
||||
Next ' MANDATOR
|
||||
Next ' EAN
|
||||
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user