This commit is contained in:
Jonathan Jenne
2022-05-05 16:35:22 +02:00
parent f540c1dc17
commit 46d3dfbd47
4 changed files with 24 additions and 8 deletions

View File

@@ -515,6 +515,12 @@ Namespace Winline
Public Function TryGetArticleNumber(pEAN As String, pMandator As Mandator) As String
Try
If pEAN = String.Empty Then
Logger.Warn("Could not get ArticleNumber, EAN is empty.")
Return Nothing
End If
Dim oYear As Integer = Config.GetWinLineYear()
Dim oSQL As String = $"
SELECT
@@ -545,6 +551,8 @@ Namespace Winline
Dim oRow As DataRow = oTable.Rows.Item(0)
Dim oArticleNumber As String = ItemEx(oRow, V21_MAINARTICLENUMBER, String.Empty)
Logger.Info("Found ArticleNumber [{0}] in Column [{1}]", oArticleNumber, V21_MAINARTICLENUMBER)
Return oArticleNumber
Catch ex As Exception
@@ -929,7 +937,7 @@ Namespace Winline
Dim oExistingCount = Await Database.GetScalarValueAsync(oSql)
If oExistingCount = 0 Then
Logger.Debug("Running number [{0}] does not exist yet. Returning.")
Logger.Debug("Running number [{0}] does not exist yet. Returning.", pRunningNumber)
Return pRunningNumber
Else
Logger.Debug("Running number [{0}] already exists. Checking again.")