Initial commit
This commit is contained in:
32
Archiv/EDKB01ZV/Backup/AssemblyInfo.vb
Normal file
32
Archiv/EDKB01ZV/Backup/AssemblyInfo.vb
Normal file
@@ -0,0 +1,32 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgende
|
||||
' Attributgruppe gesteuert. Ändern Sie diese Attributwerte, um Informationen,
|
||||
' die mit einer Assembly verknüpft sind, zu bearbeiten.
|
||||
|
||||
' Die Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("")>
|
||||
<Assembly: AssemblyCopyright("")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: CLSCompliant(True)>
|
||||
|
||||
'Die folgende GUID ist für die ID der Typbibliothek, wenn dieses Projekt in COM angezeigt wird
|
||||
<Assembly: Guid("8F572FBC-B8CB-49A3-A6B0-E344AAC92D00")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Haupversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revisionsnummer
|
||||
'
|
||||
' Sie können alle Werte angeben oder auf die standardmäßigen Build- und Revisionsnummern
|
||||
' zurückgreifen, indem Sie '*' wie unten angezeigt verwenden:
|
||||
|
||||
<Assembly: AssemblyVersion("2.0.*")>
|
||||
165
Archiv/EDKB01ZV/Backup/ClsParameters.vb
Normal file
165
Archiv/EDKB01ZV/Backup/ClsParameters.vb
Normal file
@@ -0,0 +1,165 @@
|
||||
Public Class ClsParameters
|
||||
|
||||
#Region "Deklarationen"
|
||||
|
||||
Dim m_applicationid As String
|
||||
Property ApplicationID() As String
|
||||
Get
|
||||
Return m_applicationid
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_applicationid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_watchdirectory As String
|
||||
Property WatchDirectory() As String
|
||||
Get
|
||||
Return m_watchdirectory
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_watchdirectory = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_SaveDir As String
|
||||
Property SaveDir() As String
|
||||
Get
|
||||
Return m_SaveDir
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_SaveDir = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_paramsedkb01 As String
|
||||
Property ParamsEDKB01() As String
|
||||
Get
|
||||
Return m_paramsedkb01
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_paramsedkb01 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Dim m_timerintervall As Integer
|
||||
Property TimerIntervall() As Integer
|
||||
Get
|
||||
Return m_timerintervall
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_timerintervall = Value * 60 * 1000
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Wait_Before_Start_EDKB01 As Integer
|
||||
Property Wait_Before_Start_EDKB01() As Integer
|
||||
Get
|
||||
Return m_Wait_Before_Start_EDKB01
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_Wait_Before_Start_EDKB01 = Value * 60 * 1000
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_MailadresseOK As String
|
||||
Property MailAdresseOK() As String
|
||||
Get
|
||||
Return m_MailadresseOK
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_MailadresseOK = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_MailadresseNOK As String
|
||||
Property MailAdresseNOK() As String
|
||||
Get
|
||||
Return m_MailadresseNOK
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_MailadresseNOK = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_SaveDirError As String
|
||||
Property SaveDirError() As String
|
||||
Get
|
||||
Return m_SaveDirError
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_SaveDirError = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_pathtemp As String
|
||||
Property PathTemp() As String
|
||||
Get
|
||||
Return m_pathtemp
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_pathtemp = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_cmddatei As String
|
||||
Property CMDDatei() As String
|
||||
Get
|
||||
Return m_cmddatei
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_cmddatei = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_copystat As String
|
||||
Property CMDCopyStat() As String
|
||||
Get
|
||||
Return m_copystat
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_copystat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Zeitintervall As Integer
|
||||
Property Zeitintervall() As Integer
|
||||
Get
|
||||
Return m_Zeitintervall
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_Zeitintervall = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Function Loadparameters() As String
|
||||
Try
|
||||
oread = IO.File.OpenText(Globals.ApplicationPath + "parameters.cfg")
|
||||
Me.ApplicationID = ParamValue(oread.ReadLine)
|
||||
Me.WatchDirectory = ParamValue(oread.ReadLine)
|
||||
Me.SaveDir = ParamValue(oread.ReadLine)
|
||||
Me.ParamsEDKB01 = ParamValue(oread.ReadLine)
|
||||
Me.TimerIntervall = ParamValue(oread.ReadLine)
|
||||
Me.Wait_Before_Start_EDKB01 = ParamValue(oread.ReadLine)
|
||||
Me.MailAdresseOK = ParamValue(oread.ReadLine)
|
||||
Me.MailAdresseNOK = ParamValue(oread.ReadLine)
|
||||
Me.SaveDirError = ParamValue(oread.ReadLine)
|
||||
oread.Close()
|
||||
Return ""
|
||||
Catch ex As Exception
|
||||
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
|
||||
19
Archiv/EDKB01ZV/Backup/EDKB01ZV.sln
Normal file
19
Archiv/EDKB01ZV/Backup/EDKB01ZV.sln
Normal file
@@ -0,0 +1,19 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDKB01ZV", "EDKB01ZV.vbproj", "{329DB641-4EA8-4D2F-B0AC-3A2C8C43614B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{329DB641-4EA8-4D2F-B0AC-3A2C8C43614B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{329DB641-4EA8-4D2F-B0AC-3A2C8C43614B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{329DB641-4EA8-4D2F-B0AC-3A2C8C43614B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{329DB641-4EA8-4D2F-B0AC-3A2C8C43614B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
Archiv/EDKB01ZV/Backup/EDKB01ZV.v12.suo
Normal file
BIN
Archiv/EDKB01ZV/Backup/EDKB01ZV.v12.suo
Normal file
Binary file not shown.
167
Archiv/EDKB01ZV/Backup/EDKB01ZV.vbproj
Normal file
167
Archiv/EDKB01ZV/Backup/EDKB01ZV.vbproj
Normal file
@@ -0,0 +1,167 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{329DB641-4EA8-4D2F-B0AC-3A2C8C43614B}</ProjectGuid>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>EDKB01ZV</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyMode>None</AssemblyOriginatorKeyMode>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
<RootNamespace>EDKB01ZV</RootNamespace>
|
||||
<StartupObject>EDKB01ZV.Service1</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<MyType>Console</MyType>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationVersion>2.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DocumentationFile>EDKB01ZV.xml</DocumentationFile>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DocumentationFile>EDKB01ZV.xml</DocumentationFile>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BMS, Version=1.0.3008.13873, Culture=neutral, processorArchitecture=MSIL" />
|
||||
<Reference Include="Common, Version=1.0.3008.13890, Culture=neutral, processorArchitecture=MSIL" />
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration.Install">
|
||||
<Name>System.Configuration.Install</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceProcess">
|
||||
<Name>System.ServiceProcess</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="clsConnectionProvider.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="clsDBInteractionBase.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ClsParameters.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="db_connection.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Globals.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ProjectInstaller.vb">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Service1.vb">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="ProjectInstaller.resx">
|
||||
<DependentUpon>ProjectInstaller.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Service1.resx">
|
||||
<DependentUpon>Service1.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="My Project\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
5
Archiv/EDKB01ZV/Backup/EDKB01ZV.vbproj.user
Normal file
5
Archiv/EDKB01ZV/Backup/EDKB01ZV.vbproj.user
Normal file
@@ -0,0 +1,5 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
27
Archiv/EDKB01ZV/Backup/Globals.vb
Normal file
27
Archiv/EDKB01ZV/Backup/Globals.vb
Normal file
@@ -0,0 +1,27 @@
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
|
||||
Module Globals
|
||||
Public Params As New ClsParameters()
|
||||
Public ofile As System.IO.File
|
||||
Public oread As System.IO.StreamReader
|
||||
|
||||
Public sConnectionString_edoka As String
|
||||
Public sConnectionString_journale As String
|
||||
Public sConnectionString_ams As String
|
||||
|
||||
Public args As String() = Environment.GetCommandLineArgs()
|
||||
|
||||
Public conn_edoka As New edokadb.clsConnectionProvider()
|
||||
Public conn_journale As New edokadb.clsConnectionProvider()
|
||||
Public conn_ams As New edokadb.clsConnectionProvider()
|
||||
|
||||
Public Function ApplicationPath() As String
|
||||
'Return Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
|
||||
Return Path.GetDirectoryName([Assembly].GetEntryAssembly().Location) + "\"
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Module
|
||||
|
||||
127
Archiv/EDKB01ZV/Backup/ProjectInstaller.resx
Normal file
127
Archiv/EDKB01ZV/Backup/ProjectInstaller.resx
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
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">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</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 forserialized 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="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>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ServiceProcessInstaller1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="ServiceProcessInstaller1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="ServiceProcessInstaller1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</data>
|
||||
<data name="EDKB01ZV.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="EDKB01ZV.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="EDKB01ZV.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>188, 17</value>
|
||||
</data>
|
||||
<data name="$this.Name">
|
||||
<value>ProjectInstaller</value>
|
||||
</data>
|
||||
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
</root>
|
||||
61
Archiv/EDKB01ZV/Backup/ProjectInstaller.vb
Normal file
61
Archiv/EDKB01ZV/Backup/ProjectInstaller.vb
Normal file
@@ -0,0 +1,61 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Configuration.Install
|
||||
|
||||
<RunInstaller(True)> Public Class ProjectInstaller
|
||||
Inherits System.Configuration.Install.Installer
|
||||
|
||||
#Region " Vom Component Designer generierter Code "
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
' Dieser Aufruf ist für den Komponenten-Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
|
||||
|
||||
End Sub
|
||||
|
||||
'Installer überschreibt den Löschvorgang zum Bereinigen der Komponentenliste.
|
||||
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing Then
|
||||
If Not (components Is Nothing) Then
|
||||
components.Dispose()
|
||||
End If
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
' Für Komponenten-Designer erforderlich
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'HINWEIS: Die folgende Prozedur ist für den Komponenten-Designer erforderlich
|
||||
'Sie kann mit dem Komponenten-Designer modifiziert werden.
|
||||
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
|
||||
Friend WithEvents ServiceProcessInstaller1 As System.ServiceProcess.ServiceProcessInstaller
|
||||
Friend WithEvents EDKB01ZV As System.ServiceProcess.ServiceInstaller
|
||||
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
||||
Me.ServiceProcessInstaller1 = New System.ServiceProcess.ServiceProcessInstaller
|
||||
Me.EDKB01ZV = New System.ServiceProcess.ServiceInstaller
|
||||
'
|
||||
'ServiceProcessInstaller1
|
||||
'
|
||||
Me.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem
|
||||
Me.ServiceProcessInstaller1.Installers.AddRange(New System.Configuration.Install.Installer() {Me.EDKB01ZV})
|
||||
Me.ServiceProcessInstaller1.Password = Nothing
|
||||
Me.ServiceProcessInstaller1.Username = Nothing
|
||||
'
|
||||
'EDKB01ZV
|
||||
'
|
||||
Me.EDKB01ZV.DisplayName = "EDKB01ZV"
|
||||
Me.EDKB01ZV.ServiceName = "EDKB01ZV"
|
||||
'
|
||||
'ProjectInstaller
|
||||
'
|
||||
Me.Installers.AddRange(New System.Configuration.Install.Installer() {Me.ServiceProcessInstaller1})
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
118
Archiv/EDKB01ZV/Backup/Service1.resx
Normal file
118
Archiv/EDKB01ZV/Backup/Service1.resx
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
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">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</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 forserialized 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="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>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="chktimer.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</data>
|
||||
<data name="chktimer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="chktimer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Assembly</value>
|
||||
</data>
|
||||
<data name="$this.Name">
|
||||
<value>Service1</value>
|
||||
</data>
|
||||
</root>
|
||||
328
Archiv/EDKB01ZV/Backup/Service1.vb
Normal file
328
Archiv/EDKB01ZV/Backup/Service1.vb
Normal file
@@ -0,0 +1,328 @@
|
||||
Imports System.ServiceProcess
|
||||
Imports System.Threading
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports System.IO.File
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
|
||||
|
||||
Public Class Service1
|
||||
Inherits System.ServiceProcess.ServiceBase
|
||||
|
||||
#Region " Vom Component Designer generierter Code "
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
' Dieser Aufruf wird vom Komponenten-Designer benötigt.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungscode hinter dem InitializeComponent()-Aufruf ein
|
||||
|
||||
End Sub
|
||||
|
||||
'UserService überschreibt den Löschvorgang zum Bereinigen der Komponentenliste.
|
||||
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing Then
|
||||
If Not (components Is Nothing) Then
|
||||
components.Dispose()
|
||||
End If
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
' Der Haupteinstiegspunkt für den Vorgang
|
||||
<MTAThread()> _
|
||||
Shared Sub Main()
|
||||
|
||||
|
||||
'#If DEBUG Then
|
||||
' Dim service As New Service1
|
||||
' service.StartService()
|
||||
' System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite)
|
||||
'#Else
|
||||
' Dim ServicesToRun() As System.ServiceProcess.ServiceBase
|
||||
' ServicesToRun = New System.ServiceProcess.ServiceBase() {New Service1}
|
||||
' System.ServiceProcess.ServiceBase.Run(ServicesToRun)
|
||||
'#End If
|
||||
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
|
||||
ServicesToRun = New System.ServiceProcess.ServiceBase() {New Service1}
|
||||
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Für Komponenten-Designer erforderlich
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
' HINWEIS: Die folgende Prozedur wird vom Komponenten-Designer benötigt.
|
||||
' Sie kann mit dem Komponenten-Designer modifiziert werden. Verwenden Sie nicht
|
||||
' den Code-Editor zur Bearbeitung.
|
||||
Friend WithEvents chktimer As System.Timers.Timer
|
||||
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
||||
Me.chktimer = New System.Timers.Timer
|
||||
CType(Me.chktimer, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
'
|
||||
'chktimer
|
||||
'
|
||||
Me.chktimer.Enabled = True
|
||||
'
|
||||
'Service1
|
||||
'
|
||||
Me.ServiceName = "EDKB01ZV"
|
||||
CType(Me.chktimer, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Deklarationen"
|
||||
Dim FileWatch As New FileSystemWatcher()
|
||||
Public m_Log As bms.Logging
|
||||
|
||||
Public Enum ENUM_InfoTyp
|
||||
Typ_Information = 1
|
||||
Typ_Error = 3
|
||||
Typ_Warning = 2
|
||||
End Enum
|
||||
|
||||
Public Enum ENUM_LogTyp
|
||||
Eventlog = 1
|
||||
Journal = 2
|
||||
Beide = 3
|
||||
End Enum
|
||||
|
||||
Public Enum ENUM_LogStatus
|
||||
<CLSCompliant(False)> _New = 1
|
||||
<CLSCompliant(False)> _Close = 2
|
||||
<CLSCompliant(False)> _Restart = 3
|
||||
End Enum
|
||||
#End Region
|
||||
|
||||
Protected Overrides Sub OnStart(ByVal args() As String)
|
||||
Dim db As New EDOKA.DB_Connection()
|
||||
'Filewatcher initialisieren
|
||||
Thread.Sleep(3000)
|
||||
Try
|
||||
LogInstanz(ENUM_LogStatus._New)
|
||||
Catch ex As Exception
|
||||
WirteLog("BMS-Connection / XML: " + ex.Message, ApplicationPath() + "Error.txt")
|
||||
Exit Sub
|
||||
End Try
|
||||
|
||||
|
||||
Params.Loadparameters()
|
||||
PrintLog("EDKB01ZV gestartet", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
Me.chktimer.Interval = Params.TimerIntervall
|
||||
Me.chktimer.Enabled = True
|
||||
PrintLog("Timer Initialisiert", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
Try
|
||||
FileWatch.Path = Params.WatchDirectory
|
||||
FileWatch.IncludeSubdirectories = False
|
||||
FileWatch.Filter = "zv*.txt"
|
||||
AddHandler FileWatch.Created, New FileSystemEventHandler(AddressOf OnFileEvent)
|
||||
Me.FileWatch.EnableRaisingEvents = True
|
||||
PrintLog("Überwachung gestartet...", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
Catch ex As Exception
|
||||
PrintLog("Fehler bei der Initialisierung des Filewacherobjekts auf " + Params.WatchDirectory, ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Error)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub WirteLog(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())
|
||||
StrWr.WriteLine("Fehlertext:" + stext)
|
||||
StrWr.Close()
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Function ApplicationPath() As String
|
||||
'Return Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
|
||||
Return Path.GetDirectoryName([Assembly].GetEntryAssembly().Location) + "\"
|
||||
End Function
|
||||
|
||||
Private Sub LogInstanz(ByVal Typ As ENUM_LogStatus)
|
||||
Select Case Typ
|
||||
Case ENUM_LogStatus._New
|
||||
m_Log = New bms.Logging(CInt(2), Common.Common.JobType.WatchJob)
|
||||
m_Log.Start()
|
||||
Case ENUM_LogStatus._Close
|
||||
m_Log.Ende()
|
||||
m_Log = Nothing
|
||||
Case ENUM_LogStatus._Restart
|
||||
m_Log.Ende()
|
||||
m_Log = Nothing
|
||||
m_Log = New bms.Logging(CInt(2), Common.Common.JobType.WatchJob)
|
||||
m_Log.Start()
|
||||
PrintLog("Überwachung gestartet...", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
'Private Sub StartService()
|
||||
' Dim db As New EDOKA.DB_Connection
|
||||
' 'Filewatcher initialisieren
|
||||
|
||||
' m_Log = New bms.Logging(CInt(2), Common.Common.JobType.StartJob)
|
||||
' m_Log.Start()
|
||||
|
||||
' Params.Loadparameters()
|
||||
' PrintLog("EDKB01ZV gestartet", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
' Me.chktimer.Interval = Params.TimerIntervall
|
||||
' Me.chktimer.Enabled = True
|
||||
' PrintLog("Timer Initialisiert", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
' Try
|
||||
' FileWatch.Path = Params.WatchDirectory
|
||||
' FileWatch.IncludeSubdirectories = False
|
||||
' FileWatch.Filter = "zv*.txt"
|
||||
' AddHandler FileWatch.Created, New FileSystemEventHandler(AddressOf OnFileEvent)
|
||||
' Me.FileWatch.EnableRaisingEvents = True
|
||||
' PrintLog("Überwachung gestartet...", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
' Catch ex As Exception
|
||||
' PrintLog("Fehler bei der Initialisierung des Filewacherobjekts auf " + Params.WatchDirectory, ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Error)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
Private Sub OnFileEvent(ByVal source As Object, ByVal e As FileSystemEventArgs)
|
||||
Try
|
||||
|
||||
Me.chktimer.Enabled = False
|
||||
PrintLog("Datei zvdaten.txt wird angeliefert - " + LTrim(Str(Params.Wait_Before_Start_EDKB01 / 60 / 1000)) + " Minuten warten", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
Thread.Sleep(Params.Wait_Before_Start_EDKB01)
|
||||
|
||||
Dim di As New IO.DirectoryInfo(Params.WatchDirectory)
|
||||
Dim diar1 As IO.FileInfo() = di.GetFiles("zvi*.txt")
|
||||
Dim diar2 As IO.FileInfo() = di.GetFiles("zvc*.txt")
|
||||
Dim dra As IO.FileInfo
|
||||
|
||||
'zvindex.txt File einlesen
|
||||
|
||||
For Each dra In diar1
|
||||
File.Copy(e.FullPath, Params.SaveDir + Format(Now, "yyyyMMddHHmmss") + "_" + e.Name)
|
||||
PrintLog("Datei " + e.FullPath + " gesichert", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
If e.FullPath = "D:\EDOKA\EDKB01\zvIndex.txt" Then
|
||||
Dim i As Integer
|
||||
i = Shell(Globals.ApplicationPath + Params.ParamsEDKB01, AppWinStyle.NormalFocus, True)
|
||||
File.Copy(Params.WatchDirectory + "HostIndex.ok", Params.SaveDir + Format(Now, "yyyyMMddHHmmss") + "_HostIndex.ok")
|
||||
If Now.Hour > 8 Then
|
||||
File.Delete(Params.WatchDirectory + "HostIndex.ok")
|
||||
PrintLog("Datei " + Params.WatchDirectory + "HostIndex.ok gelöscht", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
End If
|
||||
Sendmail(Params.MailAdresseOK, 0)
|
||||
LogInstanz(ENUM_LogStatus._Restart)
|
||||
End If
|
||||
If e.FullPath = "D:\EDOKA\EDKB01\zvcheckIndex.txt" Then
|
||||
File.Delete(Params.WatchDirectory + "zvcheckIndex.txt")
|
||||
End If
|
||||
Me.chktimer.Enabled = True
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
PrintLog("Fehler: " + ex.Message, ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Error)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Sub OnStop()
|
||||
' Hier Code zum Ausführen notwendiger Löschvorgänge zum Anhalten des Dienstes einfügen.
|
||||
Me.FileWatch.EnableRaisingEvents = False
|
||||
Me.chktimer.Enabled = False
|
||||
PrintLog("Service gestoppt", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Information)
|
||||
LogInstanz(ENUM_LogStatus._Close)
|
||||
End Sub
|
||||
|
||||
#Region "Utils"
|
||||
|
||||
'Dim EVLog As New EventLog("EDKB01ZV")
|
||||
|
||||
'Public Sub PrintLog(ByVal message As String, Optional ByVal eventmessage As EventLogEntryType = EventLogEntryType.Information)
|
||||
' Try
|
||||
' If Not EVLog.SourceExists("EDKB01ZV") Then
|
||||
' EVLog.CreateEventSource("EDKB01ZV", "EDKB01ZV")
|
||||
' End If
|
||||
' EVLog.Source = "EDKB01ZV"
|
||||
' EVLog.WriteEntry(EVLog.Source, message, eventmessage)
|
||||
' Catch ex As Exception
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
Public Sub PrintLog(ByVal message As String, ByVal sTyp As ENUM_LogTyp, ByVal eventmessage As ENUM_InfoTyp)
|
||||
If sTyp = ENUM_LogTyp.Journal Or sTyp = ENUM_LogTyp.Beide Then
|
||||
Try
|
||||
m_Log.Log(message, eventmessage)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
If sTyp = ENUM_LogTyp.Eventlog Or sTyp = ENUM_LogTyp.Beide Then
|
||||
Dim iError As EventLogEntryType
|
||||
Select Case eventmessage
|
||||
Case ENUM_InfoTyp.Typ_Warning
|
||||
iError = EventLogEntryType.Warning
|
||||
Case ENUM_InfoTyp.Typ_Error
|
||||
iError = EventLogEntryType.Error
|
||||
Case Else
|
||||
iError = EventLogEntryType.Information
|
||||
End Select
|
||||
Try
|
||||
Dim eventl As New EventLog
|
||||
If Diagnostics.EventLog.SourceExists("EDKB01ZV") = False Then
|
||||
Diagnostics.EventLog.CreateEventSource("EDKB01ZV", "EDKB01ZV")
|
||||
End If
|
||||
eventl.BeginInit()
|
||||
Diagnostics.EventLog.WriteEntry("EDKB01ZV", message, iError)
|
||||
eventl.EndInit()
|
||||
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub chktimer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles chktimer.Elapsed
|
||||
If e.SignalTime.Hour > 9 And e.SignalTime.Hour < 19 Then
|
||||
CheckErrorDoks()
|
||||
m_Log.Log("Innerhalb der letzten " + LTrim(Str(Params.TimerIntervall / 60 / 1000)) + " Minuten wurden keine ZV-Daten angeliefert / " + Format(Now, "yyyyMMddHHmmss"), Common.Common.JournalEntryType.Error)
|
||||
LogInstanz(ENUM_LogStatus._Restart)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CheckErrorDoks()
|
||||
Try
|
||||
Dim di As New IO.DirectoryInfo(Params.WatchDirectory)
|
||||
Dim diar1 As IO.FileInfo() = di.GetFiles("zv*.txt")
|
||||
Dim dra As IO.FileInfo
|
||||
For Each dra In diar1
|
||||
File.Move(Params.WatchDirectory + dra.Name, Params.SaveDirError + Format(Now, "yyyyMMddHHmmss") + "_" + dra.Name)
|
||||
PrintLog("Datei " + Params.WatchDirectory + dra.Name + " gesichert", ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Error)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Function Sendmail(ByVal email As String, ByVal msg As Integer) As Boolean
|
||||
Dim m_Common As New Common.Common
|
||||
Dim meldung As String = ""
|
||||
Dim betreff As String = ""
|
||||
|
||||
Select Case msg
|
||||
Case 0
|
||||
betreff = "EDKB01ZV - Return 0: EDKB01ZV Erfolgreich beendet / " + Format(Now, "yyyyMMddHHmmss")
|
||||
meldung = "EDKB01ZV - Return 0: EDKB01ZV Erfolgreich beendet."
|
||||
End Select
|
||||
Try
|
||||
m_Common.SendMail(email, betreff, meldung)
|
||||
Sendmail = True
|
||||
Catch ex As Exception
|
||||
Sendmail = False
|
||||
PrintLog("Fehler: " + ex.Message, ENUM_LogTyp.Beide, ENUM_InfoTyp.Typ_Error)
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
289
Archiv/EDKB01ZV/Backup/clsConnectionProvider.vb
Normal file
289
Archiv/EDKB01ZV/Backup/clsConnectionProvider.vb
Normal 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>
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the Dispose functionality.
|
||||
' /// </summary>
|
||||
Overridable Overloads Protected 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(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(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(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(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
|
||||
202
Archiv/EDKB01ZV/Backup/clsDBInteractionBase.vb
Normal file
202
Archiv/EDKB01ZV/Backup/clsDBInteractionBase.vb
Normal file
@@ -0,0 +1,202 @@
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Base class for Database Interaction.
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:25
|
||||
' // Because this class implements IDisposable, derived classes shouldn't do so.
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Error Enums used by this LLBL library.
|
||||
' /// </summary>
|
||||
Public Enum LLBLError
|
||||
AllOk
|
||||
' // Add more here (check the comma's!)
|
||||
End Enum
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: General interface of the API generated. Contains only common methods of all classes.
|
||||
' /// </summary>
|
||||
Public Interface ICommonDBAccess
|
||||
Function Insert() As Boolean
|
||||
Function Update() As Boolean
|
||||
Function Delete() As Boolean
|
||||
Function SelectOne() As DataTable
|
||||
Function SelectAll() As DataTable
|
||||
End Interface
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Abstract base class for Database Interaction classes.
|
||||
' /// </summary>
|
||||
Public MustInherit Class clsDBInteractionBase
|
||||
Implements IDisposable
|
||||
Implements ICommonDBAccess
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Protected m_scoMainConnection As SqlConnection
|
||||
Protected m_iErrorCode As SqlInt32
|
||||
Protected m_bMainConnectionIsCreatedLocal As Boolean
|
||||
Protected m_cpMainConnectionProvider As clsConnectionProvider
|
||||
Private m_sConnectionString As String
|
||||
Private m_bIsDisposed As Boolean
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Class constructor.
|
||||
' /// </summary>
|
||||
Public Sub New()
|
||||
' // Initialize the class' members.
|
||||
InitClass()
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Initializes class members.
|
||||
' /// </summary>
|
||||
Private Sub InitClass()
|
||||
' // create all the objects and initialize other members.
|
||||
m_scoMainConnection = new SqlConnection()
|
||||
m_bMainConnectionIsCreatedLocal = True
|
||||
m_cpMainConnectionProvider = Nothing
|
||||
m_iErrorCode = New SqlInt32(LLBLError.AllOk)
|
||||
m_bIsDisposed = False
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the IDispose' method Dispose.
|
||||
' /// </summary>
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the Dispose functionality.
|
||||
' /// </summary>
|
||||
Overridable Overloads Protected 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 m_bMainConnectionIsCreatedLocal Then
|
||||
' // Object is created in this class, so destroy it here.
|
||||
m_scoMainConnection.Close()
|
||||
m_scoMainConnection.Dispose()
|
||||
m_bMainConnectionIsCreatedLocal = True
|
||||
End If
|
||||
m_cpMainConnectionProvider = Nothing
|
||||
m_scoMainConnection = Nothing
|
||||
End If
|
||||
End If
|
||||
m_bIsDisposed = True
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Insert() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Insert() As Boolean Implements ICommonDBAccess.Insert
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Delete() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Delete() As Boolean Implements ICommonDBAccess.Delete
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Update() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Update() As Boolean Implements ICommonDBAccess.Update
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.SelectOne() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function SelectOne() As DataTable Implements ICommonDBAccess.SelectOne
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.SelectAll() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function SelectAll() As DataTable Implements ICommonDBAccess.SelectAll
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public WriteOnly Property cpMainConnectionProvider() As clsConnectionProvider
|
||||
Set(ByVal Value As clsConnectionProvider)
|
||||
If Value Is Nothing Then
|
||||
' // Invalid value
|
||||
Throw New ArgumentNullException("cpMainConnectionProvider", "Nothing passed as value to this property which is not allowed.")
|
||||
End If
|
||||
|
||||
' // A connection provider object is passed to this class.
|
||||
' // Retrieve the SqlConnection object, if present and create a
|
||||
' // reference to it. If there is already a MainConnection object
|
||||
' // referenced by the membervar, destroy that one or simply
|
||||
' // remove the reference, based on the flag.
|
||||
If Not (m_scoMainConnection Is Nothing) Then
|
||||
' // First get rid of current connection object. Caller is responsible
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Is local created object, close it and dispose it.
|
||||
m_scoMainConnection.Close()
|
||||
m_scoMainConnection.Dispose()
|
||||
End If
|
||||
' // Remove reference.
|
||||
m_scoMainConnection = Nothing
|
||||
End If
|
||||
m_cpMainConnectionProvider = CType(Value, clsConnectionProvider)
|
||||
m_scoMainConnection = m_cpMainConnectionProvider.scoDBConnection
|
||||
m_bMainConnectionIsCreatedLocal = False
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property iErrorCode() As SqlInt32
|
||||
Get
|
||||
Return m_iErrorCode
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public Property sConnectionString() As String
|
||||
Get
|
||||
Return m_sConnectionString
|
||||
End Get
|
||||
Set (ByVal Value As String)
|
||||
m_sConnectionString = Value
|
||||
m_scoMainConnection.ConnectionString = m_sConnectionString
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
18
Archiv/EDKB01ZV/Backup/db_connection.vb
Normal file
18
Archiv/EDKB01ZV/Backup/db_connection.vb
Normal file
@@ -0,0 +1,18 @@
|
||||
Imports System.ComponentModel
|
||||
Imports Microsoft.VisualBasic
|
||||
|
||||
Namespace EDOKA
|
||||
Public Class DB_Connection
|
||||
Shared Sub New()
|
||||
oread = IO.File.OpenText(Globals.ApplicationPath + "edokaconn.cfg")
|
||||
sConnectionString_edoka = oread.ReadLine
|
||||
Globals.sConnectionString_edoka = sConnectionString_edoka
|
||||
oread.Close()
|
||||
|
||||
Globals.conn_edoka.sConnectionString = sConnectionString_edoka
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user