Compare commits
2 Commits
83ad9db4b2
...
10e90507e1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10e90507e1 | ||
|
|
a143aaf09e |
@@ -111,11 +111,11 @@ Public Class Winline
|
|||||||
|
|
||||||
For Each oRow As DataRow In oDatatable.Rows
|
For Each oRow As DataRow In oDatatable.Rows
|
||||||
Dim oVersion As New ProductVersion() With {
|
Dim oVersion As New ProductVersion() With {
|
||||||
.Guid = oRow.Item("GUID"),
|
.Guid = NotNull(oRow.Item("GUID"), 0),
|
||||||
.VersionId = oRow.Item("VERSION"),
|
.VersionId = NotNull(oRow.Item("VERSION"), 0),
|
||||||
.GroupId = oRow.Item("GROUP_ID"),
|
.GroupId = NotNull(oRow.Item("GROUP_ID"), 0),
|
||||||
.Name = oRow.Item("NAME"),
|
.Name = NotNull(oRow.Item("NAME"), "(Kein Name)"),
|
||||||
.Code = oRow.Item("CODE")
|
.Code = NotNull(oRow.Item("CODE"), "(Kein Code)")
|
||||||
}
|
}
|
||||||
|
|
||||||
oVersions.Add(oVersion)
|
oVersions.Add(oVersion)
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
Private ReadOnly Config As Config = My.Application.ConfigManager.Config
|
Private ReadOnly Config As Config = My.Application.ConfigManager.Config
|
||||||
Private ReadOnly Logger As Logger = My.Application.LogConfig.GetLogger
|
Private ReadOnly Logger As Logger = My.Application.LogConfig.GetLogger
|
||||||
|
|
||||||
|
Private Const TEMPLATE_NUMBER_NORMAL_ARTICLE = 45
|
||||||
|
Private Const TEMPLATE_NUMBER_SERIAL_ARTICLE = 46
|
||||||
|
Private Const CUSTOM_WINDOW_ID = 529
|
||||||
|
|
||||||
Private Sub frmCreateArticle_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmCreateArticle_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
txtRunningNumber.Text = RunningNumber
|
txtRunningNumber.Text = RunningNumber
|
||||||
txtArticleNumber.Text = ArticleNumber
|
txtArticleNumber.Text = ArticleNumber
|
||||||
@@ -33,6 +37,8 @@
|
|||||||
Dim oPriceResult = My.Application.Winline.CreatePriceInfo(ArticleNumber, RunningNumber, Vendor.WinlineNumber)
|
Dim oPriceResult = My.Application.Winline.CreatePriceInfo(ArticleNumber, RunningNumber, Vendor.WinlineNumber)
|
||||||
|
|
||||||
If oArticleResult And oPriceResult Then
|
If oArticleResult And oPriceResult Then
|
||||||
|
MsgBox("Artikel erfolgreich angelegt!", MsgBoxStyle.Information, Text)
|
||||||
|
|
||||||
txtFinalArticleNumber.Text = $"{ArticleNumber}{RunningNumber}"
|
txtFinalArticleNumber.Text = $"{ArticleNumber}{RunningNumber}"
|
||||||
|
|
||||||
Return $"{ArticleNumber}{RunningNumber}"
|
Return $"{ArticleNumber}{RunningNumber}"
|
||||||
@@ -52,29 +58,19 @@
|
|||||||
MsgBoxStyle.Question Or vbYesNo, Text)
|
MsgBoxStyle.Question Or vbYesNo, Text)
|
||||||
|
|
||||||
If oResult = MsgBoxResult.Yes Then
|
If oResult = MsgBoxResult.Yes Then
|
||||||
Dim oArticleNumber = StartArticleCreation(True)
|
Dim oArticle = StartArticleCreation(True)
|
||||||
HandleArticleCreation(oArticleNumber)
|
If oArticle IsNot Nothing Then
|
||||||
|
My.Computer.Clipboard.SetText(oArticle)
|
||||||
|
My.Application.Winline.RunWinlineMacro(My.Application.ConfigManager.Config.CompletionMacro, oArticle, CUSTOM_WINDOW_ID, TEMPLATE_NUMBER_SERIAL_ARTICLE)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||||
Dim oArticleNumber = StartArticleCreation(False)
|
Dim oArticle = StartArticleCreation(False)
|
||||||
HandleArticleCreation(oArticleNumber)
|
If oArticle IsNot Nothing Then
|
||||||
End Sub
|
My.Computer.Clipboard.SetText(oArticle)
|
||||||
|
My.Application.Winline.RunWinlineMacro(My.Application.ConfigManager.Config.CompletionMacro, oArticle, CUSTOM_WINDOW_ID, TEMPLATE_NUMBER_NORMAL_ARTICLE)
|
||||||
Private Sub HandleArticleCreation(ArticleNumber As String)
|
|
||||||
If ArticleNumber IsNot Nothing Then
|
|
||||||
If My.Application.Winline.TestArticleExists(ArticleNumber) Then
|
|
||||||
My.Computer.Clipboard.SetText(ArticleNumber)
|
|
||||||
If My.Application.Winline.RunWinlineMacro(My.Application.ConfigManager.Config.CompletionMacro, ArticleNumber) = False Then
|
|
||||||
MsgBox($"Der Artikelstamm konnte nicht geöffnet werden. Die Artikelnummer {ArticleNumber} wurde in die Zwischenablage kopiert.", MsgBoxStyle.Information, Text)
|
|
||||||
End If
|
|
||||||
Application.Exit()
|
|
||||||
|
|
||||||
Else
|
|
||||||
MsgBox($"Der Artikel '{ArticleNumber}' wurde nicht angelegt!", MsgBoxStyle.Critical, Text)
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user