Initial commit

This commit is contained in:
2021-04-20 07:59:36 +02:00
commit fb0247c874
21969 changed files with 11640044 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDKB04_Single", "EDKB04_Single\EDKB04_Single.vbproj", "{D156F45C-F895-4CF9-BA4E-A577F28B52D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D156F45C-F895-4CF9-BA4E-A577F28B52D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D156F45C-F895-4CF9-BA4E-A577F28B52D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D156F45C-F895-4CF9-BA4E-A577F28B52D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D156F45C-F895-4CF9-BA4E-A577F28B52D6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D156F45C-F895-4CF9-BA4E-A577F28B52D6}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>EDKB04_Single.Module1</StartupObject>
<RootNamespace>EDKB04_Single</RootNamespace>
<AssemblyName>EDKB04_Single</AssemblyName>
<MyType>Console</MyType>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>EDKB04_Single.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>EDKB04_Single.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common, Version=2.0.2972.16650, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\Common.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
</ItemGroup>
<ItemGroup>
<Compile Include="clsconnectionprovider.vb" />
<Compile Include="clsParameter.vb" />
<Compile Include="DBHandling.vb" />
<Compile Include="db_connection.vb" />
<Compile Include="ErrorStopper.vb" />
<Compile Include="Globals.vb" />
<Compile Include="log.vb" />
<Compile Include="Module1.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Stammdaten.vb" />
<Compile Include="XMLHandling.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="parameter.cfg" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,34 @@
Public Class ErrorStopper
Private nb_events As Integer = 0
Private nb_seconds As Integer = 0
Private myStack As ArrayList
Public Function insert() As Boolean
Dim result As Boolean = True
'Neues Element rein
Dim new_el As New DateTime
new_el = Now()
myStack.Add(new_el)
'Alte löschen
Dim check_el As DateTime
Dim i As Integer = myStack.Count
Do While i > 0
check_el = myStack.Item(0)
If DateAdd(DateInterval.Second, nb_seconds, check_el) < Now() Then
myStack.RemoveAt(0)
End If
i = i - 1
Loop
'Check ob Menge überschritten
If myStack.Count >= nb_events Then result = False
Return result
End Function
Public Sub init(ByVal numberOfEvents As Integer, ByVal periodInSeconds As Integer)
Me.nb_events = numberOfEvents
Me.nb_seconds = periodInSeconds
Me.myStack = New ArrayList
End Sub
End Class

View File

@@ -0,0 +1,37 @@
Imports System.Reflection
Imports System.IO
Module Globals
Public Applikationsdaten As DataTable
Public AppldataRow As Integer
Public sConnectionString_edoka As String
Public sConnectionString_journale As String
Public sConnectionString_tgdata As String
Public args As String() = Environment.GetCommandLineArgs()
Public Params As New ClsParameter()
Public conn_edoka As New edokadb.clsConnectionProvider()
Public conn_journale As New edokadb.clsConnectionProvider()
Public conn_tgdata As New edokadb.clsConnectionProvider()
Public Fehler As Integer = 0
Public Warning As Integer = 0
Public DokumentID As String
Public ColdDokumentID As String
Public KeyNr As Long
Public ofile As System.IO.File
Public oread As System.IO.StreamReader
'NEU
Public appPath As String = Path.GetDirectoryName([Assembly].GetEntryAssembly().Location) + "\"
#Region "BMS"
Public m_log As New log
#End Region
End Module

View File

@@ -0,0 +1,191 @@
Imports System.Timers
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Xml
Imports System.Data.SqlClient
Imports System.IO
Imports System.Reflection
Module Module1
Dim WithEvents tmrQueuePolling As Timer = New Timer(2000)
Dim myStopper As ErrorStopper
Sub Main()
Try
Dim FileWatch As New FileSystemWatcher()
'init BMS
'Init Params
Params.Loadparameters()
'Init File Watcher
FileWatch.Path = Params.Watchdir
FileWatch.IncludeSubdirectories = False
FileWatch.Filter = "*.xml"
AddHandler FileWatch.Created, New FileSystemEventHandler(AddressOf OnFileEvent)
FileWatch.EnableRaisingEvents = True
Files_Abfackeln()
'init DB-Connection
Dim sconnection = New DB_Connection()
'init Timer
If CInt(Params.TimerInterval) > 0 Then
tmrQueuePolling.Start()
Else
tmrQueuePolling.Enabled = False
End If
'Init Error Stopper
Catch ex As Exception
MsgBox(ex.Message)
''m_log.log(ex.Message, Common.Common.JournalEntryType.Error)
Exit Sub
End Try
End Sub
Private Sub OnFileEvent(ByVal source As Object, ByVal e As FileSystemEventArgs)
Try
Threading.Thread.Sleep(2000)
Dim di As New IO.DirectoryInfo(Params.Watchdir)
Dim diar1 As IO.FileInfo() = di.GetFiles("*.xml")
Dim dra As IO.FileInfo
Dim data As String
For Each dra In diar1
Dim fil As New StreamReader(dra.FullName)
data = fil.ReadToEnd()
fil.Close()
''m_log.Log("EDKB04: read File OK", Common.Common.JournalEntryType.Information)
Dim newending As String = ".err"
Dim filetimestamp As String = Format(Now, "yyyyMMddHHmmssffff")
If XMLtoObj(data) = True Then
If DBImport() = True Then
newending = ".xml"
Else
newending = ".err"
End If
End If
If Params.DebugMode Then
'moven
File.Move(dra.FullName, Params.DebugDir & filetimestamp & newending)
Else
'deleten
File.Delete(dra.FullName)
End If
Next
Catch ex As Exception
'm_log.Log("EDKB04: FileWatcher Error: " & ex.Message, Common.Common.JournalEntryType.Error)
End Try
End Sub
Private Sub Files_Abfackeln()
Try
Dim di As New IO.DirectoryInfo(Params.Watchdir)
Dim diar1 As IO.FileInfo() = di.GetFiles("*.xml")
Dim dra As IO.FileInfo
Dim data As String
For Each dra In diar1
Dim fil As New StreamReader(dra.FullName)
data = fil.ReadToEnd()
fil.Close()
''m_log.Log("EDKB04: read File OK", Common.Common.JournalEntryType.Information)
Dim newending As String = ".err"
Dim filetimestamp As String = Format(Now, "yyyyMMddHHmmssffff")
If XMLtoObj(data) = True Then
If DBImport() = True Then
newending = ".xml"
Else
newending = ".err"
End If
End If
If Params.DebugMode Then
'moven
Try
File.Move(dra.FullName, Params.DebugDir & filetimestamp & newending)
Catch
End Try
Else
'deleten
'File.Delete(dra.FullName)
End If
Next
Catch ex As Exception
MsgBox(ex.Message)
''m_log.log("EDKB04: FileWatcher Error: " & ex.Message, Common.Common.JournalEntryType.Error)
End Try
End Sub
Private Function DBImport() As Boolean
'---------------Import in DB--------------
Dim result As Boolean
''m_log.Log("EDKB04: DB Abgleich START", Common.Common.JournalEntryType.Information)
result = DBHandling.Init(XMLHandling.Stamm1)
'Transformation starten
If result Then
result = Stamm1.Transform
End If
If result And XMLHandling.Stamm1.HasPartnerNat Then
result = DBHandling.partnerNat()
End If
If result And XMLHandling.Stamm1.HasPartnerJur Then
result = DBHandling.partnerJur()
End If
If result And XMLHandling.Stamm1.HasHauptadresse Then
result = DBHandling.partnerHauptadresse()
End If
If result And XMLHandling.Stamm1.HasVersandadresse Then
result = DBHandling.partnerVersandadresse()
End If
If result And XMLHandling.Stamm1.HasMitarbeiter Then
result = DBHandling.Mitarbeiter()
End If
If result And XMLHandling.Stamm1.HasVV Then
result = DBHandling.VV()
End If
If result Then
''m_log.Log("EDKB04: DB Abgleich ENDE", Common.Common.JournalEntryType.Information)
Else
End If
Return result
End Function
Private Function XMLtoObj(ByVal strXMLContent As String) As Boolean
Dim result As Boolean
Try
''m_log.Log("EDKB04: Lese XML String in Objekt", Common.Common.JournalEntryType.Information)
result = XMLHandling.Load(strXMLContent)
''m_log.Log("EDKB04: Lese XML String in Objekt ENDE", Common.Common.JournalEntryType.Information)
Catch ex As Exception
'm_log.Log("EDKB04: Error bei XML->Obj: " & ex.Message, Common.Common.JournalEntryType.Error)
result = False
End Try
Return result
End Function
Private Function ReadfromMQ() As Boolean
Return True
End Function
Private Function writeDebug(ByVal xmlstring As String) As Boolean
Dim result As Boolean = True
Try
Dim writer As System.IO.StreamWriter
Dim filetimestamp As String = Format(Now, "yyyyMMddHHmmssffff")
writer = IO.File.AppendText(Params.DebugDir & filetimestamp & ".xml")
writer.WriteLine(xmlstring)
writer.Close()
Catch ex As Exception
result = False
End Try
Return result
End Function
End Module

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:2.0.50727.5466
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>2</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' Allgemeine Informationen über eine Assembly werden über die folgenden
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
' die mit einer Assembly verknüpft sind.
' Die Werte der Assemblyattribute überprüfen
<Assembly: AssemblyTitle("EDKB04_Single")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Stefan Hutter Unternehmensberatung")>
<Assembly: AssemblyProduct("EDKB04_Single")>
<Assembly: AssemblyCopyright("Copyright © Stefan Hutter Unternehmensberatung 2008")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
<Assembly: Guid("5ee1ce04-b744-46d7-bf12-39966a3cc1ef")>
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'
' Hauptversion
' Nebenversion
' Buildnummer
' Revision
'
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:2.0.50727.5466
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EDKB04_Single.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace

View File

@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:2.0.50727.5466
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings)
#Region "Funktion zum automatischen Speichern von My.Settings"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.EDKB04_Single.My.MySettings
Get
Return Global.EDKB04_Single.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,177 @@
Imports System.IO
Imports System.Xml
Imports System.Xml.Schema
Module XMLHandling
#Region "Members"
Private _validationSuccess As Boolean
#End Region
Public Stamm1 As Stammdaten
#Region "Public Functions"
Public Function Load(ByVal strData As String) As Boolean
Dim result As Boolean = True
Try
'----Read Data----
If result Then
Dim doc As New XmlDocument()
doc.LoadXml(strData)
Stamm1 = New Stammdaten
If Not (Stamm1.fill(doc)) Then
m_log.Log("EDKB04: Fehler beim Einlesen des XML", Common.Common.JournalEntryType.Error)
result = False
End If
End If
'----VALIDIERUNG----
If result Then
'm_log.Log("EDKB04: Validierung START", Common.Common.JournalEntryType.Information)
'-----HEADER-----
If Not Stamm1.HasResultHeader Then
result = False
m_log.Log("EDKB04: Kein ResultHeader in XML vorhanden", Common.Common.JournalEntryType.Error)
End If
'-----PartnerNAT-----
If result And Stamm1.HasPartnerNat Then
If Stamm1._ResultContent._partnerNat._partnerNummer = "" Then
Stamm1.HasPartnerNat = False
result = False
m_log.Log("EDKB04: Fehler in PartnerNat, keine Partnernummer", Common.Common.JournalEntryType.Error)
End If
End If
'-----PartnerJUR-----
If result And Stamm1.HasPartnerJur Then
If Stamm1._ResultContent._partnerJur._partnerNummer = "" Then
Stamm1.HasPartnerJur = False
result = False
m_log.Log("EDKB04: Fehler in PartnerJur, keine Partnernummer", Common.Common.JournalEntryType.Error)
End If
End If
'-----PartnerHauptadresse-----
If result And Stamm1.HasHauptadresse Then
If Stamm1._ResultContent._hauptAdresse._objektRefNr = "" Then
Stamm1.HasHauptadresse = False
result = False
m_log.Log("EDKB04: Fehler in Hauptadresse, keine Partnernummer", Common.Common.JournalEntryType.Error)
End If
End If
'-----Versandadresse-----
If result And Stamm1.HasVersandadresse Then
If Stamm1._ResultContent._versandAdresse._objektRefNr = "" Then
Stamm1.HasVersandadresse = False
result = False
m_log.Log("EDKB04: Fehler in VersandAdresse, keine Partnernummer", Common.Common.JournalEntryType.Error)
End If
If result And Stamm1._ResultContent._versandAdresse._objektNr = "" Then
Stamm1.HasVersandadresse = False
result = False
m_log.Log("EDKB04: Fehler in VersandAdresse, keine objektNr (Bezug zu Partnernummer Versandadresse)", Common.Common.JournalEntryType.Error)
End If
End If
'-----Mitarbeiter-----
'-----VV-----
If result And Stamm1.HasVV Then
If Stamm1._ResultContent._vv._PartnerNummer = "" Then
Stamm1.HasVV = False
result = False
m_log.Log("EDKB04: Fehler in VV, keine Partnernummer", Common.Common.JournalEntryType.Error)
End If
End If
If result Then
'm_log.Log("EDKB04: Validierung ENDE OK", Common.Common.JournalEntryType.Information)
Else
m_log.Log("EDKB04: Validierung ENDE NOK", Common.Common.JournalEntryType.Error)
End If
End If
Catch ex As Exception
m_log.Log("EDKB04: Error Load: " & ex.Message, Common.Common.JournalEntryType.Error)
result = False
End Try
Return result
End Function
#End Region
#Region "Private Functions"
Private Function IsValid(ByVal xmlImportFile As FileInfo) As Boolean
Try
'First we create the xmltextreader
Dim reader As New XmlTextReader(xmlImportFile.FullName)
'We pass the xmltextreader into the xmlvalidatingreader
'This will validate the xml doc with the schema file
'NOTE the xml file it self points to the schema file
Dim validator As New XmlValidatingReader(reader)
' Set the validation event handler
AddHandler validator.ValidationEventHandler, _
AddressOf ValidationCallback
_validationSuccess = True 'make sure to reset the success var
' Read XML data
While (validator.Read)
End While
'Close the reader.
validator.Close()
reader.Close()
'The validationeventhandler is the only thing that would
'set m_Success to false
Return _validationSuccess
Catch ex As Exception
_validationSuccess = False
Return _validationSuccess
'Throw ex
End Try
End Function
Private Function IsValid(ByVal strData As String) As Boolean
Try
'First we create the xmltextreader
Dim reader As New XmlTextReader(strData)
'We pass the xmltextreader into the xmlvalidatingreader
'This will validate the xml doc with the schema file
'NOTE the xml file it self points to the schema file
Dim validator As New XmlValidatingReader(reader)
' Set the validation event handler
AddHandler validator.ValidationEventHandler, _
AddressOf ValidationCallback
_validationSuccess = True 'make sure to reset the success var
' Read XML data
While (validator.Read)
End While
'Close the reader.
validator.Close()
reader.Close()
'The validationeventhandler is the only thing that would
'set m_Success to false
Return _validationSuccess
Catch ex As Exception
_validationSuccess = False
Return _validationSuccess
'Throw ex
End Try
End Function
Private Sub ValidationCallback(ByVal sender As Object, ByVal args As ValidationEventArgs)
Try
'Display the validation error. This is only called on error
_validationSuccess = False 'Validation failed
m_log.Log("EDKB04: Validation error: " + args.Message + Environment.NewLine, Common.Common.JournalEntryType.Error)
Catch ex As Exception
Throw ex
End Try
End Sub
#End Region
End Module

View File

@@ -0,0 +1,215 @@
Public Class ClsParameter
#Region "Deklarationen"
Dim p_MQHostname As String
Public Property MQHostname() As String
Get
Return p_MQHostname
End Get
Set(ByVal value As String)
p_MQHostname = value
End Set
End Property
Dim p_MQPort As String
Public Property MQPort() As String
Get
Return p_MQPort
End Get
Set(ByVal value As String)
p_MQPort = value
End Set
End Property
Dim p_MQChannel As String
Public Property MQChannel() As String
Get
Return p_MQChannel
End Get
Set(ByVal value As String)
p_MQChannel = value
End Set
End Property
Dim p_MQQueueName As String
Public Property MQQueueName() As String
Get
Return p_MQQueueName
End Get
Set(ByVal value As String)
p_MQQueueName = value
End Set
End Property
Dim p_SqlTimeout As String
Public Property SqlTimeout() As String
Get
Return p_SqlTimeout
End Get
Set(ByVal value As String)
p_SqlTimeout = value
End Set
End Property
Dim p_CDMuter As String
Public Property CDMuter() As String
Get
Return p_CDMuter
End Get
Set(ByVal value As String)
p_CDMuter = value
End Set
End Property
Dim p_MuterNr As String
Public Property MuterNr() As String
Get
Return p_MuterNr
End Get
Set(ByVal value As String)
p_MuterNr = value
End Set
End Property
Dim p_Watchdir As String
Public Property Watchdir() As String
Get
Return p_Watchdir
End Get
Set(ByVal value As String)
p_Watchdir = value
End Set
End Property
Dim p_TimerInterval As String
Public Property TimerInterval() As String
Get
Return p_TimerInterval
End Get
Set(ByVal value As String)
p_TimerInterval = value
End Set
End Property
Dim p_LoopQueue As String
Public Property LoopQueue() As String
Get
Return p_LoopQueue
End Get
Set(ByVal value As String)
p_LoopQueue = value
End Set
End Property
Dim p_DebugMode As Boolean
Public Property DebugMode() As Boolean
Get
Return p_DebugMode
End Get
Set(ByVal value As Boolean)
p_DebugMode = value
End Set
End Property
Dim p_DebugDir As String
Public Property DebugDir() As String
Get
Return p_DebugDir
End Get
Set(ByVal value As String)
p_DebugDir = value
End Set
End Property
Dim p_DefaultBetreuerID As String
Public Property DefaultBetreuerID() As String
Get
Return p_DefaultBetreuerID
End Get
Set(ByVal value As String)
p_DefaultBetreuerID = value
End Set
End Property
Dim p_nb_errors As Integer
Public Property nb_errors() As Integer
Get
Return p_nb_errors
End Get
Set(ByVal value As Integer)
p_nb_errors = value
End Set
End Property
Dim p_nb_seconds As Integer
Public Property nb_seconds() As Integer
Get
Return p_nb_seconds
End Get
Set(ByVal value As Integer)
p_nb_seconds = value
End Set
End Property
Dim p_len_TXADZ As Integer
Public Property len_TXADZ() As Integer
Get
Return p_len_TXADZ
End Get
Set(ByVal value As Integer)
p_len_TXADZ = value
End Set
End Property
#End Region
Public Function Loadparameters() As String
Try
m_log.Log("EDKB04: Loading Parameters", Common.Common.JournalEntryType.Information)
oread = IO.File.OpenText(appPath & "parameter.cfg")
Me.p_MQHostname = ParamValue(oread.ReadLine)
Me.p_MQPort = ParamValue(oread.ReadLine)
Me.p_MQChannel = ParamValue(oread.ReadLine)
Me.p_MQQueueName = ParamValue(oread.ReadLine)
Me.p_SqlTimeout = ParamValue(oread.ReadLine)
Me.p_CDMuter = ParamValue(oread.ReadLine)
Me.p_MuterNr = ParamValue(oread.ReadLine)
Me.p_Watchdir = ParamValue(oread.ReadLine)
Me.p_TimerInterval = ParamValue(oread.ReadLine)
Me.p_LoopQueue = ParamValue(oread.ReadLine)
Me.p_DebugMode = CBool(ParamValue(oread.ReadLine))
Me.p_DebugDir = ParamValue(oread.ReadLine)
Me.p_DefaultBetreuerID = ParamValue(oread.ReadLine)
Try
Me.p_nb_errors = CInt(ParamValue(oread.ReadLine))
Catch ex As Exception
' Keine Zahl
Me.p_nb_errors = 999999
End Try
Try
Me.p_nb_seconds = CInt(ParamValue(oread.ReadLine))
Catch ex As Exception
'Keine Zahl
Me.p_nb_seconds = 1
End Try
Try
Me.p_len_TXADZ = CInt(ParamValue(oread.ReadLine))
Catch ex As Exception
'Keine Zahl
Me.p_len_TXADZ = 35
End Try
oread.Close()
m_log.Log("EDKB04: Loading Parameters Ended", Common.Common.JournalEntryType.Information)
Return ""
Catch ex As Exception
m_log.Log("EDKB04: Error Loading Params: " & ex.Message, Common.Common.JournalEntryType.Error)
Return ex.Message
End Try
End Function
Private Function ParamValue(ByVal sinput As String) As String
Dim splitter() As String
splitter = Split(sinput, "=")
ParamValue = splitter(1)
End Function
End Class

View File

@@ -0,0 +1,289 @@
' ///////////////////////////////////////////////////////////////////////////
' // Description: Connection Provider class for Database connection sharing
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:25
' // This class implements IDisposable.
' ///////////////////////////////////////////////////////////////////////////
Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Namespace edokadb
' /// <summary>
' /// Purpose: provides a SqlConnection object which can be shared among data-access tier objects
' /// to provide a way to do ADO.NET transaction coding without the hassling with SqlConnection objects
' /// on a high level.
' /// </summary>
Public Class clsConnectionProvider
Implements IDisposable
#Region " Class Member Declarations "
Private m_scoDBConnection As SqlConnection
Private m_bIsTransactionPending, m_bIsDisposed As Boolean
Private m_stCurrentTransaction As SqlTransaction
Private m_alSavePoints As ArrayList
#End Region
Public Sub New()
' // Init the class
InitClass()
End Sub
' /// <summary>
' /// Purpose: Implements the IDispose' method Dispose.
' /// </summary>
Public Overloads Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
' /// <summary>
' /// Purpose: Implements the Dispose functionality.
' /// </summary>
Protected Overridable Overloads Sub Dispose(ByVal bIsDisposing As Boolean)
' // Check to see if Dispose has already been called.
If Not m_bIsDisposed Then
If bIsDisposing Then
' // Dispose managed resources.
If Not (m_stCurrentTransaction Is Nothing) Then
m_stCurrentTransaction.Dispose()
m_stCurrentTransaction = Nothing
End If
If Not (m_scoDBConnection Is Nothing) Then
' // closing the connection will abort (rollback) any pending transactions
m_scoDBConnection.Close()
m_scoDBConnection.Dispose()
m_scoDBConnection = Nothing
End If
End If
End If
m_bIsDisposed = True
End Sub
' /// <summary>
' /// Purpose: Initializes class members.
' /// </summary>
Private Sub InitClass()
' // Create all the objects and initialize other members.
m_scoDBConnection = New SqlConnection()
m_bIsDisposed = False
m_stCurrentTransaction = Nothing
m_bIsTransactionPending = False
m_alSavePoints = New ArrayList()
End Sub
' /// <summary>
' /// Purpose: Opens the connection object.
' /// </summary>
' /// <returns>True, if succeeded, otherwise an Exception exception is thrown.</returns>
Public Function OpenConnection() As Boolean
Try
If (m_scoDBConnection.State And ConnectionState.Open) > 0 Then
' // It's already open.
Throw New Exception("OpenConnection::Connection is already open.")
End If
m_scoDBConnection.Open()
m_bIsTransactionPending = False
m_alSavePoints.Clear()
Return True
Catch ex As Exception
' // bubble exception
Throw ex
End Try
End Function
' /// <summary>
' /// Purpose: Starts a new ADO.NET transaction using the open connection object of this class.
' /// </summary>
' /// <param name="sTransactionName">Name of the transaction to start</param>
' /// <returns>True, if transaction is started correctly, otherwise an Exception exception is thrown</returns>
Public Function BeginTransaction(ByVal sTransactionName As String) As Boolean
Try
If m_bIsTransactionPending Then
' // no nested transactions allowed.
Throw New Exception("BeginTransaction::Already transaction pending. Nesting not allowed")
End If
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
' // no open connection
Throw New Exception("BeginTransaction::Connection is not open.")
End If
' // begin the transaction and store the transaction object.
m_stCurrentTransaction = m_scoDBConnection.BeginTransaction(IsolationLevel.ReadCommitted, sTransactionName)
m_bIsTransactionPending = True
Return True
Catch ex As Exception
' // bubble exception
Throw ex
End Try
End Function
' /// <summary>
' /// Purpose: Commits a pending transaction on the open connection object of this class.
' /// </summary>
' /// <returns>True, if commit was succesful, or an Exception exception is thrown</returns>
Public Function CommitTransaction() As Boolean
Try
If Not m_bIsTransactionPending Then
' // no transaction pending
Throw New Exception("CommitTransaction::No transaction pending.")
End If
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
' // no open connection
Throw New Exception("CommitTransaction::Connection is not open.")
End If
' // commit the transaction
m_stCurrentTransaction.Commit()
m_bIsTransactionPending = False
m_stCurrentTransaction.Dispose()
m_stCurrentTransaction = Nothing
m_alSavePoints.Clear()
Return True
Catch ex As Exception
' // bubble exception
Throw ex
End Try
End Function
' /// <summary>
' /// Purpose: Rolls back a pending transaction on the open connection object of this class,
' /// or rolls back to the savepoint with the given name. Savepoints are created with SaveTransaction().
' /// </summary>
' /// <param name="sTransactionToRollback">Name of transaction to roll back. Can be name of savepoint</param>
' /// <returns>True, if rollback was succesful, or an Exception exception is thrown</returns>
Public Function RollbackTransaction(ByVal sTransactionToRollback As String) As Boolean
Try
If Not m_bIsTransactionPending Then
' // no transaction pending
Throw New Exception("RollbackTransaction::No transaction pending.")
End If
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
' // no open connection
Throw New Exception("RollbackTransaction::Connection is not open.")
End If
' // rollback the transaction
m_stCurrentTransaction.Rollback(sTransactionToRollback)
' // if this wasn't a savepoint, we've rolled back the complete transaction, so we
' // can clean it up.
If Not m_alSavePoints.Contains(sTransactionToRollback) Then
' // it's not a savepoint
m_bIsTransactionPending = False
m_stCurrentTransaction.Dispose()
m_stCurrentTransaction = Nothing
m_alSavePoints.Clear()
End If
Return True
Catch ex As Exception
' // bubble exception
Throw ex
End Try
End Function
' /// <summary>
' /// Purpose: Saves a pending transaction on the open connection object of this class to a 'savepoint'
' /// with the given name.
' /// When a rollback is issued, the caller can rollback to this savepoint or roll back the complete transaction.
' /// </summary>
' /// <param name="sSavePointName">Name of the savepoint to store the current transaction under.</param>
' /// <returns>True, if save was succesful, or an Exception exception is thrown</returns>
Public Function SaveTransaction(ByVal sSavePointName As String) As Boolean
Try
If Not m_bIsTransactionPending Then
' // no transaction pending
Throw New Exception("SaveTransaction::No transaction pending.")
End If
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
' // no open connection
Throw New Exception("SaveTransaction::Connection is not open.")
End If
' // save the transaction
m_stCurrentTransaction.Save(sSavePointName)
' // Store the savepoint in the list.
m_alSavePoints.Add(sSavePointName)
Return True
Catch ex As Exception
' // bubble exception
Throw ex
End Try
End Function
' /// <summary>
' /// Purpose: Closes the open connection. Depending on bCommitPendingTransactions, a pending
' /// transaction is commited, or aborted.
' /// </summary>
' /// <param name="bCommitPendingTransaction">Flag for what to do when a transaction is still pending. True
' /// will commit the current transaction, False will abort (rollback) the complete current transaction.</param>
' /// <returns>True, if close was succesful, False if connection was already closed, or an Exception exception is thrown when
' /// an error occurs</returns>
Public Function CloseConnection(ByVal bCommitPendingTransaction As Boolean) As Boolean
Try
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
' // No open connection
Return False
End If
If m_bIsTransactionPending Then
If bCommitPendingTransaction Then
' // Commit the pending transaction
m_stCurrentTransaction.Commit()
Else
' // Rollback the pending transaction
m_stCurrentTransaction.Rollback()
End If
m_bIsTransactionPending = False
m_stCurrentTransaction.Dispose()
m_stCurrentTransaction = Nothing
m_alSavePoints.Clear()
End If
' // close the connection
m_scoDBConnection.Close()
Return True
Catch ex As Exception
' // bubble exception
Throw ex
End Try
End Function
#Region " Class Property Declarations "
Public ReadOnly Property stCurrentTransaction() As SqlTransaction
Get
Return m_stCurrentTransaction
End Get
End Property
Public ReadOnly Property bIsTransactionPending() As Boolean
Get
Return m_bIsTransactionPending
End Get
End Property
Public ReadOnly Property scoDBConnection() As SqlConnection
Get
Return m_scoDBConnection
End Get
End Property
Public WriteOnly Property sConnectionString() As String
Set(ByVal Value As String)
m_scoDBConnection.ConnectionString = Value
End Set
End Property
#End Region
End Class
End Namespace

View File

@@ -0,0 +1,36 @@
Imports System.ComponentModel
Imports Microsoft.VisualBasic
Public Class DB_Connection
Shared Sub New()
Try
'Edoka
oread = IO.File.OpenText(appPath + "edokaconn.cfg")
sConnectionString_edoka = oread.ReadLine
Globals.sConnectionString_edoka = sConnectionString_edoka
oread.Close()
'Journale
oread = IO.File.OpenText(appPath + "journaleconn.cfg")
sConnectionString_journale = oread.ReadLine
Globals.sConnectionString_journale = sConnectionString_journale
oread.Close()
''tgdata
'oread = IO.File.OpenText(appPath + "tgdataconn.cfg")
'sConnectionString_tgdata = oread.ReadLine
'Globals.sConnectionString_tgdata = sConnectionString_tgdata
'oread.Close()
Globals.conn_edoka.sConnectionString = sConnectionString_edoka
Globals.conn_journale.sConnectionString = sConnectionString_journale
'Globals.conn_tgdata.sConnectionString = sConnectionString_tgdata
m_log.Log("EDKB04: DB-Connection OK", Common.Common.JournalEntryType.Information)
Catch ex As Exception
m_log.Log(ex.Message, Common.Common.JournalEntryType.Error)
End Try
End Sub
End Class

View File

@@ -0,0 +1,5 @@
Public Class log
Public Function log(ByVal Logentry As String, ByVal logtype As Integer)
End Function
End Class

View File

@@ -0,0 +1,15 @@
MQHostname =vb0049d
MQPort =1416
MQChannel =TGKB.D16.EDOKA.CL
MQQueueName =test
SqlTimeOut =500000
CDMUTER =EDKB04
MuterNr =9996
WatchDir =D:\EDOKA\EDKB04\Input\
TimerIntervall =0
Loop =false
Debugmode =false
DebugDir =D:\EDOKA\EDKB04\Input\archiv\
DefaultBetreuerID =1166755
nb_Errors =10
nb_seconds =10