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 @@
<?xml version="1.0" encoding="utf-8"?><Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><DontShowAgainInSolution>false</DontShowAgainInSolution></Configuration>

View File

@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDKB04OP_Batch", "EDKB04OP_Batch\EDKB04OP_Batch.vbproj", "{24DD3BBD-3615-4CCB-8BB8-E70A88328DB8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{24DD3BBD-3615-4CCB-8BB8-E70A88328DB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24DD3BBD-3615-4CCB-8BB8-E70A88328DB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24DD3BBD-3615-4CCB-8BB8-E70A88328DB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24DD3BBD-3615-4CCB-8BB8-E70A88328DB8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{24DD3BBD-3615-4CCB-8BB8-E70A88328DB8}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>EDKB04OP_Batch.Module1</StartupObject>
<RootNamespace>EDKB04OP_Batch</RootNamespace>
<AssemblyName>EDKB04OP_Batch</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Console</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>EDKB04OP_Batch.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>EDKB04OP_Batch.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="amqmdnet">
<HintPath>..\..\EDKB04_V18\EDKB04_V18\EDKB04\bin\Debug\amqmdnet.dll</HintPath>
</Reference>
<Reference Include="BMS">
<HintPath>..\..\EDKB04_V18\EDKB04_V18\EDKB04\bin\Debug\BMS.dll</HintPath>
</Reference>
<Reference Include="Common">
<HintPath>..\..\EDKB04_V18\EDKB04_V18\EDKB04\bin\Debug\Common.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</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" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="clsconnectionprovider.vb" />
<Compile Include="clsParameter.vb" />
<Compile Include="db_connection.vb" />
<Compile Include="ErrorStopper.vb" />
<Compile Include="Globals.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="xmlHandling.vb" />
<Compile Include="XMLHelper.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>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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,48 @@
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
'test
'NEU
Public appPath As String = Path.GetDirectoryName([Assembly].GetEntryAssembly().Location) + "\"
#Region "BMS"
'Public m_log As bms.Logging
Public m_log As New log
Public Class log
Function log(ByVal msg As String, Optional type As Integer = 0)
End Function
End Class
#End Region
End Module

View File

@@ -0,0 +1,68 @@
Imports System.Timers
Imports IBM.WMQ
Imports System.ServiceProcess
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Xml
Imports System.Data.SqlClient
Imports System.IO
Imports System.Reflection
Module Module1
#Region "Log"
Private Sub WriteLog(ByVal stext As String, ByVal sPfad As String)
Try
Dim FiStr As FileStream = New FileStream(sPfad, FileMode.Append)
Dim StrWr As StreamWriter = New StreamWriter(FiStr)
StrWr.WriteLine("Fehler: " + Now() & " Text:" & stext)
StrWr.Close()
Catch ex As Exception
End Try
End Sub
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
m_log.Log("EDKB04: Error beim Abspeichern der Debug .xml Daten")
result = False
End Try
Return result
End Function
#End Region
Dim data As String
Sub Main()
Params.Loadparameters()
Dim sconnection = New DB_Connection()
Dim fil As New StreamReader("D:\EDK_Files\EDKB04_Daten\Loan Stammdaten.xml")
data = fil.ReadToEnd()
fil.Close()
XMLtoObj(data)
End Sub
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)
Dim xmlh As New xmlHandling(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
End Module

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34014
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </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("EDKB04OP_Batch")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("EDKB04OP_Batch")>
<Assembly: AssemblyCopyright("Copyright © 2014")>
<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("44e193b9-39e8-455f-a95f-b1d7aa1e3370")>
' 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,62 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34014
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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>
''' Returns the cached ResourceManager instance used by this class.
'''</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("EDKB04OP_Batch.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set(ByVal value As Global.System.Globalization.CultureInfo)
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>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34014
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </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", "11.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 "My.Settings Auto-Save Functionality"
#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.EDKB04OP_Batch.My.MySettings
Get
Return Global.EDKB04OP_Batch.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

Binary file not shown.

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@@ -0,0 +1,305 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
EDKB04OP_Batch
</name>
</assembly>
<members>
<member name="M:EDKB04OP_Batch.XmlHelper.GetAttributeValue(System.Xml.XmlNode@,System.String,System.String@)">
-----------------------------------------------------------------------------
<summary>
Gets the value from an attribute at the specified node.
</summary>
<param name="node">The XmlNode from which this method will get the value of an attribute.</param>
<param name="attributeName">Name of the attribute that will be read.</param>
<param name="value">Attribute value read by this method</param>
<returns>True if node is found and value is retrieved successfully.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetAttributeValue(System.Xml.XmlNode@,System.String,System.Int32@)">
-----------------------------------------------------------------------------
<summary>
Gets the value from an attribute at the specified node.
</summary>
<param name="node">The XmlNode from which this method will get the value of an attribute.</param>
<param name="attributeName">Name of the attribute that will be read.</param>
<param name="value">Attribute value read by this method</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetAttributeValue(System.Xml.XmlNode@,System.String,System.UInt32@)">
-----------------------------------------------------------------------------
<summary>
Gets the value from an attribute at the specified node.
</summary>
<param name="node">The XmlNode from which this method will get the value of an attribute.</param>
<param name="attributeName">Name of the attribute that will be read.</param>
<param name="value">Attribute value read by this method</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.SetAttributeValue(System.Xml.XmlNode@,System.String,System.String)">
-----------------------------------------------------------------------------
<summary>
Sets the value of an attribute for a given XmlNode.
</summary>
<param name="node">XmlNode whose attribute will be set.</param>
<param name="attributeName">Name of the attribute to set.</param>
<param name="value">Value to be set</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.SetAttributeValue(System.Xml.XmlNode@,System.String,System.Int32)">
-----------------------------------------------------------------------------
<summary>
Sets the value of an attribute for a given XmlNode.
</summary>
<param name="node">XmlNode whose attribute will be set.</param>
<param name="attributeName">Name of the attribute to set.</param>
<param name="value">Value to be set</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.SetAttributeValue(System.Xml.XmlNode@,System.String,System.UInt32)">
-----------------------------------------------------------------------------
<summary>
Sets the value of an attribute for a given XmlNode.
</summary>
<param name="node">XmlNode whose attribute will be set.</param>
<param name="attributeName">Name of the attribute to set.</param>
<param name="value">Value to be set</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetDataTable(System.Xml.XmlNodeList@)">
-----------------------------------------------------------------------------
<summary>s
Converts a list of Xml nodes to a DataTable.
</summary>
<param name="nodelist">List of Xml nodes</param>
<returns>DataTable</returns>
<remarks>
This method convert
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetDataTable(System.Xml.XmlNodeList,System.String,System.Boolean)">
-----------------------------------------------------------------------------
<summary>
Converts a list of Xml nodes to a DataTable and sets one of the columns as a primary key.
</summary>
<param name="nodelist"></param>
<param name="primaryKeyColumn"></param>
<param name="autoIncrement"></param>
<returns></returns>
<remarks>
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.UpdateChildNodesWithDataTable(System.Xml.XmlNode,System.Data.DataTable,System.String)">
-----------------------------------------------------------------------------
<summary>
Updates the child nodes of "parentNode" by using the fields from a datatable.
</summary>
<param name="parentNode"></param>
<param name="table"></param>
<param name="keyField"></param>
<remarks>
The child nodes that will be updated must have attribute fields that correspond to
the DataTable. The "keyField" will be used to identify the attribute that serves as
an identifier of the rows. The datatable can have less fields than the nodes so
you have the chance to update smaller subsets.
Make sure that you did not call "AcceptChanges" before passing the datatable or this
function will not find any change.
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.NodeToString(System.Xml.XmlNode@)">
-----------------------------------------------------------------------------
<summary>
Returns contents of an XmlNode in a string.
</summary>
<param name="node">The XmlNode whose contents will be read into a string.</param>
<returns>Xml formatted string with contents of "node" parameter.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.NodeListToString(System.Xml.XmlNodeList)">
-----------------------------------------------------------------------------
<summary>
Convert a XmlNodeList to string
</summary>
<param name="nodeList"></param>
<returns></returns>
<remarks>
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.DocumentToString(System.Xml.XmlDocument@)">
-----------------------------------------------------------------------------
<summary>
Method to convert a XmlDocument to string.
</summary>
<param name="xmlDoc">XmlDocument that will be converted to string.</param>
<returns>A xml formatted string.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String)">
<summary>
Inserts an empty record at the bottom of the hierarchy, creating the
tree as required.
</summary>
<param name="doc">The XmlDocument to which the node will be inserted.</param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<returns>The XmlNode inserted into the hierarchy.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.String[],System.String[])">
<summary>
Inserts an record with a multiple fields at the bottom of the hierarchy.
</summary>
<param name="doc">The XmlDocument to which the node will be inserted.</param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="fields">The attribute names that will be created for the node inserted.</param>
<param name="values">The corresponding value of each field.</param>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.String,System.String)">
<summary>
Inserts a record with a single field at the bottom of the hierarchy.
</summary>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="field">The field to add to the record.</param>
<param name="val">The value assigned to the field.</param>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.Data.DataRow)">
<summary>
Inserts a record with multiple fields at bottom of the hierarchy.
</summary>
<param name="doc"></param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="rowValues">The DataRow values that will be added as attributes.</param>
<remarks>
The columns names of the DataRow will become the attribute names and
the row values of the DataRow will be the attribute values.
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.String,System.String[])">
<summary>
Inserts a record with multiple values at bottom of hierarchy. This is analogous to inserting
a column of data.
</summary>
<param name="doc"></param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="field">Name of the attribute to be created at node inserted.</param>
<param name="values">Values that will be inserted that correspond to the field name.</param>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Update(System.Xml.XmlDocument,System.String,System.String,System.String)">
<summary>
Update a single field in all records in the specified path.
</summary>
<param name="doc">The XmlDocument whose node will be udpated.</param>
<param name="xpath">The xml path.</param>
<param name="field">The field name to update.</param>
<param name="val">The new value.</param>
<returns>The number of records affected.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to update an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Delete(System.Xml.XmlDocument,System.String)">
<summary>
Deletes all records of the specified path.
</summary>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<returns>The number of records deleted.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.QueryScalar(System.Xml.XmlDocument,System.String,System.String)">
<summary>
Return a single string representing the value of the specified field
for the first record encountered.
</summary>
<param name="xpath">The xml path.</param>
<param name="field">The desired field.</param>
<returns>A string with the field's value or null.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Query(System.Xml.XmlDocument,System.String)">
<summary>
Returns a DataTable for all rows on the path.
</summary>
<param name="xpath">The xml path.</param>
<returns>The DataTable with the returned rows.
The row count will be 0 if no rows returned.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.QueryField(System.Xml.XmlDocument,System.String,System.String)">
<summary>
Returns an array of values for the specified field for all rows on
the path.
</summary>
<param name="xpath">The xml path.</param>
<param name="field">The desired field.</param>
<returns>The array of string values for each row qualified by the path.
A null is returned if the query results in 0 rows.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.InsertNode(System.Xml.XmlNode,System.String[],System.Int32)">
<summary>
Inserts a node at the specified segment if it doesn't exist, otherwise
traverses the node.
</summary>
<param name="node">The current node.</param>
<param name="segments">The path segment list.</param>
<param name="idx">The current segment.</param>
<returns></returns>
</member><member name="M:EDKB04OP_Batch.XmlHelper.CreateColumns(System.Data.DataTable,System.Xml.XmlNode)">
<summary>
Creates columns given an XmlNode.
</summary>
<param name="dt">The target DataTable.</param>
<param name="node">The source XmlNode.</param>
</member><member name="P:EDKB04OP_Batch.My.Resources.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member><member name="P:EDKB04OP_Batch.My.Resources.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member><member name="T:EDKB04OP_Batch.My.Resources.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1 @@
¹µÈ¦rȽ¹¿¸ª‰¿­Çx…½³»É·¥¹u¨­À¦¾·¼¥¾©¿È®¿ÀeÅ­¸ÉÆ®ÆÎn­»»´¦¾»ºË´ÄÀÁ¸®É®»ºe»¬Ä¦µÀ³¸mȮƱ†xŽŠºÅºÀd¶¹¿­€Â©ÈÇ˴ĹnÀ½º~…€

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<config>
<!-- The maximum duration a start job can take before a starter error occures -->
<MaximumStartDuration>1</MaximumStartDuration>
<!-- Check interval in minutes for starter -->
<StartJobInterval>2</StartJobInterval>
<!-- Check interval in minutes for watcher -->
<WatchJobInterval>2</WatchJobInterval>
<!-- The number of Starter-Errors notifications should be activated until the job runs successful next time -->
<MaxStarterNotifications>2</MaxStarterNotifications>
<!-- The number of Watch-Errors notifications should be activated until the job runs successful next time -->
<MaxWatcherNotifications>3</MaxWatcherNotifications>
<!-- Name of the system event log where service should write his entries -->
<EventLogName>BMS</EventLogName>
<!-- The target where messages should be written to.
Valid log targets are:
- 1: System EventLog
- 2: Database EventLog table
-->
<LogTarget>1</LogTarget>
<!-- Mail Server to send eMails from BMS -->
<MailServer>server01</MailServer>
<!-- Mail sender name -->
<MailFrom>bms@tkb.ch</MailFrom>
<!-- Mail Server authentication method.
Valid methods are:
- 0: Anonymous
- 1: Basic Authentication (clear text authentication!)
-->
<MailServerAuth>
<Method>0</Method>
<UserName>mailUser</UserName>
<Password>mailPassword</Password>
</MailServerAuth>
</config>
</root>

View File

@@ -0,0 +1 @@
Data Source=shu00;Initial Catalog=edoka;Persist Security Info=False;workstation id =;packet size=4096;User ID=sa;Password=*shu29

View File

@@ -0,0 +1 @@
Data Source=shu00;Initial Catalog=edoka_journale;Persist Security Info=False;workstation id =;packet size=4096;User ID=sa;Password=*shu29

View File

@@ -0,0 +1,16 @@
MQHostname =vb0049d
MQPort =1416
MQChannel =TGKB.D16.EDOKA.CL
MQQueueName =test
SqlTimeOut =500000
CDMUTER =EDKB04
MuterNr =9996
WatchDir =C:\Data\EDKB04\
TimerIntervall =0
Loop =false
Debugmode =true
DebugDir =C:\Data\EDKB04\Archiv\
DefaultBetreuerID =1166755
nb_Errors =10
nb_seconds =10
len_TXADZ =35

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,12 @@
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\obj\Debug\EDKB04OP_Batch.vbprojResolveAssemblyReference.cache
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\obj\Debug\EDKB04OP_Batch.Resources.resources
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\obj\Debug\EDKB04OP_Batch.vbproj.GenerateResource.Cache
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\bin\Debug\EDKB04OP_Batch.exe
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\bin\Debug\EDKB04OP_Batch.pdb
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\bin\Debug\EDKB04OP_Batch.xml
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\bin\Debug\amqmdnet.dll
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\bin\Debug\BMS.dll
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\bin\Debug\Common.dll
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\obj\Debug\EDKB04OP_Batch.exe
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\obj\Debug\EDKB04OP_Batch.xml
E:\Software-Projekte\EDOKA\batch\EDKB04OP_Batch\EDKB04OP_Batch\obj\Debug\EDKB04OP_Batch.pdb

View File

@@ -0,0 +1,305 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
EDKB04OP_Batch
</name>
</assembly>
<members>
<member name="M:EDKB04OP_Batch.XmlHelper.GetAttributeValue(System.Xml.XmlNode@,System.String,System.String@)">
-----------------------------------------------------------------------------
<summary>
Gets the value from an attribute at the specified node.
</summary>
<param name="node">The XmlNode from which this method will get the value of an attribute.</param>
<param name="attributeName">Name of the attribute that will be read.</param>
<param name="value">Attribute value read by this method</param>
<returns>True if node is found and value is retrieved successfully.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetAttributeValue(System.Xml.XmlNode@,System.String,System.Int32@)">
-----------------------------------------------------------------------------
<summary>
Gets the value from an attribute at the specified node.
</summary>
<param name="node">The XmlNode from which this method will get the value of an attribute.</param>
<param name="attributeName">Name of the attribute that will be read.</param>
<param name="value">Attribute value read by this method</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetAttributeValue(System.Xml.XmlNode@,System.String,System.UInt32@)">
-----------------------------------------------------------------------------
<summary>
Gets the value from an attribute at the specified node.
</summary>
<param name="node">The XmlNode from which this method will get the value of an attribute.</param>
<param name="attributeName">Name of the attribute that will be read.</param>
<param name="value">Attribute value read by this method</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.SetAttributeValue(System.Xml.XmlNode@,System.String,System.String)">
-----------------------------------------------------------------------------
<summary>
Sets the value of an attribute for a given XmlNode.
</summary>
<param name="node">XmlNode whose attribute will be set.</param>
<param name="attributeName">Name of the attribute to set.</param>
<param name="value">Value to be set</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.SetAttributeValue(System.Xml.XmlNode@,System.String,System.Int32)">
-----------------------------------------------------------------------------
<summary>
Sets the value of an attribute for a given XmlNode.
</summary>
<param name="node">XmlNode whose attribute will be set.</param>
<param name="attributeName">Name of the attribute to set.</param>
<param name="value">Value to be set</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.SetAttributeValue(System.Xml.XmlNode@,System.String,System.UInt32)">
-----------------------------------------------------------------------------
<summary>
Sets the value of an attribute for a given XmlNode.
</summary>
<param name="node">XmlNode whose attribute will be set.</param>
<param name="attributeName">Name of the attribute to set.</param>
<param name="value">Value to be set</param>
<returns>True if success.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetDataTable(System.Xml.XmlNodeList@)">
-----------------------------------------------------------------------------
<summary>s
Converts a list of Xml nodes to a DataTable.
</summary>
<param name="nodelist">List of Xml nodes</param>
<returns>DataTable</returns>
<remarks>
This method convert
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.GetDataTable(System.Xml.XmlNodeList,System.String,System.Boolean)">
-----------------------------------------------------------------------------
<summary>
Converts a list of Xml nodes to a DataTable and sets one of the columns as a primary key.
</summary>
<param name="nodelist"></param>
<param name="primaryKeyColumn"></param>
<param name="autoIncrement"></param>
<returns></returns>
<remarks>
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.UpdateChildNodesWithDataTable(System.Xml.XmlNode,System.Data.DataTable,System.String)">
-----------------------------------------------------------------------------
<summary>
Updates the child nodes of "parentNode" by using the fields from a datatable.
</summary>
<param name="parentNode"></param>
<param name="table"></param>
<param name="keyField"></param>
<remarks>
The child nodes that will be updated must have attribute fields that correspond to
the DataTable. The "keyField" will be used to identify the attribute that serves as
an identifier of the rows. The datatable can have less fields than the nodes so
you have the chance to update smaller subsets.
Make sure that you did not call "AcceptChanges" before passing the datatable or this
function will not find any change.
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.NodeToString(System.Xml.XmlNode@)">
-----------------------------------------------------------------------------
<summary>
Returns contents of an XmlNode in a string.
</summary>
<param name="node">The XmlNode whose contents will be read into a string.</param>
<returns>Xml formatted string with contents of "node" parameter.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.NodeListToString(System.Xml.XmlNodeList)">
-----------------------------------------------------------------------------
<summary>
Convert a XmlNodeList to string
</summary>
<param name="nodeList"></param>
<returns></returns>
<remarks>
</remarks>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.DocumentToString(System.Xml.XmlDocument@)">
-----------------------------------------------------------------------------
<summary>
Method to convert a XmlDocument to string.
</summary>
<param name="xmlDoc">XmlDocument that will be converted to string.</param>
<returns>A xml formatted string.</returns>
-----------------------------------------------------------------------------
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String)">
<summary>
Inserts an empty record at the bottom of the hierarchy, creating the
tree as required.
</summary>
<param name="doc">The XmlDocument to which the node will be inserted.</param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<returns>The XmlNode inserted into the hierarchy.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.String[],System.String[])">
<summary>
Inserts an record with a multiple fields at the bottom of the hierarchy.
</summary>
<param name="doc">The XmlDocument to which the node will be inserted.</param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="fields">The attribute names that will be created for the node inserted.</param>
<param name="values">The corresponding value of each field.</param>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.String,System.String)">
<summary>
Inserts a record with a single field at the bottom of the hierarchy.
</summary>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="field">The field to add to the record.</param>
<param name="val">The value assigned to the field.</param>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.Data.DataRow)">
<summary>
Inserts a record with multiple fields at bottom of the hierarchy.
</summary>
<param name="doc"></param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="rowValues">The DataRow values that will be added as attributes.</param>
<remarks>
The columns names of the DataRow will become the attribute names and
the row values of the DataRow will be the attribute values.
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Insert(System.Xml.XmlDocument,System.String,System.String,System.String[])">
<summary>
Inserts a record with multiple values at bottom of hierarchy. This is analogous to inserting
a column of data.
</summary>
<param name="doc"></param>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<param name="field">Name of the attribute to be created at node inserted.</param>
<param name="values">Values that will be inserted that correspond to the field name.</param>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to insert an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Update(System.Xml.XmlDocument,System.String,System.String,System.String)">
<summary>
Update a single field in all records in the specified path.
</summary>
<param name="doc">The XmlDocument whose node will be udpated.</param>
<param name="xpath">The xml path.</param>
<param name="field">The field name to update.</param>
<param name="val">The new value.</param>
<returns>The number of records affected.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>
The "doc" variable must have a root node. The path should not contain the root node.
The path can contain only the node names or it can contain attributes in XPath query form.
For example to update an "Address" node at the bottom, the following is a valid xpath query
xpath = "University[@Name='UT']/Student[@Id=12222]/Address"
</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Delete(System.Xml.XmlDocument,System.String)">
<summary>
Deletes all records of the specified path.
</summary>
<param name="xpath">The xml XPath query to get to the bottom node.</param>
<returns>The number of records deleted.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.QueryScalar(System.Xml.XmlDocument,System.String,System.String)">
<summary>
Return a single string representing the value of the specified field
for the first record encountered.
</summary>
<param name="xpath">The xml path.</param>
<param name="field">The desired field.</param>
<returns>A string with the field's value or null.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.Query(System.Xml.XmlDocument,System.String)">
<summary>
Returns a DataTable for all rows on the path.
</summary>
<param name="xpath">The xml path.</param>
<returns>The DataTable with the returned rows.
The row count will be 0 if no rows returned.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.QueryField(System.Xml.XmlDocument,System.String,System.String)">
<summary>
Returns an array of values for the specified field for all rows on
the path.
</summary>
<param name="xpath">The xml path.</param>
<param name="field">The desired field.</param>
<returns>The array of string values for each row qualified by the path.
A null is returned if the query results in 0 rows.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when an argument is null.</exception>
<remarks>Additional exceptions may be thrown by the XmlDocument class.</remarks>
</member><member name="M:EDKB04OP_Batch.XmlHelper.InsertNode(System.Xml.XmlNode,System.String[],System.Int32)">
<summary>
Inserts a node at the specified segment if it doesn't exist, otherwise
traverses the node.
</summary>
<param name="node">The current node.</param>
<param name="segments">The path segment list.</param>
<param name="idx">The current segment.</param>
<returns></returns>
</member><member name="M:EDKB04OP_Batch.XmlHelper.CreateColumns(System.Data.DataTable,System.Xml.XmlNode)">
<summary>
Creates columns given an XmlNode.
</summary>
<param name="dt">The target DataTable.</param>
<param name="node">The source XmlNode.</param>
</member><member name="P:EDKB04OP_Batch.My.Resources.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member><member name="P:EDKB04OP_Batch.My.Resources.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member><member name="T:EDKB04OP_Batch.My.Resources.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,741 @@
Imports System.IO
Imports System.Xml
Imports System.Xml.Schema
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Public Class xmlHandling
#Region "Properties"
Dim m_result As Boolean
Property Reuslt As Boolean
Get
Return m_result
End Get
Set(value As Boolean)
m_result = value
End Set
End Property
#End Region
#Region "Deklarationen"
Dim Partner_Typ As String
Dim Partner_Art As String
Dim Resultvalue As String
Dim PersonBeziehung As New DataTable
Dim AddrBeziehung As New DataTable
Dim sAction As String = ""
Dim doc As New XmlDocument
Dim partnernr As Integer
#End Region
Sub New(ByVal strdata As String)
Dim result As Boolean = True
Try
Dim ds As New DataSet
If result Then
doc.LoadXml(strdata)
Dim XMLType As String = XmlHelper.GetItemValueByTagName(doc, "resultName")
Select Case XMLType
Case "Partner Stammdaten"
Partner_Typ = XmlHelper.GetItemValueByTagName(doc, "typ")
Partner_Art = XmlHelper.GetItemValueByTagName(doc, "art")
PersonBeziehung = XmlHelper.ConvertXmlNodeListToDataTable(doc, "personbeziehung")
AddrBeziehung = XmlHelper.ConvertXmlNodeListToDataTable(doc, "adresse")
result = Update_Partner()
Case "Adresse Stammdaten"
update_adresse()
Case "Container Stammdaten"
AddrBeziehung = XmlHelper.ConvertXmlNodeListToDataTable(doc, "adresse")
result = update_vv
Case "Document Stammdaten"
Case "Konto Stammdaten"
AddrBeziehung = XmlHelper.ConvertXmlNodeListToDataTable(doc, "adresse")
result = update_vv
Case "Loan Stammdaten"
AddrBeziehung = XmlHelper.ConvertXmlNodeListToDataTable(doc, "adresse")
result = update_vv
Case "Mitarbeiter Stammdaten"
Case "Schrankfach Stammdaten"
AddrBeziehung = XmlHelper.ConvertXmlNodeListToDataTable(doc, "adresse")
result = update_vv
Case Else
m_log.log("EDKB04: Error bei XML->Obj: xmltype:" & XMLType, Common.Common.JournalEntryType.Error)
Reuslt = False
End Select
End If
Catch ex As Exception
m_log.log("EDKB04: Fehler beim Einlesen des XML", Common.Common.JournalEntryType.Error)
result = False
End Try
End Sub
#Region "Partner"
#Region "PartnerUpdate"
Private Function Update_Partner() As Boolean
Try
Dim dbRow As DataRow
partnernr = XmlHelper.GetItemValueByTagName(doc, "avqObjKey")
Dim dsPartner As New DataSet
Dim daPartner As New SqlDataAdapter("select * from partner where nrpar00 = " & partnernr.ToString, Globals.sConnectionString_edoka)
daPartner.SelectCommand.CommandTimeout = Params.SqlTimeout
'Saldierung: Status = 7 oder Ablaufdatum <=now
If hlp_Check_Saldierung(XmlHelper.GetItemValueByTagName(doc, "ablaufDatum"), XmlHelper.GetItemValueByTagName(doc, "status")) = True Then
Try
'-------------------------------------------------------------------------------
'- Saldierung
'-------------------------------------------------------------------------------
Dim scpartsald As New SqlCommand
Dim copartsald As New SqlConnection
scpartsald.CommandText = "dbo.sp_saldierter_partner"
scpartsald.CommandTimeout = Params.SqlTimeout
scpartsald.Parameters.Add(New SqlParameter("@nrpar00", SqlDbType.Int, 36, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, partnernr))
scpartsald.CommandType = CommandType.StoredProcedure
copartsald.ConnectionString = Globals.sConnectionString_edoka
copartsald.Open()
scpartsald.Connection = copartsald
scpartsald.ExecuteNonQuery()
copartsald.Close()
scpartsald.Dispose()
copartsald.Dispose()
sAction = " Saldierung"
m_log.log("EDKB04: Partner : " & partnernr.ToString & sAction & " erfolgreich", Common.Common.JournalEntryType.Information)
Catch ex As Exception
m_log.log("EDKB04: Partner-Saldierung error (sp_saldierter_partner): PNR=" & partnernr.ToString & ", Msg:" & Err.Description, Common.Common.JournalEntryType.Error)
Return False
End Try
Return True
End If
'-------------------------------------------------------------------------------
'- Partner insert / update
'-------------------------------------------------------------------------------
Dim neuer_partner As Boolean
daPartner.Fill(dsPartner, "partner")
Dim dtPartner As DataTable = dsPartner.Tables(0)
If dsPartner.Tables(0).Rows.Count < 1 Then
neuer_partner = True
sAction = " insert"
dbRow = dtPartner.NewRow()
Else
neuer_partner = False
sAction = " update"
dbRow = dsPartner.Tables(0).Rows(0)
End If
If XmlHelper.GetItemValueByTagName(doc, "kundenSegment") = "WEBP" Then
dbRow("IDMSG00") = XmlHelper.GetItemValueByTagName(doc, "kundenSegment")
dbRow("bkpar00") = XmlHelper.GetItemValueByTagName(doc, "vorname") + " " + XmlHelper.GetItemValueByTagName(doc, "name")
End If
dbRow("nrpar00") = partnernr
If XmlHelper.GetItemValueByTagName(doc, "ablaufDatum") <> "" Then
dbRow("validto") = XmlHelper.GetItemValueByTagName(doc, "ablaufDatum")
End If
dbRow("saldiert") = hlp_Check_Saldierung(XmlHelper.GetItemValueByTagName(doc, "ablaufDatum"), XmlHelper.GetItemValueByTagName(doc, "status"))
dbRow("cdvsa00") = 0
dbRow("azepl00") = 1
dbRow("nrparad") = "00" & partnernr.ToString
dbRow("TXADZ012") = ""
dbRow("TXADZ022") = ""
dbRow("TXADZ032") = ""
dbRow("TXADZ042") = ""
dbRow("TXADZ052") = ""
dbRow("TXADZ062") = ""
dbRow("TXADZ072") = ""
dbRow("TXADZ011") = ""
dbRow("TXADZ021") = ""
dbRow("TXADZ031") = ""
dbRow("TXADZ041") = ""
dbRow("TXADZ051") = ""
dbRow("TXADZ061") = ""
dbRow("TXADZ071") = ""
dbRow("TSMUT00") = hlp_MutDatum("1")
dbRow("VDMUTER") = Params.CDMuter
Select Case Partner_Art
Case "NAT"
dbRow("cdpaw00") = "N"
dbRow("nrnat01") = hlp_TransformLand(XmlHelper.GetItemValueByTagName(doc, "nationalitaet"))
Dim s As String = hlp_Transformdate(XmlHelper.GetItemValueByTagName(doc, "geburtsDatum"))
If s <> "" Then dbRow("GebGruendDat") = s
Case "JUR"
dbRow("cdpaw00") = "J"
dbRow("nrnat01") = hlp_TransformLand(XmlHelper.GetItemValueByTagName(doc, "domizilCode"))
Case Else
dbRow("cdpaw00") = "U"
dbRow("nrnat01") = hlp_TransformLand(XmlHelper.GetItemValueByTagName(doc, "domizilCode"))
End Select
If neuer_partner Then
dtPartner.Rows.Add(dbRow)
End If
Dim cb As New SqlCommandBuilder(daPartner)
daPartner.Update(dsPartner, "partner")
daPartner.Dispose()
dsPartner.Clear()
Update_Adressbeziehungen()
Update_PersonBeziehung()
m_log.log("EDKB04: Partner : " & partnernr.ToString & sAction & " erfolgreich", Common.Common.JournalEntryType.Information)
Return True
Catch ex As Exception
m_log.log("EDKB04: DBHandling.Partner, Tabelle partner: " & ex.Message, Common.Common.JournalEntryType.Error)
Return False
End Try
End Function
#End Region
#Region "Adressbeziehungen"
Function Update_Adressbeziehungen()
Dim Domiziladresse_fuer_Kurznamenupdate As Integer = 0
Dim ts As DateTime = Now
Dim found As Boolean = False
Dim dsAddr As New DataSet
Dim daAddr As New SqlDataAdapter("select * from partneradresse where aktiv=1 and partnernr=" + partnernr.ToString, Globals.sConnectionString_edoka)
daAddr.SelectCommand.CommandTimeout = Params.SqlTimeout
daAddr.Fill(dsAddr, "Adressen")
For Each r As DataRow In AddrBeziehung.Rows
For Each r1 As DataRow In dsAddr.Tables(0).Rows
found = False
If r1("ADDR_Obj_ID") = r("avqObjId") Then
If r1("Adresstype") = 1 And r("Typ") = "D" Then
Domiziladresse_fuer_Kurznamenupdate = r1("Addr_obj_id")
r1("mutiert_am") = ts
found = True
Exit For
End If
If r1("Adresstype") = 2 And r("Typ") = "H" Then
r1("mutiert_am") = ts
found = True
Exit For
End If
If r1("Adresstype") = 9 And r("Typ") = "A" Then
r1("mutiert_am") = ts
found = True
Exit For
End If
End If
Next
'-- Neue Adressbeziehung einfügen
If found = False Then
Dim rn As DataRow = dsAddr.Tables(0).NewRow
rn("Partnernr") = partnernr
'rn("Adressnr") = ""
rn("Addr_obj_id") = r("avqobjid")
Select Case r("Typ")
Case "D"
rn("Adresstype") = 1
Domiziladresse_fuer_Kurznamenupdate = rn("Addr_obj_id")
Case "H"
rn("Adresstype") = 2
Case Else
rn("Adresstype") = 9
End Select
rn("erstellt_am") = ts
rn("mutiert_am") = ts
rn("aktiv") = 1
rn("mutierer") = 1
dsAddr.Tables(0).Rows.Add(rn)
End If
Next
For Each r As DataRow In dsAddr.Tables(0).Rows
If r("mutiert_am") <> ts Then
r("aktiv") = 0
r("mutiert_am") = ts
r("mutierer") = 1
End If
Next
Dim cb As New SqlCommandBuilder(daAddr)
daAddr.Update(dsAddr, "Adressen")
daAddr.Dispose()
dsAddr.Dispose()
If Domiziladresse_fuer_Kurznamenupdate <> 0 Then Update_Kurzname(Domiziladresse_fuer_Kurznamenupdate)
End Function
#End Region
#Region "Personbeziehungen"
Function Update_PersonBeziehung()
Dim sql As String
If Partner_Typ = "BP" Then
sql = "Select * from partner_rel where aktiv=1 and bp_nr=" + partnernr.ToString
Else
sql = "Select * from partner_rel where aktiv=1 and person_nummer" = +partnernr.ToString
End If
Dim ts As DateTime = Now
Dim found As Boolean = False
Dim dsPBez As New DataSet
Dim daPBez As New SqlDataAdapter(sql, Globals.sConnectionString_edoka)
daPBez.SelectCommand.CommandTimeout = Params.SqlTimeout
daPBez.Fill(dsPBez, "Beziehung")
If Partner_Typ = "BP" Then
For Each r As DataRow In PersonBeziehung.Rows
For Each r1 As DataRow In dsPBez.Tables(0).Rows
found = False
If r1("Person_Nummer").ToString = r("key_to").ToString Then
If r("reltyp") = "reg_owner" And r1("BP_Person_Rel_Typ") = 2 Then
found = True
Exit For
End If
If r("reltyp") = "acc_owner_lim" And r1("BP_Person_Rel_Typ") = 6 Then
found = True
Exit For
End If
End If
Next
If Not found And (r("reltyp") = "reg_owner" Or r("reltyp") = "acc_owner_lim") Then
Dim rn As DataRow = dsPBez.Tables(0).NewRow
rn("Person_Nummer") = r("key_to")
rn("Person_Obj_ID") = 0
If r("reltyp") = "reg_owner" Then rn("BP_Person_Rel_Typ") = 2
If r("reltyp") = "acc_owner_lim" Then rn("BP_Person_Rel_Typ") = 6
rn("bp_nr") = partnernr
rn("erstellt_am") = ts
rn("mutiert_am") = ts
rn("Mutierer") = 1
rn("Gueltig_bis") = hlp_Convert_Date(r("end_date"), 1)
If rn("gueltig_bis") < Now Then rn("Aktiv") = 0 Else rn("aktiv") = 1
dsPBez.Tables(0).Rows.Add(rn)
End If
Next
For Each r As DataRow In dsPBez.Tables(0).Rows
If r("mutiert_am") <> ts Then
r("aktiv") = 0
r("mutiert_am") = ts
r("mutierer") = 1
End If
Next
Dim cb As New SqlCommandBuilder(daPBez)
daPBez.Update(dsPBez, "Beziehung")
daPBez.Dispose()
daPBez.Dispose()
End If
End Function
#End Region
#End Region
#Region "Adresse"
Public Function update_Adresse()
Dim AddrObjID As Integer
Try
Dim sql As String
Dim neue_Adrese As Boolean
Dim dbrow As DataRow
AddrObjID = XmlHelper.GetItemValueByTagName(doc, "AvqObjId")
sql = "SELECT * FROM Partner_Adresse where Addr_Obj_ID = " + AddrObjID.ToString
Dim dsAddr As New DataSet
Dim daAddr As New SqlDataAdapter(sql, Globals.sConnectionString_edoka)
daAddr.SelectCommand.CommandTimeout = Params.SqlTimeout
daAddr.Fill(dsAddr, "Addr")
If dsAddr.Tables(0).Rows.Count < 1 Then
neue_Adrese = True
sAction = " insert"
dbrow = dsAddr.Tables(0).NewRow()
dbrow("Addr_obj_id") = AddrObjID
Else
neue_Adrese = False
sAction = " update"
dbrow = dsAddr.Tables(0).Rows(0)
End If
dbrow("Zeile1") = XmlHelper.GetItemValueByTagName(doc, "zeile1")
dbrow("Zeile2") = XmlHelper.GetItemValueByTagName(doc, "zeile2")
dbrow("Zeile3") = XmlHelper.GetItemValueByTagName(doc, "zeile3")
dbrow("Zeile4") = XmlHelper.GetItemValueByTagName(doc, "zeile4")
dbrow("Zeile5") = XmlHelper.GetItemValueByTagName(doc, "zeile5")
dbrow("Zeile6") = XmlHelper.GetItemValueByTagName(doc, "zeile6")
dbrow("Zeile7") = XmlHelper.GetItemValueByTagName(doc, "zeile7")
dbrow("Titel_Vorgestellt") = XmlHelper.GetItemValueByTagName(doc, "titelVorgestellt")
dbrow("Vorname_1") = XmlHelper.GetItemValueByTagName(doc, "vorname1")
dbrow("Vorname_2") = XmlHelper.GetItemValueByTagName(doc, "vorname2")
dbrow("Vorname_3") = XmlHelper.GetItemValueByTagName(doc, "vorname3")
dbrow("Vorname_4") = XmlHelper.GetItemValueByTagName(doc, "vorname4")
dbrow("Nachname") = XmlHelper.GetItemValueByTagName(doc, "nachname")
dbrow("Firma") = XmlHelper.GetItemValueByTagName(doc, "firma")
dbrow("namenzusatz") = XmlHelper.GetItemValueByTagName(doc, "namenZusatz")
dbrow("ortzusatz") = XmlHelper.GetItemValueByTagName(doc, "ortZusatz")
dbrow("Weiler") = XmlHelper.GetItemValueByTagName(doc, "weiler")
dbrow("strasse") = XmlHelper.GetItemValueByTagName(doc, "strasse")
dbrow("hausnr") = XmlHelper.GetItemValueByTagName(doc, "hausNr")
dbrow("briefanrede1code") = ""
dbrow("briefanrede1") = XmlHelper.GetItemValueByTagName(doc, "briefanrede1")
dbrow("briefanrede2zeile1") = XmlHelper.GetItemValueByTagName(doc, "briefanrede2Zeile1")
dbrow("briefanrede2zeile2") = XmlHelper.GetItemValueByTagName(doc, "briefanrede2Zeile2")
dbrow("plz") = XmlHelper.GetItemValueByTagName(doc, "plz")
dbrow("Ort") = XmlHelper.GetItemValueByTagName(doc, "ort")
dbrow("Land") = hlp_TransformLand(XmlHelper.GetItemValueByTagName(doc, "land"))
dbrow("Laendercode") = hlp_TransformLand(XmlHelper.GetItemValueByTagName(doc, "laenderCode"))
dbrow("banklagernd") = XmlHelper.GetItemValueByTagName(doc, "banklagernd")
dbrow("versandart") = XmlHelper.GetItemValueByTagName(doc, "versandart")
dbrow("beban01") = hlp_transform_Briefanrede(XmlHelper.GetItemValueByTagName(doc, "briefanrede2Zeile1"))
dbrow("beban02") = XmlHelper.GetItemValueByTagName(doc, "briefanrede2Zeile2")
If XmlHelper.GetItemValueByTagName(doc, "ablaufDatumAdresse") <> "" Then
dbrow("ablaufdatum") = XmlHelper.GetItemValueByTagName(doc, "ablaufDatumAdresse")
If dbrow("ablaufdatum") < Now Then dbrow("aktiv") = 0
End If
If neue_Adrese Then
dsAddr.Tables(0).Rows.Add(dbrow)
End If
Dim cb As New SqlCommandBuilder(daAddr)
daAddr.Update(dsAddr, "Addr")
daAddr.Dispose()
dsAddr.Clear()
Update_Kurzname(AddrObjID)
m_log.log("EDKB04: Adresse Addr_Obj_IDr: " & AddrObjID.ToString & sAction & " erfolgreich", Common.Common.JournalEntryType.Information)
Catch ex As Exception
m_log.log("EDKB04: DBHandling.Adresse" + AddrObjID.ToString + " : " & ex.Message, Common.Common.JournalEntryType.Error)
Return False
End Try
End Function
Private Sub Update_Kurzname(ByVal addrobjid As Integer)
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
scmCmdToExecute.CommandText = "dbo.sp_edkb04_update_kurzname"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn_edoka.scoDBConnection
scmCmdToExecute.Parameters.Add(New SqlParameter("@addrobjid", SqlDbType.VarChar, 16, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, addrobjid))
Try
conn_edoka.OpenConnection()
scmCmdToExecute.ExecuteNonQuery()
Catch exi As Exception
m_log.log("EDKB04: Update Kurzname " & exi.Message & " - Addrobjid: " & addrobjid.ToString, Common.Common.JournalEntryType.Error)
Finally
conn_edoka.CloseConnection(True)
scmCmdToExecute.Dispose()
sdaAdapter.Dispose()
End Try
End Sub
#End Region
#Region "VV"
Public Function update_vv()
Try
Dim sql As String
Dim neue_vv As Boolean
Dim nrvvg00 As Integer
Dim dbrow As DataRow
If XmlHelper.GetItemValueByTagName(doc, "externeNr") <> "" Then
sql = "SELECT * FROM vv WHERE NEVVG00 = '" + XmlHelper.GetItemValueByTagName(doc, "externeNr") + "'"
Else
sql = "SELECT * FROM vv WHERE NAVVG00 = '" + XmlHelper.GetItemValueByTagName(doc, "formatierteNr") + "'"
End If
Dim dsVV As New DataSet
Dim daVV As New SqlDataAdapter(sql, Globals.sConnectionString_edoka)
daVV.SelectCommand.CommandTimeout = Params.SqlTimeout
daVV.Fill(dsVV, "VV")
If dsVV.Tables(0).Rows.Count < 1 Then
neue_vv = True
sAction = " insert"
dbrow = dsVV.Tables(0).NewRow()
dbrow("nrvvg00") = hlp_GetNewKey_vv()
Else
neue_vv = False
sAction = " update"
dbrow = dsVV.Tables(0).Rows(0)
End If
' dbrow("NRVVG00") = hlp_GetNewKey_vv()
If XmlHelper.GetItemValueByTagName(doc, "ablaufDatum") <> "" Then
dbrow("validto") = XmlHelper.GetItemValueByTagName(doc, "ablaufDatum")
End If
dbrow("NAVVG00") = XmlHelper.GetItemValueByTagName(doc, "formatierteNr")
dbrow("NEVVG00") = XmlHelper.GetItemValueByTagName(doc, "externeNr")
If dbrow("NEVVG00") = "" Then dbrow("NEVVG00") = hlp_TransformVVExtern(dbrow("NAVVG00"))
dbrow("NAVVG00") = XmlHelper.GetItemValueByTagName(doc, "formatierteNr")
If IsNumeric(XmlHelper.GetItemValueByTagName(doc, "produkt")) Then
dbrow("NRPRD00") = XmlHelper.GetItemValueByTagName(doc, "produkt")
Else
dbrow("NRPRD00") = 0
End If
dbrow("BEPRDLG") = XmlHelper.GetItemValueByTagName(doc, "kontoTyp")
If XmlHelper.GetItemValueByTagName(doc, "kontoTyp") = "" And XmlHelper.GetItemValueByTagName(doc, "produktBezeichnung") <> "" Then
dbrow("BEPRDLG") = XmlHelper.GetItemValueByTagName(doc, "produktBezeichnung")
End If
dbrow("SAREC00") = XmlHelper.GetItemValueByTagName(doc, "status")
If XmlHelper.GetItemValueByTagName(doc, "ablaufDatum") <> "" Then
If dbrow("validto") < Now Then
dbrow("SAREC00") = 7
End If
End If
dbrow("TXRBK00") = XmlHelper.GetItemValueByTagName(doc, "text")
dbrow("NRPAR00") = XmlHelper.GetItemValueByTagName(doc, "partnerNummer")
If neue_vv Then
dsVV.Tables(0).Rows.Add(dbrow)
End If
nrvvg00 = dbrow("nrvvg00")
Dim cb As New SqlCommandBuilder(daVV)
daVV.Update(dsVV, "VV")
daVV.Dispose()
dsVV.Clear()
Update_VVAdressbeziehungen(nrvvg00)
m_log.log("EDKB04: VV partner: " & partnernr.ToString & sAction & " erfolgreich", Common.Common.JournalEntryType.Information)
Catch ex As Exception
m_log.log("EDKB04: DBHandling.VV, Tabelle VV: " & ex.Message, Common.Common.JournalEntryType.Error)
Return False
End Try
End Function
#Region "Adressbeziehungen"
Function Update_VVAdressbeziehungen(ByVal nrvvg00 As Integer)
Dim ts As DateTime = Now
Dim found As Boolean = False
Dim dsAddr As New DataSet
Dim daAddr As New SqlDataAdapter("select * from vvadresse where aktiv=1 and nrvvg00=" + nrvvg00.ToString, Globals.sConnectionString_edoka)
daAddr.SelectCommand.CommandTimeout = Params.SqlTimeout
daAddr.Fill(dsAddr, "Adressen")
For Each r As DataRow In AddrBeziehung.Rows
For Each r1 As DataRow In dsAddr.Tables(0).Rows
found = False
If r1("ADDR_Obj_ID") = r("avqObjId") Then
If r1("Adresstype") = 4 And r("Typ") = "A" Then
r1("mutiert_am") = ts
found = True
Exit For
End If
End If
Next
'-- Neue Adressbeziehung einfügen
If found = False Then
Dim rn As DataRow = dsAddr.Tables(0).NewRow
rn("nrvvg00") = nrvvg00
'rn("Adressnr") = ""
rn("Addr_obj_id") = r("avqobjid")
Select Case r("Typ")
Case "D"
rn("Adresstype") = 1
Case "H"
rn("Adresstype") = 2
Case Else
rn("Adresstype") = 4
End Select
rn("erstellt_am") = ts
rn("mutiert_am") = ts
rn("aktiv") = 1
rn("mutierer") = 1
dsAddr.Tables(0).Rows.Add(rn)
End If
Next
For Each r As DataRow In dsAddr.Tables(0).Rows
If r("mutiert_am") <> ts Then
r("aktiv") = 0
r("mutiert_am") = ts
r("mutierer") = 1
End If
Next
Dim cb As New SqlCommandBuilder(daAddr)
daAddr.Update(dsAddr, "Adressen")
daAddr.Dispose()
dsAddr.Dispose()
End Function
#End Region
#End Region
#Region "Helper"
Private Function hlp_GetNewKey_vv() As Integer
hlp_GetNewKey_vv = 0
Dim ssql As String
ssql = "SELECT TOP 1 NRVVG00 + 1 AS NewRow FROM vv Order By NRVVG00 DESC"
Dim connection As New SqlConnection()
Dim daTemp As New SqlDataAdapter(ssql, connection)
Dim dsTemp As New DataSet()
Try
connection.ConnectionString = Globals.sConnectionString_edoka
connection.Open()
daTemp.Fill(dsTemp)
hlp_GetNewKey_vv = dsTemp.Tables(0).Rows(0).Item(0)
Catch ex As Exception
Return False
Finally
dsTemp = Nothing
daTemp = Nothing
connection.Close()
connection = Nothing
End Try
End Function
Function hlp_Convert_Date(ByVal iDatum As String, fnkt As Integer) As String
Try
If iDatum = "" Then Return "2712-12-31"
Select Case fnkt
Case 1
Return iDatum.Substring(0, 4) + "-" + iDatum.Substring(4, 2) + "-" + iDatum.Substring(6, 2)
End Select
Catch ex As Exception
Return ""
End Try
End Function
Private Function hlp_Check_Saldierung(ByVal instr As String, ByVal Status As String) As Boolean
'Kein Validto-Datum und Status=7 Saldierung durchfüren
If Len(instr) = 0 Then
If Status = "7" Then Return True
End If
'Validto Datum vorhandên und kleiner oder gleich heute, dann Saldierung druchführen
If Len(instr) <> 0 Then
If IsDate(instr) And CDate(instr) <= Now And Status = "7" Then Return True
If IsDate(instr) And CDate(instr) > Now And Status = "7" Then Return False
End If
Return False
End Function
Private Function hlp_MutDatum(ByVal sformat As String) As String
Dim result As String = ""
Dim sMonth As String = Month(Now())
If Len(sMonth) = 1 Then sMonth = "0" + sMonth
Dim sDay As String = Day(Now())
If Len(sDay) = 1 Then sDay = "0" & sDay
Dim sHour As String = Hour(Now())
If Len(sHour) = 1 Then sHour = "0" & sHour
Dim sMinute As String = Minute(Now())
If Len(sMinute) = 1 Then sMinute = "0" & sMinute
Dim sSecond As String = Second(Now())
If Len(sSecond) = 1 Then sSecond = "0" & sSecond
Select Case sformat
Case "1"
'Partner.tsmut00
result = Year(Now()) & "-" & sMonth & "-" & sDay & "-" & sHour & "." & sMinute & "." & sSecond & ".000000"
Case "2"
'etparn.TSMUT00
result = sDay & "." & sMonth & "." & Year(Now()) & " " & sHour & ":" & sMinute & ":" & sSecond
Case "3"
'etparn.DMERF00
result = sDay & "." & sMonth & "." & Year(Now())
End Select
Return result
End Function
Function hlp_TransformLand(ByVal inland As String) As String
Dim result As String = "756"
'MNK 24.08.2009 Version 1.7 - Anpassung Landaufbereitung
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
scmCmdToExecute.CommandText = "dbo.sp_edkb04_get_nationalitaet"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
scmCmdToExecute.Connection = conn_edoka.scoDBConnection
scmCmdToExecute.Parameters.Add(New SqlParameter("@code", SqlDbType.VarChar, 16, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, inland))
scmCmdToExecute.Parameters.Add(New SqlParameter("@land", SqlDbType.VarChar, 16, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, 0))
Try
conn_edoka.OpenConnection()
scmCmdToExecute.ExecuteNonQuery()
result = scmCmdToExecute.Parameters("@land").Value
Return result
Catch exi As Exception
m_log.log("EDKB04: Fehler TransformLand " & exi.Message & " - Code: " & inland, Common.Common.JournalEntryType.Error)
Return "756"
Finally
conn_edoka.CloseConnection(True)
scmCmdToExecute.Dispose()
sdaAdapter.Dispose()
End Try
End Function
Function hlp_Transformdate(ByVal Datum As String) As String
Try
Dim s As String
s = Datum.Substring(0, 4) + "-" + Datum.Substring(4, 2) + "-" + Datum.Substring(6, 2)
Return s
Catch ex As Exception
Return ""
End Try
End Function
Private Function hlp_GetBetreuerID_Substitute(ByVal strPnr As String) As String
Dim result As String = Params.DefaultBetreuerID
'Prüfen ob bereit ein Betreuer eingetragen ist
Dim ssql As String
ssql = "SELECT TOP 1 NRBEU01 FROM edoka_etbez0 WHERE nrpar00 = " & strPnr
Dim connection As New SqlConnection()
Dim daTemp As New SqlDataAdapter(ssql, connection)
Dim dsTemp As New DataSet()
Try
connection.ConnectionString = Globals.sConnectionString_edoka
connection.Open()
daTemp.Fill(dsTemp)
If dsTemp.Tables(0).Rows.Count > 0 Then
If CStr(dsTemp.Tables(0).Rows(0).Item(0)) <> "0" Then
result = CStr(dsTemp.Tables(0).Rows(0).Item(0))
m_log.log("EDKB04: Fehler in Partner, keine BetreuerID es wird der vorhandene Betreuer weiterverwendet, PartnerNr: " & strPnr, Common.Common.JournalEntryType.Error)
Else
m_log.log("EDKB04: Fehler in Partner, keine BetreuerID es wurde der Defaultbetreuer eingesetzt, PartnerNr: " & strPnr, Common.Common.JournalEntryType.Error)
End If
Else
m_log.log("EDKB04: Fehler in Partner, keine BetreuerID es wurde der Defaultbetreuer eingesetzt, PartnerNr: " & strPnr, Common.Common.JournalEntryType.Error)
End If
Catch ex As Exception
m_log.log("EDKB04: Fehler in hlp_GetBetreuerID_Substitute, PartnerNr: " & strPnr & ", Error" & ex.Message, Common.Common.JournalEntryType.Error)
Finally
dsTemp = Nothing
daTemp = Nothing
connection.Close()
connection = Nothing
End Try
Return result
End Function
Private Function hlp_TransformVVExtern(ByVal instr As String) As String
Dim result As String = ""
Dim i As Integer = 1
Do While i <= Len(instr)
If Char.IsDigit(Mid(instr, i, 1).Chars(0)) Then
result = result + Mid(instr, i, 1)
End If
i = i + 1
Loop
Return result
End Function
Private Function hlp_transform_Briefanrede(ByVal Anrede As String) As String
Dim s As String
s = Anrede
s = s.Replace("Sehr geehrter ", "")
s = s.Replace("Sehr geehrte ", "")
Return s
End Function
#End Region
End Class