first public version

This commit is contained in:
Jonathan Jenne 2020-09-22 10:50:20 +02:00
parent 82ec7c9ecb
commit 314038d133
24 changed files with 1347 additions and 340 deletions

View File

@ -8,5 +8,8 @@
Partial Friend Class MyApplication Partial Friend Class MyApplication
Public ConfigManager As ConfigManager(Of Config) Public ConfigManager As ConfigManager(Of Config)
Public LogConfig As LogConfig Public LogConfig As LogConfig
Public Winline As Winline
Public EXIMDatabase As Database
Public WinlineDatabase As Database
End Class End Class
End Namespace End Namespace

View File

@ -1,26 +1,28 @@
Imports DigitalData.Modules.Config.ConfigAttributes Public Class Config
Public Property WinlineConnectionString As String = ""
Public Class Config Public Property EXIMConnectionString As String = ""
Public Property ConnectionString As String = "" Public Property CompletionMacro As String = ""
Public Property ImportantNotes As List(Of String) = New List(Of String)
Public Property WinLine_WebService As New WebServiceConfig Public Property WebService As New WebServiceConfig
Public Enum ActionCode
CHECK_ONLY = 0
IMPORT = 1
End Enum
Public Class WebServiceConfig Public Class WebServiceConfig
Public Property Server As String = "" Public Property Server As String = ""
Public Property Username As String = "" Public Property Username As String = ""
Public Property Password As String = "" Public Property Password As String = ""
Public Property Mandator As String = "" Public Property Mandator As String = ""
Public Property ActionCode As ActionCode = ActionCode.IMPORT
Public Property ArticleTemplateName As String = "" Public Property ActionCode As Integer = 1
Public Property ArticleTemplateType As Integer = 30 Public Property TaxCode As Integer = 3
Public Property PriceTemplateName As String = "" Public Property ShapeFrom As String = "A"
Public Property ShapeTo As String = "C"
Public Property ArticleTemplateName As String = "EXIM-Artikelnummergenerator"
Public Property ArticleTemplateType As Integer = 4
Public Property PriceTemplateName As String = "EXIM-Artikelnummergenerator"
Public Property PriceTemplateType As Integer = 5 Public Property PriceTemplateType As Integer = 5
End Class End Class
End Class End Class

View File

@ -5,17 +5,20 @@ Public Class Database
Private _LogConfig As LogConfig Private _LogConfig As LogConfig
Private _Logger As Logger Private _Logger As Logger
Private _ConnectionString As String = ""
Private Const QUERY_TIMEOUT = 120000 Private Const QUERY_TIMEOUT = 120000
Public Sub New(LogConfig As LogConfig, ConfigManager As ConfigManager(Of Config)) Public Sub New(LogConfig As LogConfig, ConfigManager As ConfigManager(Of Config), ConnectionString As String)
_LogConfig = LogConfig _LogConfig = LogConfig
_Logger = LogConfig.GetLogger() _Logger = LogConfig.GetLogger()
_Config = ConfigManager _Config = ConfigManager
_ConnectionString = ConnectionString
End Sub End Sub
#Region "Database-Access" #Region "Database-Access"
Private Function GetSQLConnection() As SqlConnection Private Function GetSQLConnection() As SqlConnection
Return GetSQLConnection(_Config.Config.ConnectionString) Return GetSQLConnection(_ConnectionString)
End Function End Function
Private Function GetSQLConnection(ConnectionString As String) As SqlConnection Private Function GetSQLConnection(ConnectionString As String) As SqlConnection
@ -84,6 +87,25 @@ Public Class Database
Return Nothing Return Nothing
End Try End Try
End Function End Function
Public Function ExecuteNonQuery(SQLCommand As String) As Boolean
Try
_Logger.Debug("ExecuteNonQuery: Running Query [{0}]", SQLCommand)
Using oConnection = GetSQLConnection()
Using oSQLCOmmand = oConnection.CreateCommand()
oSQLCOmmand.CommandText = SQLCommand
oSQLCOmmand.CommandTimeout = QUERY_TIMEOUT
oSQLCOmmand.ExecuteNonQuery()
Return True
End Using
End Using
Catch ex As Exception
_Logger.Warn($"ExecuteNonQuery failed SQLCommand [{SQLCommand}] - ERROR: {ex.Message}")
Return False
End Try
End Function
#End Region #End Region
End Class End Class

View File

@ -0,0 +1,22 @@
Public Class ConfigAttributes
''' <summary>
''' The primary connection string. Will not be saved to userconfig.
''' </summary>
Public Class ConnectionStringAttribute
Inherits Attribute
End Class
''' <summary>
''' The test connection string. Will not be saved to userconfig.
''' </summary>
Public Class ConnectionStringTestAttribute
Inherits Attribute
End Class
''' <summary>
''' Global setting. Will not be saved to userconfig.
''' </summary>
Public Class GlobalSettingAttribute
Inherits Attribute
End Class
End Class

View File

@ -1,8 +1,7 @@
Imports System.IO Imports System.IO
Imports System.Reflection Imports System.Reflection
Imports System.Xml.Serialization Imports System.Xml.Serialization
Imports DigitalData.Modules.Logging Imports WinLineArtikelnummerGenerator.ConfigAttributes
Imports DigitalData.Modules.Config.ConfigAttributes
Public Class ConfigManager(Of T) Public Class ConfigManager(Of T)
Private Const USER_CONFIG_NAME As String = "UserConfig.xml" Private Const USER_CONFIG_NAME As String = "UserConfig.xml"

View File

@ -32,7 +32,7 @@ Namespace My
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm() Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.WinLineArtikelnummerGenerator.Form1 Me.MainForm = Global.WinLineArtikelnummerGenerator.frmMain
End Sub End Sub
End Class End Class
End Namespace End Namespace

View File

@ -52,31 +52,6 @@
<ApplicationManifest>My Project\app.manifest</ApplicationManifest> <ApplicationManifest>My Project\app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Data.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Sparkline.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Utils.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraBars.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraPrinting.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DigitalData.Modules.Config">
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Database">
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Filesystem">
<HintPath>..\..\DDMonorepo\Modules.Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Language">
<HintPath>..\..\DDMonorepo\Modules.Language\bin\Debug\DigitalData.Modules.Language.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging">
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -128,12 +103,25 @@
<Compile Include="frmCreateArticle.vb"> <Compile Include="frmCreateArticle.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmWinlineConfig.Designer.vb"> <Compile Include="frmNewGroup.Designer.vb">
<DependentUpon>frmWinlineConfig.vb</DependentUpon> <DependentUpon>frmNewGroup.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="frmWinlineConfig.vb"> <Compile Include="frmNewGroup.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmNewProduct.Designer.vb">
<DependentUpon>frmNewProduct.vb</DependentUpon>
</Compile>
<Compile Include="frmNewProduct.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmNewVendor.Designer.vb">
<DependentUpon>frmNewVendor.vb</DependentUpon>
</Compile>
<Compile Include="frmNewVendor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Modules\ConfigAttributes.vb" />
<Compile Include="Modules\ConfigManager.vb" /> <Compile Include="Modules\ConfigManager.vb" />
<Compile Include="CWLDATEN_MEDSDataSet.Designer.vb"> <Compile Include="CWLDATEN_MEDSDataSet.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@ -168,7 +156,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<Compile Include="Models\Vendor.vb" /> <Compile Include="Models\Vendor.vb" />
<Compile Include="Database.vb" /> <Compile Include="Models\Database.vb" />
<Compile Include="Winline.vb" /> <Compile Include="Winline.vb" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -178,8 +166,14 @@
<EmbeddedResource Include="frmMain.resx"> <EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.vb</DependentUpon> <DependentUpon>frmMain.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmWinlineConfig.resx"> <EmbeddedResource Include="frmNewGroup.resx">
<DependentUpon>frmWinlineConfig.vb</DependentUpon> <DependentUpon>frmNewGroup.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmNewProduct.resx">
<DependentUpon>frmNewProduct.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmNewVendor.resx">
<DependentUpon>frmNewVendor.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" /> <EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx"> <EmbeddedResource Include="My Project\Resources.resx">

View File

@ -1,20 +1,54 @@
Imports System.Net Imports System.IO
Imports System.Net
Imports System.Xml
Public Class Winline Public Class Winline
Private _Logger As Logger Private _Logger As Logger
Private _Db As Database Private _EXIM As Database
Private _Winline As Database
Private _Config As Config
Public ReadOnly Property NO_RUNNING_NUMBER_FOUND = "NO_RUNNING_NUMBER_FOUND" Public ReadOnly Property NO_RUNNING_NUMBER_FOUND = "NO_RUNNING_NUMBER_FOUND"
Public ReadOnly Property ARTICLE_ALREADY_EXISTS = "ARTICLE_ALREADY_EXISTS"
Public ReadOnly Property UNKNOWN_ERROR = "UNKNOWN_ERROR" Public ReadOnly Property UNKNOWN_ERROR = "UNKNOWN_ERROR"
Public Sub New(LogConfig As LogConfig, Database As Database) Public Sub New(LogConfig As LogConfig, EximDatabase As Database, WinlineDatabase As Database, Config As Config)
_Logger = LogConfig.GetLogger() _Logger = LogConfig.GetLogger()
_Db = Database _EXIM = EximDatabase
_Winline = WinlineDatabase
_Config = Config
End Sub End Sub
Public Function GetVendorsFromWinLine() As List(Of Vendor)
Try
Dim CurrentYear = (Now.Year - 1900) * 12
Dim CurrentMandator = _Config.WebService.Mandator
Dim oDatatable As DataTable = _Winline.GetDatatable(
$"SELECT * FROM V005 WHERE C004 = 3 AND c002 IS NOT NULL AND c003 IS NOT NULL AND " &
$"mesoyear = {CurrentYear} And mesocomp = '{CurrentMandator}'" &
"ORDER BY c003"
)
Dim oVendors As New List(Of Vendor)
For Each oRow As DataRow In oDatatable.Rows
Dim oVendor As New Vendor() With {
.WinlineName = oRow.Item("c003"),
.WinlineNumber = oRow.Item("c002")
}
oVendors.Add(oVendor)
Next
Return oVendors
Catch ex As Exception
_Logger.Error(ex)
Return Nothing
End Try
End Function
Public Function GetVendors() As List(Of Vendor) Public Function GetVendors() As List(Of Vendor)
Try Try
Dim oDatatable As DataTable = _Db.GetDatatable("SELECT * FROM TBDD_ARTICLE_GENERATOR_VENDORS ORDER BY CODE") Dim oDatatable As DataTable = _EXIM.GetDatatable("SELECT * FROM TBDD_ARTICLE_GENERATOR_VENDORS ORDER BY CODE")
Dim oVendors As New List(Of Vendor) Dim oVendors As New List(Of Vendor)
For Each oRow As DataRow In oDatatable.Rows For Each oRow As DataRow In oDatatable.Rows
@ -38,7 +72,7 @@ Public Class Winline
Public Function GetGroupsByVendor(VendorCode As String) As List(Of ProductGroup) Public Function GetGroupsByVendor(VendorCode As String) As List(Of ProductGroup)
Try Try
Dim oDatatable = _Db.GetDatatable($"SELECT * FROM TBDD_ARTICLE_GENERATOR_GROUPS WHERE CODE = '{VendorCode}'") Dim oDatatable = _EXIM.GetDatatable($"SELECT * FROM TBDD_ARTICLE_GENERATOR_GROUPS WHERE CODE = '{VendorCode}'")
Dim oGroups As New List(Of ProductGroup) Dim oGroups As New List(Of ProductGroup)
For Each oRow As DataRow In oDatatable.Rows For Each oRow As DataRow In oDatatable.Rows
@ -61,14 +95,14 @@ Public Class Winline
Public Function GetVersionsByVendorAndGroup(VendorCode As String, GroupId As String) As List(Of ProductVersion) Public Function GetVersionsByVendorAndGroup(VendorCode As String, GroupId As String) As List(Of ProductVersion)
Try Try
Dim oDatatable = _Db.GetDatatable($"SELECT * FROM TBDD_ARTICLE_GENERATOR_PRODUCTS WHERE CODE = '{VendorCode}' AND [GROUP] = {GroupId}") Dim oDatatable = _EXIM.GetDatatable($"SELECT * FROM TBDD_ARTICLE_GENERATOR_PRODUCTS WHERE CODE = '{VendorCode}' AND GROUP_ID = {GroupId}")
Dim oVersions As New List(Of ProductVersion) Dim oVersions As New List(Of ProductVersion)
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 = oRow.Item("GUID"),
.VersionId = oRow.Item("VERSION"), .VersionId = oRow.Item("VERSION"),
.GroupId = oRow.Item("GROUP"), .GroupId = oRow.Item("GROUP_ID"),
.Name = oRow.Item("NAME"), .Name = oRow.Item("NAME"),
.Code = oRow.Item("CODE") .Code = oRow.Item("CODE")
} }
@ -87,7 +121,7 @@ Public Class Winline
Try Try
Dim oGroupCode As String = GroupId.ToString.PadLeft(2, "0") Dim oGroupCode As String = GroupId.ToString.PadLeft(2, "0")
Dim oVersionCode As String = VersionId.ToString.PadLeft(2, "0") Dim oVersionCode As String = VersionId.ToString.PadLeft(2, "0")
Dim oDbResult = _Db.GetScalarValue($"SELECT MAX(C223) FROM v021 WHERE c010 LIKE '{VendorCode}{oGroupCode}{oVersionCode}___'") Dim oDbResult = _Winline.GetScalarValue($"SELECT MAX(CONVERT(INT, C223)) FROM v021 WHERE c010 LIKE '{VendorCode}{oGroupCode}{oVersionCode}___'")
If IsNumeric(oDbResult) Then If IsNumeric(oDbResult) Then
Dim oNewRunningNumber = Integer.Parse(oDbResult) + 1 Dim oNewRunningNumber = Integer.Parse(oDbResult) + 1
@ -103,31 +137,168 @@ Public Class Winline
End Try End Try
End Function End Function
Public Function SendWebserviceRequest(XmlData As String) Public Function SendWebserviceRequest(TemplateType As Integer, TemplateName As String, XmlData As String)
Try Try
Dim oWebserviceConfig = My.Application.ConfigManager.Config.WinLine_WebService Dim oWebserviceConfig = My.Application.ConfigManager.Config.WebService
Dim oServer As String = oWebserviceConfig.Server Dim oServer As String = oWebserviceConfig.Server
Dim oURI = $"http://{oServer}/ewlservice/import" Dim oURI = $"http://{oServer}/ewlservice/import"
Dim oQuery As String = "" Dim oQuery As String = ""
oQuery &= $"User={oWebserviceConfig.Username}" oQuery &= $"User={oWebserviceConfig.Username}&"
oQuery &= $"Password={oWebserviceConfig.Password}" oQuery &= $"Password={oWebserviceConfig.Password}&"
oQuery &= $"Company={oWebserviceConfig.Mandator}" oQuery &= $"Company={oWebserviceConfig.Mandator}&"
oQuery &= $"Type={oWebserviceConfig.ArticleTemplateType}" oQuery &= $"Type={TemplateType}&"
oQuery &= $"Vorlage={oWebserviceConfig.ArticleTemplateName}" oQuery &= $"Vorlage={TemplateName}&"
oQuery &= $"Actioncode={oWebserviceConfig.ActionCode}" oQuery &= $"Actioncode={oWebserviceConfig.ActionCode}&"
oQuery &= $"byref=0" oQuery &= $"byref=0&"
oQuery &= $"Data={XmlData}" oQuery &= $"Data={XmlData}"
oURI &= $"?{oQuery}" oURI &= $"?{oQuery}"
Dim oClient As HttpWebRequest = WebRequest.Create(oURI) Dim oRequest As HttpWebRequest = WebRequest.Create(oURI)
oClient.Method = "POST" Dim oResponse As HttpWebResponse = DirectCast(oRequest.GetResponse(), HttpWebResponse)
oClient.ContentType = "application/xml" Dim oXmlResponse As String
Catch ex As Exception
Using oReader As New StreamReader(oResponse.GetResponseStream())
oXmlResponse = oReader.ReadToEnd()
End Using
Dim oDocument As New XmlDocument
oDocument.LoadXml(oXmlResponse)
oDocument.Save(Console.Out)
Dim oSuccess As XmlNode = oDocument.DocumentElement.SelectSingleNode("OverallSuccess")
If oSuccess.InnerText.ToUpper = "TRUE" Then
Return True
Else
Return False
End If
Catch ex As Exception
_Logger.Error(ex)
Return False
End Try End Try
End Function End Function
Public Function TestArticleExists(ArticleNumber As String) As Boolean
Try
Dim oResult = _Winline.GetScalarValue($"SELECT c000 FROM v021 WHERE c002 = '{ArticleNumber}'")
If IsNothing(oResult) Or IsDBNull(oResult) Then
Return False
Else
Return True
End If
Catch ex As Exception
Return False
End Try
End Function
Public Function CreateArticle(ArticleNumber As String, RunningNumber As String, ArticleDescription As String, Vendor As Vendor, IsSerialnumberArticle As Boolean)
Dim oTemplateName As String = _Config.WebService.ArticleTemplateName
Dim oTemplateType As Integer = _Config.WebService.ArticleTemplateType
Dim oTaxCode As Integer = _Config.WebService.TaxCode
Dim oDescription As String = ArticleDescription
Dim oShapeFrom As String
Dim oShapeTo As String
Dim oArticleType As Integer
Dim oChargeIdentFlag As Integer
Dim oShapeFlag As Integer
Dim oUseShape As String
Dim oDefaultShape As String
Dim oMultipleShapes As String
If IsSerialnumberArticle = True Then
oArticleType = 0
oChargeIdentFlag = 1
oShapeFlag = 1
oUseShape = "true"
oShapeFrom = _Config.WebService.ShapeFrom
oShapeTo = _Config.WebService.ShapeTo
oDefaultShape = "A"
oMultipleShapes = "true"
Else
oArticleType = 0
oChargeIdentFlag = 2
oShapeFlag = 0
oUseShape = "false"
oShapeFrom = String.Empty
oShapeTo = String.Empty
oDefaultShape = String.Empty
oMultipleShapes = "false"
End If
Dim oXmlData
oXmlData = ""
oXmlData &= $"<?xml version=""1.0"" encoding=""UTF-8""?>"
oXmlData &= $"<MESOWebService TemplateType=""{oTemplateType}"" Template=""{oTemplateName}"">"
oXmlData &= $"<{oTemplateName}>"
' ======================================================
oXmlData &= $"<Artikelnummer>{ArticleNumber}{RunningNumber}</Artikelnummer>"
oXmlData &= $"<Bezeichnung>{oDescription}</Bezeichnung>"
oXmlData &= $"<Artikeltyp>{oArticleType}</Artikeltyp>"
oXmlData &= $"<ChargeIdentflag>{oChargeIdentFlag}</ChargeIdentflag>"
oXmlData &= $"<Auspraegungsflag>{oShapeFlag}</Auspraegungsflag>"
oXmlData &= $"<VerwendungAuspr1>{oUseShape}</VerwendungAuspr1>"
oXmlData &= $"<Auspr1von>{oShapeFrom}</Auspr1von>"
oXmlData &= $"<Auspr1bis>{oShapeTo}</Auspr1bis>"
oXmlData &= $"<Hersteller>{Vendor.WinlineNumber.Trim}</Hersteller>"
oXmlData &= $"<Steuerzeile>{oTaxCode}</Steuerzeile>"
oXmlData &= $"<LaufendeNummer>{RunningNumber}</LaufendeNummer>"
oXmlData &= $"<Standardauspraegung1>{oDefaultShape}</Standardauspraegung1>"
oXmlData &= $"<Mehrfachauspraegung>{oMultipleShapes}</Mehrfachauspraegung>"
' ======================================================
oXmlData &= $"</{oTemplateName}>"
oXmlData &= $"</MESOWebService>"
Try
My.Application.Winline.SendWebserviceRequest(oTemplateType, oTemplateName, oXmlData)
Return True
Catch ex As Exception
_Logger.Error(ex)
Return False
End Try
End Function
Public Function CreatePriceInfo(ArticleNumber As String, RunningNumber As String, VendorNumber As String)
Dim oTemplateName As String = _Config.WebService.PriceTemplateName
Dim oTemplateType As Integer = _Config.WebService.PriceTemplateType
Dim oXmlData
oXmlData = ""
oXmlData &= $"<?xml version=""1.0"" encoding=""UTF-8""?>"
oXmlData &= $"<MESOWebService TemplateType=""{oTemplateType}"" Template=""{oTemplateName}"">"
oXmlData &= $"<{oTemplateName}>"
' ======================================================
oXmlData &= $"<Artikelnummer>{ArticleNumber}{RunningNumber}</Artikelnummer>"
oXmlData &= $"<Kontonummer>{VendorNumber.Trim}</Kontonummer>"
' ======================================================
oXmlData &= $"</{oTemplateName}>"
oXmlData &= $"</MESOWebService>"
Try
My.Application.Winline.SendWebserviceRequest(oTemplateType, oTemplateName, oXmlData)
Return True
Catch ex As Exception
_Logger.Error(ex)
Return False
End Try
End Function
Public Sub RunWinlineMacro(MacroName As String, ParamArray Parameters As Object())
Try
Dim oCWLObject
Dim oParamArray As Object = New Runtime.InteropServices.VariantWrapper(Parameters)
oCWLObject = CreateObject("cwlstart.application")
oCWLObject.MacroCommands.MRunMacro(MacroName, oParamArray)
Catch ex As Exception
_Logger.Error(ex)
MsgBox($"Das WinLine-Makro [{MacroName}] konnte nicht gestartet werden. Mehr Informationen im Log.", MsgBoxStyle.Critical, "WinLine")
End Try
End Sub
End Class End Class

View File

@ -22,51 +22,58 @@ Partial Class frmCreateArticle
'Das Bearbeiten mit dem Code-Editor ist nicht möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.TextBox1 = New System.Windows.Forms.TextBox() Me.txtArticleNumber = New System.Windows.Forms.TextBox()
Me.Label1 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label()
Me.TextBox2 = New System.Windows.Forms.TextBox() Me.txtArticleDescription = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label()
Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.CheckBox1 = New System.Windows.Forms.CheckBox() Me.lblImportantInformation = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button() Me.Button1 = New System.Windows.Forms.Button()
Me.txtRunningNumber = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Button2 = New System.Windows.Forms.Button()
Me.Label5 = New System.Windows.Forms.Label()
Me.txtFinalArticleNumber = New System.Windows.Forms.TextBox()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'TextBox1 'txtArticleNumber
' '
Me.TextBox1.Font = New System.Drawing.Font("Segoe UI", 8.25!) Me.txtArticleNumber.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox1.Location = New System.Drawing.Point(12, 28) Me.txtArticleNumber.Location = New System.Drawing.Point(12, 28)
Me.TextBox1.Name = "TextBox1" Me.txtArticleNumber.Name = "txtArticleNumber"
Me.TextBox1.ReadOnly = True Me.txtArticleNumber.ReadOnly = True
Me.TextBox1.Size = New System.Drawing.Size(298, 22) Me.txtArticleNumber.Size = New System.Drawing.Size(210, 25)
Me.TextBox1.TabIndex = 0 Me.txtArticleNumber.TabIndex = 0
' '
'Label1 'Label1
' '
Me.Label1.AutoSize = True Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Segoe UI Semibold", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(12, 9) Me.Label1.Location = New System.Drawing.Point(12, 9)
Me.Label1.Name = "Label1" Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(82, 13) Me.Label1.Size = New System.Drawing.Size(92, 17)
Me.Label1.TabIndex = 1 Me.Label1.TabIndex = 1
Me.Label1.Text = "Artikelnummer" Me.Label1.Text = "Artikelnummer"
' '
'TextBox2 'txtArticleDescription
' '
Me.TextBox2.Font = New System.Drawing.Font("Segoe UI", 8.25!) Me.txtArticleDescription.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox2.Location = New System.Drawing.Point(12, 72) Me.txtArticleDescription.Location = New System.Drawing.Point(12, 72)
Me.TextBox2.Multiline = True Me.txtArticleDescription.Multiline = True
Me.TextBox2.Name = "TextBox2" Me.txtArticleDescription.Name = "txtArticleDescription"
Me.TextBox2.Size = New System.Drawing.Size(298, 105) Me.txtArticleDescription.Size = New System.Drawing.Size(298, 101)
Me.TextBox2.TabIndex = 0 Me.txtArticleDescription.TabIndex = 0
Me.txtArticleDescription.Text = "Test Artikel für Artikelnummergenerator"
' '
'Label2 'Label2
' '
Me.Label2.AutoSize = True Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Segoe UI Semibold", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(12, 53) Me.Label2.Location = New System.Drawing.Point(12, 53)
Me.Label2.Name = "Label2" Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(108, 13) Me.Label2.Size = New System.Drawing.Size(123, 17)
Me.Label2.TabIndex = 1 Me.Label2.TabIndex = 1
Me.Label2.Text = "Artikelbeschreibung" Me.Label2.Text = "Artikelbeschreibung"
' '
@ -74,7 +81,8 @@ Partial Class frmCreateArticle
' '
Me.GroupBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Me.GroupBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.GroupBox1.Font = New System.Drawing.Font("Segoe UI Semibold", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox1.Controls.Add(Me.lblImportantInformation)
Me.GroupBox1.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox1.Location = New System.Drawing.Point(485, 12) Me.GroupBox1.Location = New System.Drawing.Point(485, 12)
Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(303, 426) Me.GroupBox1.Size = New System.Drawing.Size(303, 426)
@ -82,30 +90,29 @@ Partial Class frmCreateArticle
Me.GroupBox1.TabStop = False Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Wichtige Informationen" Me.GroupBox1.Text = "Wichtige Informationen"
' '
'CheckBox1 'lblImportantInformation
' '
Me.CheckBox1.AutoSize = True Me.lblImportantInformation.Dock = System.Windows.Forms.DockStyle.Fill
Me.CheckBox1.Font = New System.Drawing.Font("Segoe UI Semibold", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblImportantInformation.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CheckBox1.Location = New System.Drawing.Point(15, 223) Me.lblImportantInformation.Location = New System.Drawing.Point(3, 21)
Me.CheckBox1.Name = "CheckBox1" Me.lblImportantInformation.Name = "lblImportantInformation"
Me.CheckBox1.Size = New System.Drawing.Size(172, 17) Me.lblImportantInformation.Size = New System.Drawing.Size(297, 402)
Me.CheckBox1.TabIndex = 3 Me.lblImportantInformation.TabIndex = 0
Me.CheckBox1.Text = "Serienummer Artikel anlegen" Me.lblImportantInformation.Text = "Label6"
Me.CheckBox1.UseVisualStyleBackColor = True
' '
'Label3 'Label3
' '
Me.Label3.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(12, 180) Me.Label3.Location = New System.Drawing.Point(12, 217)
Me.Label3.Name = "Label3" Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(298, 40) Me.Label3.Size = New System.Drawing.Size(298, 77)
Me.Label3.TabIndex = 4 Me.Label3.TabIndex = 4
Me.Label3.Text = "Seriennummer Artikel anlegen" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Diese Einstellung kann, anders als beim Altsystem, " & Me.Label3.Text = "Seriennummer Artikel anlegen" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Diese Einstellung kann, anders als beim Altsystem, " &
"NICHT mehr im Nachhinein geändert werden!" "NICHT mehr im Nachhinein geändert werden!"
' '
'Button1 'Button1
' '
Me.Button1.Font = New System.Drawing.Font("Segoe UI", 8.25!) Me.Button1.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button1.Location = New System.Drawing.Point(12, 386) Me.Button1.Location = New System.Drawing.Point(12, 386)
Me.Button1.Name = "Button1" Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(298, 52) Me.Button1.Size = New System.Drawing.Size(298, 52)
@ -113,33 +120,91 @@ Partial Class frmCreateArticle
Me.Button1.Text = "Artikel anlegen!" Me.Button1.Text = "Artikel anlegen!"
Me.Button1.UseVisualStyleBackColor = True Me.Button1.UseVisualStyleBackColor = True
' '
'txtRunningNumber
'
Me.txtRunningNumber.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtRunningNumber.Location = New System.Drawing.Point(228, 28)
Me.txtRunningNumber.Name = "txtRunningNumber"
Me.txtRunningNumber.ReadOnly = True
Me.txtRunningNumber.Size = New System.Drawing.Size(82, 25)
Me.txtRunningNumber.TabIndex = 0
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(225, 9)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(83, 17)
Me.Label4.TabIndex = 1
Me.Label4.Text = "Laufende Nr."
'
'Button2
'
Me.Button2.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button2.Location = New System.Drawing.Point(12, 297)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(298, 52)
Me.Button2.TabIndex = 5
Me.Button2.Text = "Seriennummerartikel anlegen!"
Me.Button2.UseVisualStyleBackColor = True
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(12, 352)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(298, 31)
Me.Label5.TabIndex = 6
Me.Label5.Text = "- ODER -"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'txtFinalArticleNumber
'
Me.txtFinalArticleNumber.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtFinalArticleNumber.Location = New System.Drawing.Point(12, 179)
Me.txtFinalArticleNumber.Name = "txtFinalArticleNumber"
Me.txtFinalArticleNumber.ReadOnly = True
Me.txtFinalArticleNumber.Size = New System.Drawing.Size(298, 35)
Me.txtFinalArticleNumber.TabIndex = 7
'
'frmCreateArticle 'frmCreateArticle
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450) Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.txtFinalArticleNumber)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.txtArticleDescription)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.txtRunningNumber)
Me.Controls.Add(Me.txtArticleNumber)
Me.Font = New System.Drawing.Font("Segoe UI Semibold", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Font = New System.Drawing.Font("Segoe UI Semibold", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "frmCreateArticle" Me.Name = "frmCreateArticle"
Me.Text = "frmCreateArticle" Me.Text = "Artikel erstellen"
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
End Sub End Sub
Friend WithEvents TextBox1 As TextBox Friend WithEvents txtArticleNumber As TextBox
Friend WithEvents Label1 As Label Friend WithEvents Label1 As Label
Friend WithEvents TextBox2 As TextBox Friend WithEvents txtArticleDescription As TextBox
Friend WithEvents Label2 As Label Friend WithEvents Label2 As Label
Friend WithEvents GroupBox1 As GroupBox Friend WithEvents GroupBox1 As GroupBox
Friend WithEvents CheckBox1 As CheckBox
Friend WithEvents Label3 As Label Friend WithEvents Label3 As Label
Friend WithEvents Button1 As Button Friend WithEvents Button1 As Button
Friend WithEvents txtRunningNumber As TextBox
Friend WithEvents Label4 As Label
Friend WithEvents Button2 As Button
Friend WithEvents Label5 As Label
Friend WithEvents txtFinalArticleNumber As TextBox
Friend WithEvents lblImportantInformation As Label
End Class End Class

View File

@ -1,3 +1,66 @@
Public Class frmCreateArticle Public Class frmCreateArticle
Public Property Vendor As Vendor
Public Property Group As ProductGroup
Public Property Version As ProductVersion
Public Property ArticleNumber As String
Public Property RunningNumber As String
Private ReadOnly Config As Config = My.Application.ConfigManager.Config
Private Sub frmCreateArticle_Load(sender As Object, e As EventArgs) Handles MyBase.Load
txtRunningNumber.Text = RunningNumber
txtArticleNumber.Text = ArticleNumber
lblImportantInformation.Text = String.Join(vbNewLine, Config.ImportantNotes)
End Sub
Private Function StartArticleCreation(IsSerialNumberArticle As Boolean) As String
Try
If My.Application.Winline.TestArticleExists($"{ArticleNumber}{RunningNumber}") Then
MsgBox($"Der Artikel '{ArticleNumber}{RunningNumber}' kann nicht angelegt werden, da er bereits existiert")
Return Nothing
End If
txtFinalArticleNumber.Text = String.Empty
Dim oArticleResult = My.Application.Winline.CreateArticle(ArticleNumber, RunningNumber, txtArticleDescription.Text, Vendor, IsSerialNumberArticle)
Dim oPriceResult = My.Application.Winline.CreatePriceInfo(ArticleNumber, RunningNumber, Vendor.WinlineNumber)
If oArticleResult And oPriceResult Then
MsgBox("Artikel erfolgreich angelegt!", MsgBoxStyle.Information, Text)
txtFinalArticleNumber.Text = $"{ArticleNumber}{RunningNumber}"
Return $"{ArticleNumber}{RunningNumber}"
Else
MsgBox("Artikel konnte nicht angelegt werden!", MsgBoxStyle.Critical, Text)
Return Nothing
End If
Catch ex As Exception
MsgBox("Fehler bei Artikelanlage: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text)
Return Nothing
End Try
End Function
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim oResult = MsgBox("Wollen Sie einen Seriennummer-Artikel anlegen?" & vbNewLine & vbNewLine &
"Diese Einstellung kann, anders als beim Altsystem, NICHT mehr im Nachhinein geändert werden!",
MsgBoxStyle.Question Or vbYesNo, Text)
If oResult = MsgBoxResult.Yes Then
Dim oArticle = StartArticleCreation(True)
If oArticle IsNot Nothing Then
My.Computer.Clipboard.SetText(oArticle)
My.Application.Winline.RunWinlineMacro(My.Application.ConfigManager.Config.CompletionMacro, oArticle)
End If
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oArticle = StartArticleCreation(False)
If oArticle IsNot Nothing Then
My.Computer.Clipboard.SetText(oArticle)
My.Application.Winline.RunWinlineMacro(My.Application.ConfigManager.Config.CompletionMacro, oArticle)
End If
End Sub
End Class End Class

View File

@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmMain Partial Class frmMain
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _ <System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try Try
If disposing AndAlso components IsNot Nothing Then If disposing AndAlso components IsNot Nothing Then
@ -20,7 +20,7 @@ Partial Class frmMain
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich. 'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.listboxProductGroups = New System.Windows.Forms.ListBox() Me.listboxProductGroups = New System.Windows.Forms.ListBox()
Me.Label1 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label()
@ -33,10 +33,6 @@ Partial Class frmMain
Me.listboxVendors = New System.Windows.Forms.ListBox() Me.listboxVendors = New System.Windows.Forms.ListBox()
Me.Button4 = New System.Windows.Forms.Button() Me.Button4 = New System.Windows.Forms.Button()
Me.Label4 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label()
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
Me.EinstellungenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.MenuStrip1.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'listboxProductGroups 'listboxProductGroups
@ -150,28 +146,6 @@ Partial Class frmMain
Me.Label4.TabIndex = 4 Me.Label4.TabIndex = 4
Me.Label4.Text = "Aufbau: Kürzel - Markenname (Kreditorenummer | Name)" Me.Label4.Text = "Aufbau: Kürzel - Markenname (Kreditorenummer | Name)"
' '
'MenuStrip1
'
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem1})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(1022, 24)
Me.MenuStrip1.TabIndex = 5
Me.MenuStrip1.Text = "MenuStrip1"
'
'ToolStripMenuItem1
'
Me.ToolStripMenuItem1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EinstellungenToolStripMenuItem})
Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1"
Me.ToolStripMenuItem1.Size = New System.Drawing.Size(46, 20)
Me.ToolStripMenuItem1.Text = "Datei"
'
'EinstellungenToolStripMenuItem
'
Me.EinstellungenToolStripMenuItem.Name = "EinstellungenToolStripMenuItem"
Me.EinstellungenToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.EinstellungenToolStripMenuItem.Text = "Einstellungen"
'
'frmMain 'frmMain
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
@ -188,14 +162,10 @@ Partial Class frmMain
Me.Controls.Add(Me.listBoxProductVersion) Me.Controls.Add(Me.listBoxProductVersion)
Me.Controls.Add(Me.listboxProductGroups) Me.Controls.Add(Me.listboxProductGroups)
Me.Controls.Add(Me.listboxVendors) Me.Controls.Add(Me.listboxVendors)
Me.Controls.Add(Me.MenuStrip1)
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.MainMenuStrip = Me.MenuStrip1
Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
Me.Name = "frmMain" Me.Name = "frmMain"
Me.Text = "Artikelnummer Generator" Me.Text = "Artikelnummer Generator"
Me.MenuStrip1.ResumeLayout(False)
Me.MenuStrip1.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@ -211,7 +181,4 @@ Partial Class frmMain
Friend WithEvents listboxVendors As ListBox Friend WithEvents listboxVendors As ListBox
Friend WithEvents Button4 As Button Friend WithEvents Button4 As Button
Friend WithEvents Label4 As Label Friend WithEvents Label4 As Label
Friend WithEvents MenuStrip1 As MenuStrip
Friend WithEvents ToolStripMenuItem1 As ToolStripMenuItem
Friend WithEvents EinstellungenToolStripMenuItem As ToolStripMenuItem
End Class End Class

View File

@ -117,7 +117,4 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="MenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

View File

@ -1,21 +1,53 @@
Public Class frmMain Public Class frmMain
Private _Logger As Logger Private _Logger As Logger
Private _Database As Database Private _Database As Database
Private _WinLine As Winline
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
My.Application.LogConfig = New LogConfig(LogPath:=LogConfig.PathType.AppData, CompanyName:="Digital Data", ProductName:="WinLineProductNumberGenerator") Try
My.Application.ConfigManager = New ConfigManager(Of Config)(My.Application.LogConfig, Application.UserAppDataPath) My.Application.LogConfig = New LogConfig(LogPath:=LogConfig.PathType.AppData, CompanyName:="Digital Data", ProductName:="WinLineProductNumberGenerator")
My.Application.ConfigManager = New ConfigManager(Of Config)(My.Application.LogConfig, Application.UserAppDataPath)
_Logger = My.Application.LogConfig.GetLogger()
Catch ex As Exception
MsgBox("Fehler beim Initialisieren (Logging und Config):" & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text)
End Try
_Logger = My.Application.LogConfig.GetLogger() Dim oLogConfig = My.Application.LogConfig
_Database = New Database(My.Application.LogConfig, My.Application.ConfigManager) Dim oConfigManager = My.Application.ConfigManager
_WinLine = New Winline(My.Application.LogConfig, _Database) Dim oConfig As Config = oConfigManager.Config
listboxVendors.DataSource = Nothing If oConfig.EXIMConnectionString = String.Empty Then
MsgBox("ConnectionString zur EXIM Datenbank ist nicht hinterlegt!", MsgBoxStyle.Critical, Text)
Application.Exit()
End If
Dim oVendors = _WinLine.GetVendors() If oConfig.WinlineConnectionString = String.Empty Then
MsgBox("ConnectionString zur Winline Datenbank ist nicht hinterlegt!", MsgBoxStyle.Critical, Text)
Application.Exit()
End If
listboxVendors.DataSource = oVendors Try
My.Application.EXIMDatabase = New Database(
oLogConfig,
oConfigManager,
oConfigManager.Config.EXIMConnectionString)
My.Application.WinlineDatabase = New Database(
oLogConfig,
oConfigManager,
oConfigManager.Config.WinlineConnectionString)
My.Application.Winline = New Winline(
oLogConfig,
My.Application.EXIMDatabase,
My.Application.WinlineDatabase,
oConfigManager.Config)
Dim oVendors = My.Application.Winline.GetVendors()
listboxVendors.DataSource = oVendors
Catch ex As Exception
MsgBox("Fehler beim Initialisieren (Datenbank):" & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text)
_Logger.Error(ex)
End Try
End Sub End Sub
Private Sub frmMain_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed Private Sub frmMain_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
@ -25,7 +57,7 @@
Private Sub listboxVendors_SelectedIndexChanged(sender As Object, e As EventArgs) Handles listboxVendors.SelectedIndexChanged Private Sub listboxVendors_SelectedIndexChanged(sender As Object, e As EventArgs) Handles listboxVendors.SelectedIndexChanged
If listboxVendors.SelectedItem IsNot Nothing Then If listboxVendors.SelectedItem IsNot Nothing Then
Dim oVendor As Vendor = listboxVendors.SelectedItem Dim oVendor As Vendor = listboxVendors.SelectedItem
Dim oGroups As List(Of ProductGroup) = _WinLine.GetGroupsByVendor(oVendor.Code) Dim oGroups As List(Of ProductGroup) = My.Application.Winline.GetGroupsByVendor(oVendor.Code)
listboxProductGroups.DataSource = oGroups listboxProductGroups.DataSource = oGroups
End If End If
@ -35,7 +67,7 @@
Private Sub listboxProductGroups_SelectedIndexChanged(sender As Object, e As EventArgs) Handles listboxProductGroups.SelectedIndexChanged Private Sub listboxProductGroups_SelectedIndexChanged(sender As Object, e As EventArgs) Handles listboxProductGroups.SelectedIndexChanged
If listboxProductGroups.SelectedItem IsNot Nothing Then If listboxProductGroups.SelectedItem IsNot Nothing Then
Dim oGroup As ProductGroup = listboxProductGroups.SelectedItem Dim oGroup As ProductGroup = listboxProductGroups.SelectedItem
Dim oVersions As List(Of ProductVersion) = _WinLine.GetVersionsByVendorAndGroup(oGroup.Code, oGroup.GroupId) Dim oVersions As List(Of ProductVersion) = My.Application.Winline.GetVersionsByVendorAndGroup(oGroup.Code, oGroup.GroupId)
listBoxProductVersion.DataSource = oVersions listBoxProductVersion.DataSource = oVersions
End If End If
@ -62,24 +94,72 @@
End If End If
Dim oArticleNumber = $"{oVendor.Code}{oGroup.GroupString}{oVersion.VersionString}" Dim oArticleNumber = $"{oVendor.Code}{oGroup.GroupString}{oVersion.VersionString}"
Dim oRunningNumber As String
Try Try
Dim oRunningNumber = _WinLine.GetNextRunningNumber(oVendor.Code, oGroup.GroupId, oVersion.VersionId) oRunningNumber = My.Application.Winline.GetNextRunningNumber(oVendor.Code, oGroup.GroupId, oVersion.VersionId)
MsgBox($"{oArticleNumber}{oRunningNumber}")
Catch ex As Exception
Select Case ex.Message
Case _WinLine.NO_RUNNING_NUMBER_FOUND
Dim oMessage = $"Für die Artikelnummer [{oArticleNumber}___] wurde im WinLine-System keine Laufende Nummer hinterlegt."
oMessage &= "Diese Nummer ist für die Automatische Artikelnummer-Generierung zwingend notwendig"
MsgBox(oMessage, MsgBoxStyle.Critical, Text) If My.Application.Winline.TestArticleExists($"{oArticleNumber}{oRunningNumber}") Then
Throw New ApplicationException(My.Application.Winline.ARTICLE_ALREADY_EXISTS)
End If
Dim oForm As New frmCreateArticle() With {
.ArticleNumber = oArticleNumber,
.RunningNumber = oRunningNumber,
.Vendor = oVendor,
.Version = oVersion,
.Group = oGroup
}
oForm.ShowDialog()
Catch ex As Exception
Dim oMessage As String = ""
Select Case ex.Message
Case My.Application.Winline.NO_RUNNING_NUMBER_FOUND
oMessage = ""
oMessage &= $"Für die Artikelnummer [{oArticleNumber}] wurde im WinLine-System keine Laufende Nummer hinterlegt."
oMessage &= "Diese Nummer ist für die Automatische Artikelnummer-Generierung zwingend notwendig"
Case My.Application.Winline.ARTICLE_ALREADY_EXISTS
oMessage = ""
oMessage &= $"Der Artikel [{oArticleNumber}{oRunningNumber}] existiert bereits und wird deshalb nicht angelegt." & vbNewLine
oMessage &= $"Prüfen Sie, ob die Laufenden Nummern für diese Artikelversion hinterlegt korrekt hinterlegt."
Case Else Case Else
MsgBox("Folgender Fehler ist aufgetreten:" & vbNewLine & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text) oMessage = ""
oMessage &= "Folgender Fehler ist aufgetreten:" & vbNewLine & vbNewLine & ex.Message
End Select End Select
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
End Try End Try
End Sub End Sub
Private Sub EinstellungenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EinstellungenToolStripMenuItem.Click Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
frmWinlineConfig.ShowDialog() Dim oResult As DialogResult = frmNewVendor.ShowDialog()
If oResult = DialogResult.OK Then
Dim oVendors = My.Application.Winline.GetVendors()
listboxVendors.DataSource = oVendors
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oForm As New frmNewGroup() With {
.Vendor = listboxVendors.SelectedItem
}
If oForm.ShowDialog = DialogResult.OK Then
'reload groups?
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim oForm As New frmNewProduct() With {
.Vendor = listboxVendors.SelectedItem,
.Group = listboxProductGroups.SelectedItem
}
If oForm.ShowDialog = DialogResult.OK Then
'reload products?
End If
End Sub End Sub
End Class End Class

View File

@ -0,0 +1,120 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmNewGroup
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.txtName = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.txtNumber = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.txtVendor = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(12, 38)
Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(315, 20)
Me.txtName.TabIndex = 5
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(9, 22)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(72, 13)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Beschreibung"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(9, 61)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(83, 13)
Me.Label1.TabIndex = 7
Me.Label1.Text = "Lieferant/Marke"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(9, 100)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(114, 13)
Me.Label2.TabIndex = 4
Me.Label2.Text = "Neue Gruppennummer"
'
'txtNumber
'
Me.txtNumber.Location = New System.Drawing.Point(12, 116)
Me.txtNumber.Name = "txtNumber"
Me.txtNumber.ReadOnly = True
Me.txtNumber.Size = New System.Drawing.Size(315, 20)
Me.txtNumber.TabIndex = 5
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(12, 176)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(315, 44)
Me.Button1.TabIndex = 8
Me.Button1.Text = "Gruppe anlegen!"
Me.Button1.UseVisualStyleBackColor = True
'
'txtVendor
'
Me.txtVendor.Location = New System.Drawing.Point(12, 77)
Me.txtVendor.Name = "txtVendor"
Me.txtVendor.ReadOnly = True
Me.txtVendor.Size = New System.Drawing.Size(315, 20)
Me.txtVendor.TabIndex = 9
'
'frmNewGroup
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(339, 232)
Me.Controls.Add(Me.txtVendor)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.txtNumber)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.txtName)
Me.Controls.Add(Me.Label3)
Me.Name = "frmNewGroup"
Me.Text = "Neue Gruppe"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents txtName As TextBox
Friend WithEvents Label3 As Label
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents txtNumber As TextBox
Friend WithEvents Button1 As Button
Friend WithEvents txtVendor As TextBox
End Class

View File

@ -0,0 +1,54 @@
Public Class frmNewGroup
Private _Logger As Logger
Public Property Vendor As Vendor
Private Sub frmNewGroup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
_Logger = My.Application.LogConfig.GetLogger()
If Not IsNothing(Vendor) Then
Dim oSQL As String = $"SELECT ISNULL(MAX([GROUP]), 0) FROM TBDD_ARTICLE_GENERATOR_GROUPS WHERE VENDOR_ID = {Vendor.Guid}"
Dim oNumber = My.Application.EXIMDatabase.GetScalarValue(oSQL) + 1
Dim oGroupCode As String = $"{Vendor.Code}{oNumber}"
txtNumber.Text = oNumber
txtVendor.Text = Vendor.Name
End If
Catch ex As Exception
_Logger.Error(ex)
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oName As String = Trim(txtName.Text)
If oName = String.Empty Then
MsgBox("Bitte füllen Sie das Feld 'Name' aus!", MsgBoxStyle.Exclamation, Text)
Exit Sub
End If
If Not IsNothing(Vendor) Then
Try
Dim oNumber As Integer = Integer.Parse(txtNumber.Text)
Dim oGroupCode As String = $"{Vendor.Code}{oNumber.ToString.PadLeft(2)}"
Dim oSQL = $"INSERT INTO TBDD_ARTICLE_GENERATOR_GROUPS
([GROUP], CODE, GROUP_CODE, NAME, VENDOR_ID)
VALUES ({oNumber}, '{Vendor.Code}', '{oGroupCode}', '{oName}', {Vendor.Guid})"
Dim oResult = My.Application.EXIMDatabase.ExecuteNonQuery(oSQL)
If oResult = True Then
MsgBox("Gruppe erstellt!", MsgBoxStyle.Information, Text)
DialogResult = DialogResult.OK
Close()
Else
MsgBox("Fehler beim Erstellen der Gruppe. Mehr Informationen im Log.", MsgBoxStyle.Critical, Text)
End If
Catch ex As Exception
MsgBox("Fehler beim Erstellen der Gruppe: " & ex.Message, MsgBoxStyle.Critical, Text)
End Try
End If
End Sub
End Class

View File

@ -0,0 +1,143 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmNewProduct
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.txtVendor = New System.Windows.Forms.TextBox()
Me.txtName = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtGroup = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.txtVersion = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'txtVendor
'
Me.txtVendor.Location = New System.Drawing.Point(12, 77)
Me.txtVendor.Name = "txtVendor"
Me.txtVendor.ReadOnly = True
Me.txtVendor.Size = New System.Drawing.Size(315, 20)
Me.txtVendor.TabIndex = 6
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(12, 38)
Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(315, 20)
Me.txtName.TabIndex = 7
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(9, 22)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(35, 13)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Name"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(9, 61)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(48, 13)
Me.Label2.TabIndex = 5
Me.Label2.Text = "Lieferant"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(12, 209)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(315, 44)
Me.Button1.TabIndex = 8
Me.Button1.Text = "Version anlegen!"
Me.Button1.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(9, 100)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(42, 13)
Me.Label1.TabIndex = 5
Me.Label1.Text = "Gruppe"
'
'txtGroup
'
Me.txtGroup.Location = New System.Drawing.Point(12, 116)
Me.txtGroup.Name = "txtGroup"
Me.txtGroup.ReadOnly = True
Me.txtGroup.Size = New System.Drawing.Size(315, 20)
Me.txtGroup.TabIndex = 6
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(9, 139)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(71, 13)
Me.Label4.TabIndex = 5
Me.Label4.Text = "Neue Version"
'
'txtVersion
'
Me.txtVersion.Location = New System.Drawing.Point(12, 155)
Me.txtVersion.Name = "txtVersion"
Me.txtVersion.ReadOnly = True
Me.txtVersion.Size = New System.Drawing.Size(315, 20)
Me.txtVersion.TabIndex = 6
'
'frmNewProduct
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(339, 265)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.txtVersion)
Me.Controls.Add(Me.txtGroup)
Me.Controls.Add(Me.txtVendor)
Me.Controls.Add(Me.txtName)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Label2)
Me.Name = "frmNewProduct"
Me.Text = "Neue Version"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents txtVendor As TextBox
Friend WithEvents txtName As TextBox
Friend WithEvents Label3 As Label
Friend WithEvents Label2 As Label
Friend WithEvents Button1 As Button
Friend WithEvents Label1 As Label
Friend WithEvents txtGroup As TextBox
Friend WithEvents Label4 As Label
Friend WithEvents txtVersion As TextBox
End Class

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,55 @@
Public Class frmNewProduct
Public Property Vendor As Vendor
Public Property Group As ProductGroup
Private _Logger As Logger
Private Sub frmNewProduct_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
_Logger = My.Application.LogConfig.GetLogger()
If Not IsNothing(Vendor) Then
Dim oSQL As String = $"SELECT ISNULL(MAX([VERSION]), 0) FROM [TBDD_ARTICLE_GENERATOR_PRODUCTS] WHERE VENDOR_ID = {Vendor.Guid} AND GROUP_ID = {Group.GroupId}"
Dim oNumber = My.Application.EXIMDatabase.GetScalarValue(oSQL) + 1
Dim oGroupCode As String = $"{Vendor.Code}{oNumber}"
txtVendor.Text = Vendor.Name
txtGroup.Text = Group.Name
txtVersion.Text = oNumber
End If
Catch ex As Exception
_Logger.Error(ex)
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oName As String = Trim(txtName.Text)
If oName = String.Empty Then
MsgBox("Bitte füllen Sie das Feld 'Name' aus!", MsgBoxStyle.Exclamation, Text)
Exit Sub
End If
If Not IsNothing(Vendor) Then
Try
Dim oNumber = Integer.Parse(txtVersion.Text)
Dim oSQL = $"INSERT INTO TBDD_ARTICLE_GENERATOR_PRODUCTS
([VERSION], NAME, VENDOR_ID, CODE, GROUP_ID)
VALUES ({oNumber}, '{oName}', {Vendor.Guid}, '{Vendor.Code}', {Group.GroupId})"
Dim oResult = My.Application.EXIMDatabase.ExecuteNonQuery(oSQL)
If oResult = True Then
MsgBox("Version erstellt!", MsgBoxStyle.Information, Text)
DialogResult = DialogResult.OK
Close()
Else
MsgBox("Fehler beim Erstellen der Version. Mehr Informationen im Log.", MsgBoxStyle.Critical, Text)
End If
Catch ex As Exception
MsgBox("Fehler beim Erstellen der Version: " & ex.Message, MsgBoxStyle.Critical, Text)
End Try
End If
End Sub
End Class

View File

@ -0,0 +1,118 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmNewVendor
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.cmbWinlineVendor = New System.Windows.Forms.ComboBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtName = New System.Windows.Forms.TextBox()
Me.txtCode = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'cmbWinlineVendor
'
Me.cmbWinlineVendor.FormattingEnabled = True
Me.cmbWinlineVendor.Location = New System.Drawing.Point(12, 116)
Me.cmbWinlineVendor.Name = "cmbWinlineVendor"
Me.cmbWinlineVendor.Size = New System.Drawing.Size(315, 21)
Me.cmbWinlineVendor.TabIndex = 0
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(9, 100)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(86, 13)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Winline Lieferant"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(9, 61)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(78, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Code (AA - ZZ)"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(9, 22)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(106, 13)
Me.Label3.TabIndex = 2
Me.Label3.Text = "Name (Markenname)"
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(12, 38)
Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(315, 20)
Me.txtName.TabIndex = 3
'
'txtCode
'
Me.txtCode.Location = New System.Drawing.Point(12, 77)
Me.txtCode.Name = "txtCode"
Me.txtCode.Size = New System.Drawing.Size(315, 20)
Me.txtCode.TabIndex = 3
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(12, 173)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(315, 44)
Me.Button1.TabIndex = 4
Me.Button1.Text = "Lieferanten anlegen!"
Me.Button1.UseVisualStyleBackColor = True
'
'frmNewVendor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(339, 232)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.txtCode)
Me.Controls.Add(Me.txtName)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.cmbWinlineVendor)
Me.Name = "frmNewVendor"
Me.Text = "Neuer Lieferant"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents cmbWinlineVendor As ComboBox
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents Label3 As Label
Friend WithEvents txtName As TextBox
Friend WithEvents txtCode As TextBox
Friend WithEvents Button1 As Button
End Class

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,56 @@
Public Class frmNewVendor
Public Property Vendor As Vendor
Private Sub frmNewVendor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim oVendors As List(Of Vendor) = My.Application.Winline.GetVendorsFromWinLine()
cmbWinlineVendor.DataSource = oVendors
cmbWinlineVendor.DisplayMember = "WinlineName"
cmbWinlineVendor.ValueMember = "WinlineNumber"
Catch ex As Exception
MsgBox("Fehler beim Laden der Lieferanten: " & ex.Message, MsgBoxStyle.Critical, Text)
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Dim oName As String = txtName.Text
Dim oCode As String = txtCode.Text
Dim oVendor As Vendor = cmbWinlineVendor.SelectedItem
If oName.Length = 0 Then
MsgBox("Bitte tragen Sie einen Namen ein!", MsgBoxStyle.Critical, Text)
txtName.Focus()
Exit Sub
End If
If oCode.Length = 0 Then
MsgBox("Bitte tragen Sie einen Code ein!", MsgBoxStyle.Critical, Text)
txtCode.Focus()
Exit Sub
End If
If IsNothing(oVendor) Then
MsgBox("Bitte wählen Sie einen Lieferanten aus!", MsgBoxStyle.Critical, Text)
End If
Dim oSQL As String = "INSERT INTO TBDD_ARTICLE_GENERATOR_VENDORS " &
"(CODE, NAME, WINLINE_NAME, WINLINE_NUMBER) " &
$"VALUES ('{oCode}', '{oName}', '{oVendor.WinlineName}', '{oVendor.WinlineNumber}')"
Dim oResult = My.Application.EXIMDatabase.ExecuteNonQuery(oSQL)
If oResult = True Then
MsgBox("Lieferant erstellt!", MsgBoxStyle.Information, Text)
DialogResult = DialogResult.OK
Close()
Else
MsgBox("Fehler beim Erstellen des Lieferanten. Mehr Informationen im Log.", MsgBoxStyle.Critical, Text)
End If
Catch ex As Exception
MsgBox("Fehler beim Erstellen des Lieferanten: " & ex.Message, MsgBoxStyle.Critical, Text)
End Try
End Sub
End Class

View File

@ -1,141 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmWinlineConfig
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.txtServer = New System.Windows.Forms.TextBox()
Me.txtMandator = New System.Windows.Forms.TextBox()
Me.txtUsername = New System.Windows.Forms.TextBox()
Me.txtPassword = New System.Windows.Forms.TextBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'txtServer
'
Me.txtServer.Location = New System.Drawing.Point(9, 32)
Me.txtServer.Name = "txtServer"
Me.txtServer.Size = New System.Drawing.Size(346, 20)
Me.txtServer.TabIndex = 0
'
'txtMandator
'
Me.txtMandator.Location = New System.Drawing.Point(9, 71)
Me.txtMandator.Name = "txtMandator"
Me.txtMandator.Size = New System.Drawing.Size(346, 20)
Me.txtMandator.TabIndex = 1
'
'txtUsername
'
Me.txtUsername.Location = New System.Drawing.Point(9, 110)
Me.txtUsername.Name = "txtUsername"
Me.txtUsername.Size = New System.Drawing.Size(346, 20)
Me.txtUsername.TabIndex = 2
'
'txtPassword
'
Me.txtPassword.Location = New System.Drawing.Point(9, 149)
Me.txtPassword.Name = "txtPassword"
Me.txtPassword.Size = New System.Drawing.Size(346, 20)
Me.txtPassword.TabIndex = 3
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(79, 13)
Me.Label1.TabIndex = 4
Me.Label1.Text = "Server-Adresse"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(6, 55)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(49, 13)
Me.Label2.TabIndex = 5
Me.Label2.Text = "Mandant"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(6, 94)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(49, 13)
Me.Label3.TabIndex = 6
Me.Label3.Text = "Benutzer"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(6, 133)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(50, 13)
Me.Label4.TabIndex = 7
Me.Label4.Text = "Passwort"
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.Label4)
Me.GroupBox1.Controls.Add(Me.txtServer)
Me.GroupBox1.Controls.Add(Me.Label3)
Me.GroupBox1.Controls.Add(Me.txtMandator)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.txtUsername)
Me.GroupBox1.Controls.Add(Me.txtPassword)
Me.GroupBox1.Location = New System.Drawing.Point(12, 12)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(361, 226)
Me.GroupBox1.TabIndex = 8
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "WinLine WebServices"
'
'frmWinlineConfig
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "frmWinlineConfig"
Me.Text = "frmWinlineConfig"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents txtServer As TextBox
Friend WithEvents txtMandator As TextBox
Friend WithEvents txtUsername As TextBox
Friend WithEvents txtPassword As TextBox
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents Label3 As Label
Friend WithEvents Label4 As Label
Friend WithEvents GroupBox1 As GroupBox
End Class

View File

@ -1,23 +0,0 @@
Public Class frmWinlineConfig
Private Sub frmWinlineConfig_Load(sender As Object, e As EventArgs) Handles MyBase.Load
With My.Application.ConfigManager.Config
If .WinLine_WebService IsNot Nothing Then
.WinLine_WebService = New Config.WebServiceConfig()
End If
txtServer.Text = .WinLine_WebService.Server
txtMandator.Text = .WinLine_WebService.Mandator
txtUsername.Text = .WinLine_WebService.Username
txtPassword.Text = .WinLine_WebService.Password
End With
End Sub
Private Sub frmWinlineConfig_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
With My.Application.ConfigManager.Config
.WinLine_WebService.Server = txtServer.Text
.WinLine_WebService.Mandator = txtMandator.Text
.WinLine_WebService.Username = txtUsername.Text
.WinLine_WebService.Password = txtPassword.Text
End With
End Sub
End Class