add logging

This commit is contained in:
Jonathan Jenne 2020-09-24 15:48:11 +02:00
parent 2d214f9e4f
commit f4ea9c8993
3 changed files with 19 additions and 1 deletions

View File

@ -174,11 +174,13 @@ Public Class Winline
Dim oSuccess As XmlNode = oDocument.DocumentElement.SelectSingleNode("OverallSuccess")
If oSuccess.InnerText.ToUpper = "TRUE" Then
_Logger.Info("Request was SUCCESSFUL!")
Return True
Else
_Logger.Info("Request FAILED!")
Return False
End If
Catch ex As Exception
_Logger.Error(ex)
Return False

View File

@ -6,6 +6,7 @@
Public Property RunningNumber As String
Private ReadOnly Config As Config = My.Application.ConfigManager.Config
Private ReadOnly Logger As Logger = My.Application.LogConfig.GetLogger
Private Sub frmCreateArticle_Load(sender As Object, e As EventArgs) Handles MyBase.Load
txtRunningNumber.Text = RunningNumber
@ -23,7 +24,12 @@
txtFinalArticleNumber.Text = String.Empty
Logger.Info("Creating Article..")
Dim oArticleResult = My.Application.Winline.CreateArticle(ArticleNumber, RunningNumber, txtArticleDescription.Text, Vendor, IsSerialNumberArticle)
Logger.Info("Creating Price Info..")
Dim oPriceResult = My.Application.Winline.CreatePriceInfo(ArticleNumber, RunningNumber, Vendor.WinlineNumber)
If oArticleResult And oPriceResult Then

View File

@ -107,9 +107,15 @@
Dim oArticleNumber = $"{oVendor.Code}{oGroup.GroupString}{oVersion.VersionString}"
Dim oRunningNumber As String
_Logger.Info("Vendor Code: [{0}]", oVendor.Code)
_Logger.Info("Group String: [{0}]", oGroup.GroupString)
_Logger.Info("Version: [{0}]", oVersion.VersionString)
Try
oRunningNumber = My.Application.Winline.GetNextRunningNumber(oVendor.Code, oGroup.GroupId, oVersion.VersionId)
_Logger.Info("New Running Number: [{0}]", oRunningNumber)
If My.Application.Winline.TestArticleExists($"{oArticleNumber}{oRunningNumber}") Then
Throw New ApplicationException(My.Application.Winline.ARTICLE_ALREADY_EXISTS)
End If
@ -122,8 +128,12 @@
.Group = oGroup
}
_Logger.Info("Opening Article form..")
oForm.ShowDialog()
Catch ex As Exception
_Logger.Error(ex)
Dim oMessage As String = ""
Select Case ex.Message