Projektdateien hinzufügen.
This commit is contained in:
60
WinLineArtikelnummerGenerator/frmMain.vb
Normal file
60
WinLineArtikelnummerGenerator/frmMain.vb
Normal file
@@ -0,0 +1,60 @@
|
||||
Public Class frmMain
|
||||
Private _Logger As Logger
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Config As ConfigManager(Of Config)
|
||||
Private _Database As Database
|
||||
|
||||
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
_LogConfig = New LogConfig(LogPath:=LogConfig.PathType.AppData, CompanyName:="Digital Data", ProductName:="WinLineProductNumberGenerator")
|
||||
_Logger = _LogConfig.GetLogger()
|
||||
_Config = New ConfigManager(Of Config)(_LogConfig, Application.UserAppDataPath)
|
||||
_Database = New Database(_LogConfig, _Config)
|
||||
|
||||
listboxVendors.DataSource = Nothing
|
||||
|
||||
Dim oVendorDT = _Database.LoadVendors()
|
||||
Dim oVendors = New List(Of Vendor)
|
||||
|
||||
listboxVendors.DataSource = oVendorDT
|
||||
listboxVendors.DisplayMember = "c003"
|
||||
listboxVendors.ValueMember = "c229"
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
|
||||
_Config.Save()
|
||||
End Sub
|
||||
|
||||
Private Sub listboxVendors_SelectedIndexChanged(sender As Object, e As EventArgs) Handles listboxVendors.SelectedIndexChanged
|
||||
If listboxVendors.SelectedIndex >= 0 Then
|
||||
Dim oVendor As DataRowView = listboxVendors.SelectedItem()
|
||||
Dim oVendorCode = oVendor.Item("C229")
|
||||
Dim oVendorId = _Database.LoadVendorIdByCode(oVendorCode)
|
||||
|
||||
listboxProductGroups.DataSource = Nothing
|
||||
|
||||
If oVendorId Is Nothing Then
|
||||
_Logger.Warn("VendorId does not match any 'Artikeluntergruppen'.")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oGroups = _Database.LoadGroupsByVendor(oVendorId)
|
||||
|
||||
listboxProductGroups.DataSource = oGroups
|
||||
listboxProductGroups.DisplayMember = "C001"
|
||||
listboxProductGroups.ValueMember = "C999"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub listboxProductGroups_SelectedIndexChanged(sender As Object, e As EventArgs) Handles listboxProductGroups.SelectedIndexChanged
|
||||
If listboxProductGroups.SelectedIndex >= 0 Then
|
||||
Dim oVendor As DataRowView = listboxVendors.SelectedItem()
|
||||
Dim oGroup As DataRowView = listboxProductGroups.SelectedItem()
|
||||
|
||||
Dim oVendorCode = oVendor.Item("C229")
|
||||
Dim oVendorId = _Database.LoadVendorIdByCode(oVendorCode)
|
||||
Dim oGroupId = oGroup.Item("C999")
|
||||
|
||||
Dim Versions = _Database.LoadVersionsByVendorAndGroup(oVendorId, oGroupId)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user