commit 2907057decd532931a33ec8c2a651fd352d7dd37 Author: SchreiberM Date: Wed Jan 11 13:35:10 2017 +0100 MS11012016 diff --git a/DD_PROXY_SYNC.sln b/DD_PROXY_SYNC.sln new file mode 100644 index 0000000..eb157a6 --- /dev/null +++ b/DD_PROXY_SYNC.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DD_PROXY_SYNC", "DD_PROXY_SYNC\DD_PROXY_SYNC.vbproj", "{DF86B67C-D3BB-455E-A281-911B9771DCF8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DF86B67C-D3BB-455E-A281-911B9771DCF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF86B67C-D3BB-455E-A281-911B9771DCF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF86B67C-D3BB-455E-A281-911B9771DCF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF86B67C-D3BB-455E-A281-911B9771DCF8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DD_PROXY_SYNC/App.config b/DD_PROXY_SYNC/App.config new file mode 100644 index 0000000..711e100 --- /dev/null +++ b/DD_PROXY_SYNC/App.config @@ -0,0 +1,22 @@ + + + + +
+ + + + + + + + + + + + False + + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/DD_PROXY_SYNC.vbproj b/DD_PROXY_SYNC/DD_PROXY_SYNC.vbproj new file mode 100644 index 0000000..fe33053 --- /dev/null +++ b/DD_PROXY_SYNC/DD_PROXY_SYNC.vbproj @@ -0,0 +1,136 @@ + + + + + Debug + AnyCPU + {DF86B67C-D3BB-455E-A281-911B9771DCF8} + WinExe + DD_PROXY_SYNC.DD_PROXY_SERV + DD_PROXY_SYNC + DD_PROXY_SYNC + 512 + Console + v4.5.1 + true + + + AnyCPU + true + full + true + true + bin\Debug\ + DD_PROXY_SYNC.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + DD_PROXY_SYNC.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + ProjectInstaller.vb + + + Component + + + Component + + + Service1.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + ProjectInstaller.vb + + + Service1.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/My Project/Application.Designer.vb b/DD_PROXY_SYNC/My Project/Application.Designer.vb new file mode 100644 index 0000000..c5ce9c8 --- /dev/null +++ b/DD_PROXY_SYNC/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.36366 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/DD_PROXY_SYNC/My Project/Application.myapp b/DD_PROXY_SYNC/My Project/Application.myapp new file mode 100644 index 0000000..59bc36e --- /dev/null +++ b/DD_PROXY_SYNC/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 3 + true + diff --git a/DD_PROXY_SYNC/My Project/AssemblyInfo.vb b/DD_PROXY_SYNC/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..19581fb --- /dev/null +++ b/DD_PROXY_SYNC/My Project/AssemblyInfo.vb @@ -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 + + + + + + + + + + +'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird + + +' 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: +' + + + diff --git a/DD_PROXY_SYNC/My Project/Resources.Designer.vb b/DD_PROXY_SYNC/My Project/Resources.Designer.vb new file mode 100644 index 0000000..3cdb05c --- /dev/null +++ b/DD_PROXY_SYNC/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.36366 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +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. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + 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("DD_PROXY_SYNC.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + 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 diff --git a/DD_PROXY_SYNC/My Project/Resources.resx b/DD_PROXY_SYNC/My Project/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/DD_PROXY_SYNC/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/My Project/Settings.Designer.vb b/DD_PROXY_SYNC/My Project/Settings.Designer.vb new file mode 100644 index 0000000..9f8e0d3 --- /dev/null +++ b/DD_PROXY_SYNC/My Project/Settings.Designer.vb @@ -0,0 +1,93 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.36366 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "Funktion zum automatischen Speichern von My.Settings" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + 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 + + _ + Public ReadOnly Property LOG_ERRORS_ONLY() As Boolean + Get + Return CType(Me("LOG_ERRORS_ONLY"),Boolean) + End Get + End Property + + _ + Public ReadOnly Property MyConnectionString() As String + Get + Return CType(Me("MyConnectionString"),String) + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.DD_PROXY_SYNC.My.MySettings + Get + Return Global.DD_PROXY_SYNC.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/DD_PROXY_SYNC/My Project/Settings.settings b/DD_PROXY_SYNC/My Project/Settings.settings new file mode 100644 index 0000000..5616c20 --- /dev/null +++ b/DD_PROXY_SYNC/My Project/Settings.settings @@ -0,0 +1,17 @@ + + + + + + False + + + <?xml version="1.0" encoding="utf-16"?> +<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConnectionString>Data Source=SDD-VMX04-DB01\TESTS;Persist Security Info=True;User ID=sa;Password=dd</ConnectionString> + <ProviderName>System.Data.SqlClient</ProviderName> +</SerializableConnectionString> + Data Source=SDD-VMX04-DB01\TESTS;Persist Security Info=True;User ID=sa;Password=dd + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/ProjectInstaller.Designer.vb b/DD_PROXY_SYNC/ProjectInstaller.Designer.vb new file mode 100644 index 0000000..27b7c43 --- /dev/null +++ b/DD_PROXY_SYNC/ProjectInstaller.Designer.vb @@ -0,0 +1,47 @@ + Partial Class ProjectInstaller + Inherits System.Configuration.Install.Installer + + 'Installer überschreibt den Löschvorgang zum Bereinigen der Komponentenliste. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Komponenten-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Komponenten-Designer erforderlich. + 'Das Bearbeiten ist mit dem Komponenten-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + Me.ServiceProcessInstaller1 = New System.ServiceProcess.ServiceProcessInstaller() + Me.ServiceInstaller1 = New System.ServiceProcess.ServiceInstaller() + ' + 'ServiceProcessInstaller1 + ' + Me.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem + Me.ServiceProcessInstaller1.Password = Nothing + Me.ServiceProcessInstaller1.Username = Nothing + ' + 'ServiceInstaller1 + ' + Me.ServiceInstaller1.Description = "Service for synchronizing Proxydata with Mainserver" + Me.ServiceInstaller1.DisplayName = "DDProxySync" + Me.ServiceInstaller1.ServiceName = "DD_PROXY_SYNC" + ' + 'ProjectInstaller + ' + Me.Installers.AddRange(New System.Configuration.Install.Installer() {Me.ServiceProcessInstaller1, Me.ServiceInstaller1}) + + End Sub + Friend WithEvents ServiceProcessInstaller1 As System.ServiceProcess.ServiceProcessInstaller + Friend WithEvents ServiceInstaller1 As System.ServiceProcess.ServiceInstaller + +End Class diff --git a/DD_PROXY_SYNC/ProjectInstaller.resx b/DD_PROXY_SYNC/ProjectInstaller.resx new file mode 100644 index 0000000..0986366 --- /dev/null +++ b/DD_PROXY_SYNC/ProjectInstaller.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 197, 17 + + + False + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/ProjectInstaller.vb b/DD_PROXY_SYNC/ProjectInstaller.vb new file mode 100644 index 0000000..2785a80 --- /dev/null +++ b/DD_PROXY_SYNC/ProjectInstaller.vb @@ -0,0 +1,16 @@ +Imports System.ComponentModel +Imports System.Configuration.Install + +Public Class ProjectInstaller + + Public Sub New() + MyBase.New() + + 'Dieser Aufruf ist für den Komponenten-Designer erforderlich. + InitializeComponent() + + 'Initialisierungscode nach dem Aufruf von InitializeComponent hinzufügen + + End Sub + +End Class diff --git a/DD_PROXY_SYNC/Service1.Designer.vb b/DD_PROXY_SYNC/Service1.Designer.vb new file mode 100644 index 0000000..6ca1e23 --- /dev/null +++ b/DD_PROXY_SYNC/Service1.Designer.vb @@ -0,0 +1,51 @@ +Imports System.ServiceProcess + + _ +Partial Class DD_PROXY_SERV + Inherits System.ServiceProcess.ServiceBase + + 'UserService überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + ' Der Haupteinstiegspunkt für den Prozess + _ + _ + Shared Sub Main() + Dim ServicesToRun() As System.ServiceProcess.ServiceBase + + ' Innerhalb eines Prozesses können mehrere NT-Dienste ausgeführt werden. Um einen + ' weiteren Dienst zu diesem Prozess hinzuzufügen, ändern Sie die folgende Zeile, + ' um ein zweites Dienstobjekt zu erstellen. Zum Beispiel + ' + ' ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1, New MySecondUserService} + ' + ServicesToRun = New System.ServiceProcess.ServiceBase() {New DD_PROXY_SERV} + + System.ServiceProcess.ServiceBase.Run(ServicesToRun) + End Sub + + 'Wird vom Komponenten-Designer benötigt. + Private components As System.ComponentModel.IContainer + + ' Hinweis: Die folgende Prozedur ist für den Komponenten-Designer erforderlich. + ' Das Bearbeiten ist mit dem Komponenten-Designer möglich. + ' Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + ' + 'DD_PROXY_SERV + ' + Me.ServiceName = "DD_PROXY_SYNC" + + End Sub + +End Class diff --git a/DD_PROXY_SYNC/Service1.resx b/DD_PROXY_SYNC/Service1.resx new file mode 100644 index 0000000..34987b2 --- /dev/null +++ b/DD_PROXY_SYNC/Service1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/Service1.vb b/DD_PROXY_SYNC/Service1.vb new file mode 100644 index 0000000..3ba69fc --- /dev/null +++ b/DD_PROXY_SYNC/Service1.vb @@ -0,0 +1,103 @@ +Imports System.ComponentModel +Imports System.Data.SqlClient +Public Class DD_PROXY_SERV +#Region "+++++ Variablen +++++" + 'Variablen + Public Shared threadRunner As BackgroundWorker +#End Region + Protected Overrides Sub OnStart(ByVal args() As String) + ' Code zum Starten des Dienstes hier einfügen. Diese Methode sollte Vorgänge + ' ausführen, damit der Dienst gestartet werden kann. + ' Start the thread. + Try + clsLogger.Init(My.Application.Info.DirectoryPath & "\Log", "logPROXY_SYNC_") + clsLogger.Add("## PMO-Service started - " & Now & " ## ", False) + + If My.Settings.MyConnectionString = String.Empty Then + clsLogger.Add("NO CONNECTIONSTRING CONFIGURED.", True) + Else + If clsDatabase.Init = False Then + clsLogger.Add("ATTENTION: No Connection was established '" & My.Settings.MyConnectionString & "'!", True) + Else + If My.Settings.LOG_ERRORS_ONLY = False Then + clsLogger.Add(">> Detail-Log is on!", False) + End If + '### Thread für Durchlauf generieren + DD_PROXY_SERV.threadRunner = New BackgroundWorker() + DD_PROXY_SERV.threadRunner.WorkerReportsProgress = True + DD_PROXY_SERV.threadRunner.WorkerSupportsCancellation = True + AddHandler threadRunner.DoWork, AddressOf RUN_THREAD + AddHandler threadRunner.RunWorkerCompleted, AddressOf Thread_Completed + ' Und den Durchlauf das erste Mal starten + threadRunner.RunWorkerAsync() + End If + End If + Catch ex As Exception + clsLogger.AddError(ex.Message, "OnStart") + End Try + End Sub + + Private Shared Sub Thread_Completed(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) 'Handles threadDateiimport.RunWorkerCompleted + ' This event fires when the DoWork event completes + Try + Dim result As String = "" + If e.Cancelled Then + clsLogger.Add("## The thread was cancelled", False) + ElseIf e.Error IsNot Nothing Then + clsLogger.Add("Unexpected Error in Run Thread. The run will be terminated.", True, "Thread_Completed") + clsLogger.Add(e.Error.Message, True, "Thread_Completed") + End If + Catch ex As Exception + clsLogger.AddError(ex.Message, "Thread_Completed") + End Try + clsLogger.WriteLog() + End Sub + Protected Overrides Sub OnStop() + ' Hier Code zum Ausführen erforderlicher Löschvorgänge zum Beenden des Dienstes einfügen. + ' Hier Code zum Ausführen erforderlicher Löschvorgänge zum Beenden des Dienstes einfügen. + 'EventLog1.WriteEntry("Dienst 'DD windream Result Handler' gestoppt") + clsLogger.Add("", False) + clsLogger.Add("## Service was stopped - " & Now & " ## ", False) + clsLogger.Add("", False) + clsLogger.WriteLog() + End Sub + Public Shared Sub RUN_THREAD(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) + Try + If clsDatabase.Init() = True Then + Dim sql = "select * from TBPROXY_SYNC_PROCEDURES" + Dim DT_PROCEDURES As DataTable = clsDatabase.Return_Datatable(sql) + If Not IsNothing(DT_PROCEDURES) Then + If DT_PROCEDURES.Rows.Count > 0 Then + 'Wenn Zeilen enthalten..... + For Each syncRow As DataRow In DT_PROCEDURES.Rows + clsLogger.AddDetailLog(">> Executing Procedure: " & syncRow.Item("PROC_NAME").ToString & " ...") + EXECUTE_ROCEDURE(syncRow.Item("PROC_NAME").ToString) + Next + End If + Else + clsLogger.Add("- NO SYNC PROCEDURES!", False) + End If + End If + Catch ex As Exception + clsLogger.AddError("Uncexpected Error: " & ex.Message, "RUN_THREAD") + Finally + clsLogger.WriteLog() + End Try + End Sub + Public Shared Function EXECUTE_ROCEDURE(PROXY_PROCEDURE As String) + Dim sel = String.Format("DECLARE @return_value int" & vbNewLine & _ + "EXEC @return_value = [dbo].[{0}]" & vbNewLine & _ + "SELECT 'Return Value' = @return_value", PROXY_PROCEDURE) + clsLogger.AddDetailLog(">> ExecuteCommand: " & sel) + Dim Result As DataTable = clsDatabase.Return_Datatable(sel) + If Not IsNothing(Result) Then + If Result.Rows(0).Item(0) = 0 Then + Return True + Else + Return False + End If + Else + Return False + End If + End Function +End Class diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.exe b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.exe new file mode 100644 index 0000000..344ad20 Binary files /dev/null and b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.exe differ diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.exe.config b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.exe.config new file mode 100644 index 0000000..711e100 --- /dev/null +++ b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.exe.config @@ -0,0 +1,22 @@ + + + + +
+ + + + + + + + + + + + False + + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.pdb b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.pdb new file mode 100644 index 0000000..48fd9c6 Binary files /dev/null and b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.pdb differ diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe new file mode 100644 index 0000000..c0dfecc Binary files /dev/null and b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe differ diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe.config b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe.config new file mode 100644 index 0000000..711e100 --- /dev/null +++ b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe.config @@ -0,0 +1,22 @@ + + + + +
+ + + + + + + + + + + + False + + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe.manifest b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe.manifest new file mode 100644 index 0000000..f96b1d6 --- /dev/null +++ b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.xml b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.xml new file mode 100644 index 0000000..0ad3660 --- /dev/null +++ b/DD_PROXY_SYNC/bin/Debug/DD_PROXY_SYNC.xml @@ -0,0 +1,24 @@ + + + + +DD_PROXY_SYNC + + + + + + Returns the cached ResourceManager instance used by this class. + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/clsDatabase.vb b/DD_PROXY_SYNC/clsDatabase.vb new file mode 100644 index 0000000..0234ed0 --- /dev/null +++ b/DD_PROXY_SYNC/clsDatabase.vb @@ -0,0 +1,78 @@ +Public Class clsDatabase + Private Shared connectionString As String + + Public Shared Function Init() + Try + connectionString = My.Settings.MyConnectionString + Dim SQLconnect As New SqlClient.SqlConnection + SQLconnect.ConnectionString = connectionString + SQLconnect.Open() + SQLconnect.Close() + clsLogger.AddDetailLog("Database initialized") + Return True + Catch ex As Exception + clsLogger.Add("Unexpected Error in DatabaseInit: " & ex.Message, True) + Return False + End Try + End Function + + Public Shared Function Return_Datatable(Select_anweisung As String) + Try + Dim SQLconnect As New SqlClient.SqlConnection + Dim SQLcommand As SqlClient.SqlCommand + SQLconnect.ConnectionString = connectionString + SQLconnect.Open() + SQLcommand = SQLconnect.CreateCommand + SQLcommand.CommandText = Select_anweisung + + Dim adapter1 As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(SQLcommand) + Dim dt As DataTable = New DataTable() + adapter1.Fill(dt) + SQLconnect.Close() + Return dt + Catch ex As Exception + clsLogger.Add("Unexpected Error in Return_Datatable: " & ex.Message, True) + clsLogger.Add("SQL: " & Select_anweisung, False) + Return Nothing + End Try + End Function + Public Shared Function Execute_non_Query(ExecuteCMD As String) + Try + Dim SQLconnect As New SqlClient.SqlConnection + Dim SQLcommand As SqlClient.SqlCommand + SQLconnect.ConnectionString = connectionString + SQLconnect.Open() + SQLcommand = SQLconnect.CreateCommand + 'Update Last Created Record in Foo + SQLcommand.CommandText = ExecuteCMD + SQLcommand.ExecuteNonQuery() + SQLcommand.Dispose() + SQLconnect.Close() + Return True + Catch ex As Exception + clsLogger.Add("Unexpected Error in Execute_non_Query: " & ex.Message, True) + clsLogger.Add("SQL: " & ExecuteCMD, False) + Return False + End Try + End Function + Public Shared Function Execute_Scalar(cmdscalar As String) + Dim result + Try + Dim SQLconnect As New SqlClient.SqlConnection + Dim SQLcommand As SqlClient.SqlCommand + SQLconnect.ConnectionString = connectionString + SQLconnect.Open() + SQLcommand = SQLconnect.CreateCommand + 'Update Last Created Record in Foo + SQLcommand.CommandText = cmdscalar + result = SQLcommand.ExecuteScalar() + SQLcommand.Dispose() + SQLconnect.Close() + Return result + Catch ex As Exception + clsLogger.Add("Unexpected Error Execute_Scalar: " & ex.Message, True) + clsLogger.Add("SQL: " & cmdscalar, False) + Return Nothing + End Try + End Function +End Class diff --git a/DD_PROXY_SYNC/clsLogger.vb b/DD_PROXY_SYNC/clsLogger.vb new file mode 100644 index 0000000..5307fe4 --- /dev/null +++ b/DD_PROXY_SYNC/clsLogger.vb @@ -0,0 +1,155 @@ +Imports System.IO + +Public Class clsLogger + Private Shared LogPath As String + Private Shared LogFilename As String + Private Shared logErr_name As String + Private Shared log_string As String + Public Shared Function Init(ByVal speicherort As String, ByVal prefix As String) + Try + 'Den Speicherort festlegen + SetSpeicherort() + Dim logf_name As String = LogPath & "\" & prefix & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt" + logErr_name = LogPath & "\" & "ErrorLog_" & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt" + Dim anz As Integer = 1 + Do While File.Exists(logf_name) + Dim info As New FileInfo(logf_name) + Dim length As Long = info.Length + If length > 5000000 Then + logf_name = IO.Path.GetDirectoryName(logf_name) + logf_name = logf_name & "\" & prefix & System.DateTime.Now.ToString("yyyy_MM_dd") & "(" & anz.ToString & ").txt" + anz = anz + 1 + Else + Exit Do + End If + Loop + LogFilename = logf_name + Try + 'Veruch das Log zu öffnen + Dim fs As FileStream = New FileStream(LogFilename, FileMode.OpenOrCreate, FileAccess.Write) + ' --- Stream öffnen + Dim w As StreamWriter = New StreamWriter(fs) + ' --- Anfügen am Ende + w.BaseStream.Seek(0, SeekOrigin.End) + ' --- Zeilen schreiben + w.WriteLine("") + ' --- Writer und Stream schließen + w.Close() + fs.Close() + Catch ex As Exception + LogEscalation_Error("The Logfile could not be created - Error: " & ex.Message) + Return False + End Try + 'Alles Ok + Return True + Catch ex As Exception + LogEscalation_Error("Unexpected Error in init Logger - Error: " & ex.Message) + Return False + End Try + + End Function + Private Shared Sub LogEscalation_Error(msg As String) + Try + 'Veruch das Log zu öffnen + Dim fs As FileStream = New FileStream(logErr_name, FileMode.OpenOrCreate, FileAccess.Write) + ' --- Stream öffnen + Dim w As StreamWriter = New StreamWriter(fs) + ' --- Anfügen am Ende + w.BaseStream.Seek(0, SeekOrigin.End) + ' --- Zeilen schreiben + w.WriteLine(msg) + ' --- Writer und Stream schließen + w.Close() + fs.Close() + Catch ex As Exception + + End Try + End Sub + ' legt den Speicherort fest + Public Shared Sub SetSpeicherort() + Dim f As New IO.DirectoryInfo(My.Application.Info.DirectoryPath & "\Log") + If f.Exists = False Then + IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Log") + End If + LogPath = My.Application.Info.DirectoryPath & "\Log\" + End Sub + Public Shared Sub Add(ByVal text As String, ByVal _error As Boolean, Optional ByVal Funktion As String = "") + Dim msg As String + If log_string <> "" Then + log_string &= vbNewLine + End If + 'Präfixe schreiben + If _error = True And Funktion <> "" Then + msg = ">> Achtung Fehler in Funktion '" & Funktion & "'" & vbNewLine & "Fehlermeldung: " + ElseIf _error = True Then + msg = ">> Achtung Fehler:" & vbNewLine & "Fehlermeldung: " + End If + 'Präfix und Meldung zusammenstellen + msg &= text + log_string &= msg + End Sub + Public Shared Sub AddError(ByVal error_string As String, Optional ByVal Funktion As String = "") + Try + 'Zuerst mal die Details schreiben + WriteLog() + 'Nun den eigentlichen Fehler loggen + Dim msg As String + 'Präfixe schreiben + If Funktion <> "" Then + msg = ">> Achtung Fehler in Funktion '" & Funktion & "'" & vbNewLine & "Fehlermeldung: " + Else + msg = ">> Achtung Fehler:" & vbNewLine & "Fehlermeldung: " + End If + 'Präfix und Meldung zusammenstellen + msg &= error_string + 'Veruch das Log zu öffnen + Dim fs As FileStream = New FileStream(LogFilename, FileMode.OpenOrCreate, FileAccess.Write) + ' --- Stream öffnen + Dim w As StreamWriter = New StreamWriter(fs) + ' --- Anfügen am Ende + w.BaseStream.Seek(0, SeekOrigin.End) + ' --- Zeilen schreiben + w.WriteLine(msg) + ' --- Writer und Stream schließen + w.Close() + fs.Close() + Catch ex As Exception + LogEscalation_Error("Unexpected Error in AddError - Error: " & ex.Message) + End Try + + End Sub + + Public Shared Sub AddDetailLog(ByVal text As String) + Try + If My.Settings.LOG_ERRORS_ONLY = False Then + If log_string <> "" Then + log_string &= vbNewLine + End If + log_string &= " >> " & text + End If + Catch ex As Exception + LogEscalation_Error("Unexpected Error in AddDetailLog - Error: " & ex.Message) + End Try + End Sub + + Public Shared Sub WriteLog() + Try + 'Veruch das Log zu öffnen + Dim fs As FileStream = New FileStream(LogFilename, FileMode.OpenOrCreate, FileAccess.Write) + ' --- Stream öffnen + Dim w As StreamWriter = New StreamWriter(fs) + ' --- Anfügen am Ende + w.BaseStream.Seek(0, SeekOrigin.End) + ' --- Zeilen schreiben + w.WriteLine(log_string) + ' --- Writer und Stream schließen + w.Close() + fs.Close() + SetSpeicherort() + 'Den Meldungsstring wieder leeren + log_string = "" + Catch ex As Exception + LogEscalation_Error("Unexpected Error in WriteLog - Error: " & ex.Message) + End Try + End Sub +End Class diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.DD_PROXY_SERV.resources b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.DD_PROXY_SERV.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.DD_PROXY_SERV.resources differ diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.ProjectInstaller.resources b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.ProjectInstaller.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.ProjectInstaller.resources differ diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.Resources.resources b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.Resources.resources differ diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.exe b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.exe new file mode 100644 index 0000000..344ad20 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.exe differ diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.pdb b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.pdb new file mode 100644 index 0000000..48fd9c6 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.pdb differ diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.vbproj.FileListAbsolute.txt b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.vbproj.FileListAbsolute.txt new file mode 100644 index 0000000..5238543 --- /dev/null +++ b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.vbproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\bin\Debug\DD_PROXY_SYNC.exe.config +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\bin\Debug\DD_PROXY_SYNC.exe +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\bin\Debug\DD_PROXY_SYNC.pdb +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\bin\Debug\DD_PROXY_SYNC.xml +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.Resources.resources +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.ProjectInstaller.resources +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.DD_PROXY_SERV.resources +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.vbproj.GenerateResource.Cache +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.exe +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.xml +E:\SchreiberM\Visual Studio\GIT\DD_PROXY_SYNC\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.pdb +E:\SchreiberM\Visual Studio\GIT\DDProxySync\DD_PROXY_SYNC\bin\Debug\DD_PROXY_SYNC.exe.config +E:\SchreiberM\Visual Studio\GIT\DDProxySync\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.exe +E:\SchreiberM\Visual Studio\GIT\DDProxySync\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.xml +E:\SchreiberM\Visual Studio\GIT\DDProxySync\DD_PROXY_SYNC\obj\Debug\DD_PROXY_SYNC.pdb diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.vbproj.GenerateResource.Cache b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.vbproj.GenerateResource.Cache new file mode 100644 index 0000000..995101e Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.vbproj.GenerateResource.Cache differ diff --git a/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.xml b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.xml new file mode 100644 index 0000000..0ad3660 --- /dev/null +++ b/DD_PROXY_SYNC/obj/Debug/DD_PROXY_SYNC.xml @@ -0,0 +1,24 @@ + + + + +DD_PROXY_SYNC + + + + + + Returns the cached ResourceManager instance used by this class. + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + \ No newline at end of file diff --git a/DD_PROXY_SYNC/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/DD_PROXY_SYNC/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..d58fd74 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/DD_PROXY_SYNC/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/DD_PROXY_SYNC/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..f5a7331 Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/DD_PROXY_SYNC/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll b/DD_PROXY_SYNC/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll new file mode 100644 index 0000000..4f0425d Binary files /dev/null and b/DD_PROXY_SYNC/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll differ