MS
This commit is contained in:
commit
d9ddc61f10
63
.gitattributes
vendored
Normal file
63
.gitattributes
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
156
.gitignore
vendored
Normal file
156
.gitignore
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
x64/
|
||||
build/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
|
||||
!packages/*/build/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.log
|
||||
*.scc
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
*.ncrunch*
|
||||
.*crunch*.local.xml
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.Publish.xml
|
||||
|
||||
# NuGet Packages Directory
|
||||
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||
#packages/
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Others
|
||||
sql/
|
||||
*.Cache
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.[Pp]ublish.xml
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file to a newer
|
||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
App_Data/*.mdf
|
||||
App_Data/*.ldf
|
||||
|
||||
|
||||
#LightSwitch generated files
|
||||
GeneratedArtifacts/
|
||||
_Pvt_Extensions/
|
||||
ModelManifest.xml
|
||||
|
||||
# =========================
|
||||
# Windows detritus
|
||||
# =========================
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Mac desktop service store files
|
||||
.DS_Store
|
||||
7
.vs/VSWorkspaceState.json
Normal file
7
.vs/VSWorkspaceState.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"SelectedNode": "\\.gitignore",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
31
app/DD_PM_Server.sln
Normal file
31
app/DD_PM_Server.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26228.9
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DD_PM_Server", "DD_PM_Server\DD_PM_Server.vbproj", "{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
CD_ROM|x86 = CD_ROM|x86
|
||||
Debug|x86 = Debug|x86
|
||||
DVD-5|x86 = DVD-5|x86
|
||||
Release|x86 = Release|x86
|
||||
SingleImage|x86 = SingleImage|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.CD_ROM|x86.ActiveCfg = Release|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.CD_ROM|x86.Build.0 = Release|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.Debug|x86.Build.0 = Debug|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.DVD-5|x86.ActiveCfg = Debug|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.DVD-5|x86.Build.0 = Debug|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.Release|x86.ActiveCfg = Release|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.Release|x86.Build.0 = Release|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.SingleImage|x86.ActiveCfg = Release|x86
|
||||
{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}.SingleImage|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
76
app/DD_PM_Server/ClassDatabase.vb
Normal file
76
app/DD_PM_Server/ClassDatabase.vb
Normal file
@ -0,0 +1,76 @@
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class ClassDatabase
|
||||
Public Shared Function Execute_MSSQL(Sql As String)
|
||||
Try
|
||||
Dim Connection As SqlConnection
|
||||
Connection = New SqlConnection(My.Settings.SQLConnection)
|
||||
Dim Command As SqlCommand
|
||||
Command = New SqlCommand(Sql, Connection)
|
||||
' Verbindung zur Datenbank aufbauen
|
||||
Try
|
||||
Connection.Open()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Fehler in Execute_MSSQL DB aufbauen - Fehler: " & ex.Message, False)
|
||||
Connection.Close()
|
||||
Return False
|
||||
End Try
|
||||
|
||||
' SQL ausführen
|
||||
Command.ExecuteNonQuery()
|
||||
Connection.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' an dieser Stelle sollte jeder unvorhergesehene Fehler der Funktion abgefangen werden
|
||||
ClassLogger.Add("Unbekannter Fehler in Execute_MSSQL - Fehler: " & ex.Message, False)
|
||||
ClassLogger.Add("## SQL " & Sql, False)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function Execute_Scalar(Sql As String)
|
||||
Try
|
||||
Dim Connection As SqlConnection
|
||||
Connection = New SqlConnection(My.Settings.SQLConnection)
|
||||
Dim Command As SqlCommand
|
||||
Command = New SqlCommand(Sql, Connection)
|
||||
Dim result
|
||||
' Verbindung zur Datenbank aufbauen
|
||||
Try
|
||||
Connection.Open()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Fehler in Execute_MSSQL DB aufbauen - Fehler: " & ex.Message, False)
|
||||
Connection.Close()
|
||||
Return False
|
||||
End Try
|
||||
|
||||
'SQL ausführen
|
||||
result = Command.ExecuteScalar()
|
||||
Connection.Close()
|
||||
Return result
|
||||
Catch ex As Exception
|
||||
' an dieser Stelle sollte jeder unvorhergesehene Fehler der Funktion abgefangen werden
|
||||
ClassLogger.Add("Unbekannter Fehler in Execute_MSSQL - Fehler: " & ex.Message, False)
|
||||
ClassLogger.Add("## SQL " & Sql, False)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function Return_Datatable(Sql As String)
|
||||
Try
|
||||
Dim Connection As SqlConnection
|
||||
Connection = New SqlConnection(My.Settings.SQLConnection)
|
||||
Dim Command As SqlCommand
|
||||
Command = New SqlCommand(Sql, Connection)
|
||||
|
||||
|
||||
Dim adapter1 As SqlDataAdapter = New SqlDataAdapter(Command)
|
||||
Dim dt As DataTable = New DataTable()
|
||||
adapter1.Fill(dt)
|
||||
Connection.Close()
|
||||
Return dt
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unbekannter Fehler in Return_Datatable - Fehler: " & ex.Message, False)
|
||||
ClassLogger.Add("## SQL " & Sql, False)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
94
app/DD_PM_Server/ClassEmail.vb
Normal file
94
app/DD_PM_Server/ClassEmail.vb
Normal file
@ -0,0 +1,94 @@
|
||||
Imports System.Net.Mail
|
||||
Public Class ClassEmail
|
||||
Public Sub Send_Error_Mail(ByVal vBody As String)
|
||||
'#### E-MAIL NACHRICHT VERSENDEN
|
||||
Try
|
||||
Dim empfaenger As String()
|
||||
If My.Settings.Email_Empfaenger <> "" Then
|
||||
If My.Settings.Email_Empfaenger.Contains(";") Then
|
||||
empfaenger = My.Settings.Email_Empfaenger.Split(";")
|
||||
Else
|
||||
ReDim Preserve empfaenger(0)
|
||||
empfaenger(0) = My.Settings.Email_Empfaenger
|
||||
End If
|
||||
'Für jeden Empfänger eine Neue Mail erzeugen
|
||||
For Each _mailempfaenger As String In empfaenger
|
||||
' Neue Nachricht erzeugen:
|
||||
Dim message As New MailMessage(My.Settings.Email_From, _mailempfaenger, My.Settings.Email_Betreff & " Domain: " & Environment.UserDomainName, _
|
||||
"<font face=""Arial"">" & My.Settings.Email_Body & vBody & "<br>>> Maschine: " & Environment.MachineName & "<br>" & "<br>>> Domain-Name: " & Environment.UserDomainName & "<br>" & _
|
||||
"<br>>> Gesendet am: " & My.Computer.Clock.LocalTime.ToShortDateString & "-" & _
|
||||
My.Computer.Clock.LocalTime.ToLongTimeString & "</font>")
|
||||
' create and add the attachment(s) */
|
||||
'Dim logfile As String = ClassLogger.DateiSpeicherort & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt"
|
||||
'If logfile.Contains("\\") Then
|
||||
' logfile = logfile.Replace("\\", "\")
|
||||
'End If
|
||||
'Dim Attachment As Attachment = New Attachment(logfile)
|
||||
'message.Attachments.Add(Attachment)
|
||||
|
||||
With message
|
||||
.IsBodyHtml = True
|
||||
End With
|
||||
|
||||
'Einen SMTP Client erzeugen und Anmeldungsinformationen hinterlegen
|
||||
Dim emailClient As New SmtpClient(My.Settings.Email_SMTP)
|
||||
'Email mit Authentifizierung
|
||||
Dim SMTPUserInfo As New System.Net.NetworkCredential(My.Settings.Email_User, My.Settings.Email_PW) ', My.Settings.vDomain)
|
||||
emailClient.UseDefaultCredentials = False
|
||||
emailClient.Credentials = SMTPUserInfo
|
||||
emailClient.Port = 25
|
||||
|
||||
'*Send the message */
|
||||
emailClient.Send(message)
|
||||
ClassLogger.Add("==> Fehler Email erfolgreich an " & _mailempfaenger & " versendet!", False)
|
||||
ClassLogger.Add("==> Text: " & vBody, False)
|
||||
Next
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("### Fehler im Mailversand: " & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
Public Shared Function Send_Reminder_Mail(ByVal vBody As String, ByVal emailfrom As String, ByVal emailsmtp As String, ByVal emailuser As String, ByVal emailpw As String, ByVal email_empf As String, ByVal ReminderHeader As String, ByVal ReminderFooter As String)
|
||||
'#### E-MAIL NACHRICHT VERSENDEN
|
||||
Try
|
||||
Dim empfaenger As String()
|
||||
If email_empf.Contains(";") Then
|
||||
empfaenger = email_empf.Split(";")
|
||||
Else
|
||||
ReDim Preserve empfaenger(0)
|
||||
empfaenger(0) = email_empf
|
||||
End If
|
||||
'Für jeden Empfänger eine Neue Mail erzeugen
|
||||
For Each _mailempfaenger As String In empfaenger
|
||||
' Neue Nachricht erzeugen:
|
||||
Dim message As New MailMessage(My.Settings.Email_From, _mailempfaenger, My.Settings.Email_ReminderBetreff, _
|
||||
"<font face=""Arial"">" & ReminderHeader & vBody & ReminderFooter & "<p>" & _
|
||||
"Starten Sie den Process-Manager " & "<a href=" & My.Settings.Email_ReminderStartup & ">hier</a><br>" & _
|
||||
"<p>>> Gesendet am: " & My.Computer.Clock.LocalTime.ToShortDateString & "-" & _
|
||||
My.Computer.Clock.LocalTime.ToLongTimeString & "</font>")
|
||||
|
||||
With message
|
||||
.IsBodyHtml = True
|
||||
End With
|
||||
|
||||
'Einen SMTP Client erzeugen und Anmeldungsinformationen hinterlegen
|
||||
Dim emailClient As New SmtpClient(emailsmtp)
|
||||
'Email mit Authentifizierung
|
||||
Dim SMTPUserInfo As New System.Net.NetworkCredential(emailuser, emailpw) ', My.Settings.vDomain)
|
||||
emailClient.UseDefaultCredentials = False
|
||||
emailClient.Credentials = SMTPUserInfo
|
||||
emailClient.Port = 25
|
||||
|
||||
'*Send the message */
|
||||
emailClient.Send(message)
|
||||
ClassLogger.Add("==> Reminder Email erfolgreich an " & _mailempfaenger & " versendet!", False)
|
||||
Next
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("### Fehler im Reminder-Mailversand: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
205
app/DD_PM_Server/ClassLogger.vb
Normal file
205
app/DD_PM_Server/ClassLogger.vb
Normal file
@ -0,0 +1,205 @@
|
||||
Imports System.IO
|
||||
Public Class ClassLogger
|
||||
Public Shared DateiSpeicherort As String = Nothing
|
||||
Public Shared DateiPrefix As String = ""
|
||||
Private Shared Datei As IO.File = Nothing
|
||||
Private Shared Dateiname As String = ""
|
||||
Private Shared StreamWriter As IO.StreamWriter = Nothing
|
||||
Private Shared HasInformedAboutError As Boolean = False
|
||||
' eine Art Konstruktor
|
||||
Public Shared Sub Init(ByVal speicherort As String, Optional ByVal prefix As String = "", Optional ByVal appendFile As Boolean = True)
|
||||
' initialisiert den Speicherort
|
||||
ClassLogger.SetSpeicherort(speicherort)
|
||||
' wenn ein Prfix gesetzt wurde
|
||||
If Not prefix = "" Then
|
||||
' initialisiert das Prefix
|
||||
ClassLogger.SetPrefix(prefix)
|
||||
End If
|
||||
Dim str As String = ClassLogger.DateiSpeicherort & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt"
|
||||
If str.Contains("\\") Then
|
||||
str = str.Replace("\\", "\")
|
||||
End If
|
||||
Dim anz As Integer = 1
|
||||
Do While File.Exists(str)
|
||||
Dim info As New FileInfo(str)
|
||||
Dim length As Long = info.Length
|
||||
If length > 5000000 Then
|
||||
str = IO.Path.GetDirectoryName(str)
|
||||
str = str & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & "(" & anz.ToString & ").txt"
|
||||
anz = anz + 1
|
||||
Else
|
||||
Exit Do
|
||||
End If
|
||||
Loop
|
||||
If str.Contains("\\") Then
|
||||
str = str.Replace("\\", "\")
|
||||
End If
|
||||
ClassLogger.Dateiname = str
|
||||
If Not appendFile Then
|
||||
' der Versuch die Datei zu löschen
|
||||
'Try
|
||||
' My.Computer.FileSystem.DeleteFile(ClassNILogger.Dateiname, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
|
||||
'Catch ex As Exception
|
||||
' ' bei Fehler besteht kein Schreibrecht auf die Datei oder Datei existiert nicht
|
||||
' ' ALSO: alles Okay soweit
|
||||
'End Try
|
||||
My.Computer.FileSystem.WriteAllText(ClassLogger.Dateiname, String.Empty, False)
|
||||
End If
|
||||
' testen ob sich die Datei öffnen und beschreiben lässt
|
||||
'ClassNILogger.CheckIsLogWritable()
|
||||
End Sub
|
||||
|
||||
' legt den Speicherort fest
|
||||
Public Shared Sub SetSpeicherort(ByVal speicherort As String)
|
||||
Dim f As New IO.DirectoryInfo(My.Application.Info.DirectoryPath & "\Log")
|
||||
If speicherort = "" Then
|
||||
If f.Exists = False Then
|
||||
IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Log")
|
||||
End If
|
||||
ClassLogger.DateiSpeicherort = My.Application.Info.DirectoryPath & "\Log\"
|
||||
Else
|
||||
ClassLogger.DateiSpeicherort = speicherort
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' legt das Prefix für den Dateinamen fest
|
||||
Public Shared Sub SetPrefix(ByVal prefix As String)
|
||||
ClassLogger.DateiPrefix = prefix
|
||||
End Sub
|
||||
|
||||
Public Shared Sub Add(ByVal information As String, Optional ByVal mit_prefix As Boolean = True)
|
||||
If ClassLogger.OpenFile Then
|
||||
Try
|
||||
If mit_prefix Then
|
||||
ClassLogger.StreamWriter.WriteLine("Nachricht (" & System.DateTime.Now & "): " & information)
|
||||
Else
|
||||
ClassLogger.StreamWriter.WriteLine(information)
|
||||
End If
|
||||
ClassLogger.CloseFile()
|
||||
Catch e As Exception
|
||||
ClassLogger.ShowErrorMessage()
|
||||
End Try
|
||||
Else
|
||||
ClassLogger.ShowErrorMessage()
|
||||
End If
|
||||
End Sub
|
||||
Public Shared Sub Add(ByVal ex As Exception)
|
||||
If ClassLogger.OpenFile Then
|
||||
Try
|
||||
ClassLogger.StreamWriter.WriteLine("##### Exception (" & System.DateTime.Now & ")")
|
||||
ClassLogger.StreamWriter.WriteLine("##### Fehler: " & ex.Message & " Source [" & ex.Source & "]")
|
||||
ClassLogger.CloseFile()
|
||||
Catch e As Exception
|
||||
ClassLogger.ShowErrorMessage()
|
||||
End Try
|
||||
Else
|
||||
ClassLogger.ShowErrorMessage()
|
||||
End If
|
||||
End Sub
|
||||
' öffnet eine Datei zum Schreiben
|
||||
Private Shared Function OpenFile()
|
||||
Try
|
||||
' wenn ein Speicherort festgelegt wurde
|
||||
If Not ClassLogger.DateiSpeicherort = Nothing Then
|
||||
' den Dateienamen definieren
|
||||
Dim dateiname As String = ClassLogger.Dateiname
|
||||
' Datei anlegen wenn noch nicht vorhanden
|
||||
My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True)
|
||||
' die Datei zum Schreiben öffnen
|
||||
ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8)
|
||||
End If
|
||||
' wenn die Datei erfolgreich geöffnet wurde
|
||||
If ClassLogger.StreamWriter IsNot Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
' öffnet eine Datei zum Schreiben
|
||||
Private Shared Function OpenFile(ByVal DateiSpeicherort As String, ByVal DateiPrefix As String)
|
||||
Try
|
||||
' wenn ein Speicherort festgelegt wurde
|
||||
If Not DateiSpeicherort = Nothing And ClassLogger.CheckIsLogWritable() Then
|
||||
' den Dateienamen definieren
|
||||
Dim dateiname As String = ClassLogger.Dateiname
|
||||
' Datei anlegen wenn noch nicht vorhanden
|
||||
My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True)
|
||||
' die Datei zum Schreiben öffnen
|
||||
ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8)
|
||||
End If
|
||||
' wenn die Datei erfolgreich geöffnet wurde
|
||||
If ClassLogger.StreamWriter IsNot Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
' schliesst die geöffnete Datei
|
||||
Private Shared Sub CloseFile()
|
||||
|
||||
' wenn eine Datei geöffnet ist
|
||||
If ClassLogger.StreamWriter IsNot Nothing Then
|
||||
' die Datei schliessen
|
||||
ClassLogger.StreamWriter.Close()
|
||||
ClassLogger.StreamWriter = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Public Shared Function CheckIsLogWritable()
|
||||
|
||||
If ClassLogger.OpenFile Then
|
||||
Try
|
||||
ClassLogger.CloseFile()
|
||||
Catch e As Exception
|
||||
ClassLogger.ShowErrorMessage()
|
||||
Return False
|
||||
End Try
|
||||
Else
|
||||
ClassLogger.ShowErrorMessage()
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function CheckIsLogWritable(ByVal vDateiSpeicherort As String, ByVal vDateiPrefix As String)
|
||||
|
||||
If ClassLogger.OpenFile(vDateiSpeicherort, vDateiPrefix) Then
|
||||
Try
|
||||
ClassLogger.CloseFile()
|
||||
Catch e As Exception
|
||||
ClassLogger.ShowErrorMessage()
|
||||
Return False
|
||||
End Try
|
||||
Else
|
||||
ClassLogger.ShowErrorMessage()
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
Private Shared Sub ShowErrorMessage()
|
||||
If Not ClassLogger.HasInformedAboutError Then
|
||||
'MsgBox("Beim Öffnen der Logdatei ist ein Fehler aufgetreten. Bitte stellen Sie sicher das Sie sowohl über entsprechende Schreibrechte im Verzeichnis, als auch über ausreichend Speicherplatz zum Speichern der Logdatei verfügen." & _
|
||||
' vbNewLine & vbNewLine & "Es wird keine Logdatei angelegt oder beschrieben." & vbNewLine & vbNewLine & "Im folgenden werden Sie über Fehler, den Log betreffend nicht weiter informiert, um den Ablauf von " & My.Application.Info.ProductName & " nicht zu stören.", _
|
||||
' MsgBoxStyle.Information, "Fehler beim Öffnen der Logdatei")
|
||||
ClassLogger.HasInformedAboutError = True
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
188
app/DD_PM_Server/ClassPMWindream.vb
Normal file
188
app/DD_PM_Server/ClassPMWindream.vb
Normal file
@ -0,0 +1,188 @@
|
||||
Imports WINDREAMLib
|
||||
Imports WMOSRCHLib
|
||||
Public Class ClassPMWindream
|
||||
Inherits ClassWindream_allgemein
|
||||
Private email As New ClassEmail
|
||||
|
||||
#Region "+++++ Konstanten +++++"
|
||||
Protected Const WMObjectEditModeObject = &H1F
|
||||
Protected Const WMObjectStreamOpenModeReadWrite = 2
|
||||
Protected Const WMEntityObjectType = 10
|
||||
Protected Const WMEntityDocument = 1
|
||||
|
||||
Const WMObjectVariableValueTypeUndefined = 0
|
||||
Const WMObjectVariableValueTypeString = 1
|
||||
Const WMObjectVariableValueTypeInteger = 2
|
||||
Const WMObjectVariableValueTypeFloat = 3
|
||||
Const WMObjectVariableValueTypeBoolean = 4
|
||||
Const WMObjectVariableValueTypeDate = 5
|
||||
Const WMObjectVariableValueTypeFixedPoint = 6
|
||||
Const WMObjectVariableValueTypeTimeStamp = 7
|
||||
Const WMObjectVariableValueTypeCurrency = 8
|
||||
Const WMObjectVariableValueTypeTime = 9
|
||||
Const WMObjectVariableValueTypeVariant = 10
|
||||
Const WMObjectVariableValueTypeMask = &HFFF
|
||||
Const WMObjectVariableValueFlagMask = &HFFFFF000
|
||||
Const WMObjectVariableValueTypeVector = &H1000
|
||||
Const WMObjectVariableValueTypeFulltext = &H2000
|
||||
Const WMObjectVariableValueTypeDefaultValue = &H4000
|
||||
#End Region
|
||||
|
||||
#Region "+++++ Variablen +++++"
|
||||
Private oController As New WMOSearchController
|
||||
#End Region
|
||||
|
||||
#Region "+++++ Allgemeine Methoden und Funktionen +++++"
|
||||
Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
Private Function IsNotEmpty(ByVal aValue As Object)
|
||||
|
||||
If aValue IsNot Nothing Then
|
||||
Dim itsType As Type = aValue.GetType
|
||||
If itsType Is GetType(String) Then
|
||||
|
||||
If Not aValue = "" Then
|
||||
Return True
|
||||
End If
|
||||
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
End Function
|
||||
Private Function return_type(ByVal _wert As Object)
|
||||
Return _wert.GetType
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "+++++ Allgemeine Funktionen die Informationen zurückliefern +++++"
|
||||
|
||||
Public Function Get_No_Documents(Profil As String, WD_Search As String)
|
||||
Try
|
||||
|
||||
If System.IO.File.Exists(WD_Search) = False Then
|
||||
ClassLogger.Add(">> Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden! Die Datei '" & WD_Search & "' existiert nicht!", False)
|
||||
'MsgBox("Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden!" & vbNewLine & "Die Datei '" & WD_Search & "' existiert nicht!", MsgBoxStyle.Exclamation, "Achtung:")
|
||||
'wenn die gesuchte File eine Suche ist: per Mail informierne und Indexierung abbrechen
|
||||
If My.Settings.Email_senden = True Then
|
||||
email.Send_Error_Mail("Fehler in Get_No_Documents: <br> >> Profil: '" & Profil & "'<br> >> die windream-Suche : " & WD_Search & " konnte nicht gefunden werden!" & _
|
||||
"<br> >> Mögliche Fehlerursache: Das " & My.Settings.WD_LW & "-Laufwerk ist nicht verfügbar!")
|
||||
End If
|
||||
Return 0
|
||||
Else
|
||||
' windream-Suche für Profil starten
|
||||
Dim windreamSucheErgebnisse As WMObjects = Me.GetSearchDocuments(WD_Search)
|
||||
|
||||
If windreamSucheErgebnisse.Count > 0 Then
|
||||
' neue Anzahl von Dateien
|
||||
Return windreamSucheErgebnisse.Count
|
||||
Else
|
||||
' keine Dateien zum Importieren
|
||||
Return 0
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung: Fehler in Get_No_Documents: " & ex.Message)
|
||||
Return 0
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetSearchDocuments(ByVal wdfLocation As String)
|
||||
|
||||
If System.IO.File.Exists(wdfLocation) Then
|
||||
Dim Marker As String
|
||||
Try
|
||||
Dim ProfileName = wdfLocation.Substring(wdfLocation.LastIndexOf("\") + 1)
|
||||
Marker = "ProfileName: " & ProfileName
|
||||
Dim ProfilePath = wdfLocation.Substring(0, wdfLocation.Length - ProfileName.Length)
|
||||
Marker &= "ProfilePath: " & ProfilePath
|
||||
Me.oController.CheckSearchProfile(wdfLocation.ToLower)
|
||||
Dim suchTyp = Me.oController.SearchProfileTargetProgID
|
||||
Dim ExSettings As Object
|
||||
Dim oSearch As Object
|
||||
ExSettings = Me.oController.SearchProfileExSettings
|
||||
If ExSettings = 0 Then ExSettings = 7
|
||||
Dim srchQuick As WMOSRCHLib.WMQuickSearch = CreateObject("WMOSrch.WMQuickSearch")
|
||||
Dim srchIndex As WMOSRCHLib.WMIndexSearch = CreateObject("WMOSrch.WMIndexSearch")
|
||||
Dim srchObjectType As WMOSRCHLib.WMObjectTypeSearch = CreateObject("WMOSrch.WMObjectTypeSearch")
|
||||
Marker &= "SuchTyp: " & suchTyp.ToString.ToUpper
|
||||
Select Case suchTyp.ToString.ToUpper
|
||||
Case "WMOSRCH.WMQUICKSEARCH"
|
||||
srchQuick.WMSession = CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
Marker &= "Session Created"
|
||||
Me.oConnect.LoginSession(srchQuick.WMSession)
|
||||
Marker &= "login erfolgreich"
|
||||
srchQuick.ClearSearch()
|
||||
srchQuick.SearchProfilePath = ProfilePath
|
||||
srchQuick.LoadSearchProfile(ProfileName)
|
||||
Marker &= "Parameter / Profile geladen"
|
||||
oSearch = srchQuick.GetSearch()
|
||||
Marker &= "oSearch geladen"
|
||||
Case "WMOSRCH.WMINDEXSEARCH"
|
||||
srchIndex.WMSession = CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
Marker &= "Session Created"
|
||||
Me.oConnect.LoginSession(srchIndex.WMSession)
|
||||
Marker &= "login erfolgreich"
|
||||
srchIndex.ClearSearch()
|
||||
srchIndex.SearchProfilePath = ProfilePath
|
||||
srchIndex.LoadSearchProfile(ProfileName)
|
||||
Marker &= "Parameter / Profile geladen"
|
||||
oSearch = srchIndex.GetSearch()
|
||||
Marker &= "oSearch geladen"
|
||||
Case "WMOSRCH.WMOBJECTTYPESEARCH"
|
||||
srchObjectType.WMSession = CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
Marker &= "Session Created"
|
||||
Me.oConnect.LoginSession(srchObjectType.WMSession)
|
||||
Marker &= "login erfolgreich"
|
||||
srchObjectType.ClearSearch()
|
||||
srchObjectType.SearchProfilePath = ProfilePath
|
||||
srchObjectType.LoadSearchProfile(ProfileName)
|
||||
Marker &= "Parameter / Profile geladen"
|
||||
oSearch = srchObjectType.GetSearch()
|
||||
Marker &= "oSearch geladen"
|
||||
Case Else
|
||||
ClassLogger.Add("KEIN GÜLTIGER WINDREAM-SUCHTYP")
|
||||
Return Nothing
|
||||
End Select
|
||||
Return oSearch.execute
|
||||
|
||||
Catch ex As Exception
|
||||
' bei einem Fehler einen Eintrag in der Logdatei machen
|
||||
ClassLogger.Add("Unvorhergesehener Fehler in Klasse PMWindream - GetSearchDocuments - " & ex.Message, True)
|
||||
ClassLogger.Add("Bisheriger Marker: " & Marker, False)
|
||||
Return Nothing
|
||||
End Try
|
||||
Else
|
||||
ClassLogger.Add("Achtung: windream-Suche '" & wdfLocation & "' existiert nicht!", False)
|
||||
End If
|
||||
|
||||
Return Nothing
|
||||
|
||||
End Function
|
||||
''' Liefert den Wert eines Indexes als String
|
||||
''' _indexname = Name des zu überprüfenden Indexfeldes
|
||||
Public Function GetValueforIndex(ByVal _fullfilepath As String, _indexname As String)
|
||||
Try
|
||||
Const WMEntityDocument = 1
|
||||
Dim IndexwertAusWindream As Object = Nothing
|
||||
Dim _dok As WINDREAMLib.WMObject
|
||||
_dok = Nothing
|
||||
_dok = oSession.GetWMObjectByPath(WMEntityDocument, _fullfilepath) 'WINDREAMLib.WMEntity.WMEntityDocument
|
||||
IndexwertAusWindream = _dok.GetVariableValue(_indexname)
|
||||
Return IndexwertAusWindream.ToString
|
||||
Catch ex As Exception
|
||||
'MsgBox(ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
#End Region
|
||||
End Class
|
||||
321
app/DD_PM_Server/ClassWindream_allgemein.vb
Normal file
321
app/DD_PM_Server/ClassWindream_allgemein.vb
Normal file
@ -0,0 +1,321 @@
|
||||
Imports WINDREAMLib
|
||||
Imports WINDREAMLib.WMCOMEvent
|
||||
Imports WINDREAMLib.WMEntity
|
||||
Imports WINDREAMLib.WMObjectEditMode
|
||||
Imports WINDREAMLib.WMSearchOperator
|
||||
Imports WINDREAMLib.WMSearchRelation
|
||||
Imports WMOBRWSLib
|
||||
|
||||
Public Class ClassWindream_allgemein
|
||||
|
||||
#Region "+++++ Konstanten +++++"
|
||||
Const DEBUG = AUS
|
||||
Const AUS = 0
|
||||
Const WINDREAM = 1
|
||||
Const VARIABLEN = 2
|
||||
#End Region
|
||||
|
||||
#Region "+++++ Variablen +++++"
|
||||
Public oConnect ' der Typ darf nicht festgelegt werden (warum auch immer... geht sonst nicht)
|
||||
Public oSession 'As WINDREAMLib.WMSession ' der Typ darf nicht festgelegt werden (warum auch immer... geht sonst nicht)
|
||||
Public oBrowser As New WMOBRWSLib.ServerBrowser
|
||||
Public oDokumentTypen As WINDREAMLib.WMObjects
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "+++++ Allgemeine Methoden und Funktionen +++++"
|
||||
|
||||
''' <summary>
|
||||
''' Konstruktor für die windream-Klasse
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Sub New()
|
||||
' wenn ein Fehler bei der Initialisierung auftrat
|
||||
If Not Me.Init() Then
|
||||
' Nachricht ausgeben
|
||||
ClassLogger.Add("Achtung Es trat ein Fehler bei der Initialisierung der Klasse windream auf. Bitte prüfen Sie ob der windream-Server aktiv ist und alle Dienste gestartet sind.", True)
|
||||
' das Programm "abschießen"
|
||||
Process.GetCurrentProcess.Kill()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Initialisiert die statische Klasse (Login, Session starten, usw.)
|
||||
''' </summary>
|
||||
''' <returns>Liefert True wenn das Anmelden erfolgreich war, sonst False</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function Init() As Boolean
|
||||
|
||||
Try
|
||||
|
||||
Try
|
||||
' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen
|
||||
Me.oSession = CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
' Connection-Objekt instanziieren
|
||||
Me.oConnect = CreateObject("Windream.WMConnect")
|
||||
'MsgBox("windrem init 'ed")
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
|
||||
|
||||
' wenn windream nicht angemeldet ist
|
||||
If Not Me.IsLoggedIn Then
|
||||
|
||||
' Art der Anmeldung an windream festlegen
|
||||
' 0x0L (also 0) = Standard windream Benutzer
|
||||
' WM_MODULE_ID_DOCTYPEEDITOR_LIC = ermöglicht Zugriff auf die windream Management Funktionen (Z.B. zur Verwaltung der windream Dokumententypen, Auswahllisten, etc.)
|
||||
' WM_MODULE_ID_INDEXSERVICE = ermöglicht der Session die Indexierungs-Events vom windream DMS-Service zu empfangen
|
||||
Me.oConnect.ModuleID = 0
|
||||
|
||||
' setzt die minimal erwartete windream-Version
|
||||
Me.oConnect.MinReqVersion = "3"
|
||||
|
||||
|
||||
' -- Impersonifizierung nur möglich mit registry-eintrag --
|
||||
' oConnect.UserName "\schulung\windream"
|
||||
' oConnect.Password "windream"
|
||||
|
||||
' Verbindung mit Session-Objekt (und dem ausgewählten Server) aufbauen
|
||||
Me.oConnect.LoginSession(Me.oSession)
|
||||
|
||||
If Me.oSession.aLoggedin = False Then
|
||||
ClassLogger.Add("Achtung: Es konnte keine Verbindung mit dem windream-Server hergestellt werden", True)
|
||||
Return False
|
||||
End If
|
||||
|
||||
' AUSGABE VON SYSTEMINFORMATIONEN
|
||||
' Gibt die Versionsart (Lizenztyp) also Small-Business-Edition (SBE), Small-Business-Extension (SBX)
|
||||
' oder Business-Edition (BE) aus
|
||||
'MsgBox("WindreamVersion: " & oSession.GetSystemInfo("WindreamVersion") & vbNewLine & "LicenceKey: " & oSession.GetSystemInfo("LicenceKey") & vbNewLine & _
|
||||
' vbNewLine & "LicenceName: " & oSession.GetSystemInfo("LicenceName"))
|
||||
|
||||
'Dim WMCtrl As AISCONTROLDATACOMLib.AISControlData
|
||||
'WMCtrl = New AISCONTROLDATACOMLib.AISControlData
|
||||
|
||||
'' liefert die Versionsnummer des Clients
|
||||
'MsgBox(WMCtrl.WMWorkstationBuildNo)
|
||||
'MsgBox(WMCtrl.W
|
||||
'' liefert den Servernamen des angemeldeten windreams
|
||||
'MsgBox(WMCtrl.WMServerName)
|
||||
|
||||
Try
|
||||
Me.oSession.SwitchEvents(WMCOMEventWMSessionNeedIndex, False)
|
||||
' der Parameter WMEntityDocument definiert, dass nur Dokumenttypen und keine
|
||||
' Ordnertypen ausgelesen werden
|
||||
Me.oDokumentTypen = Me.oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung Fehler beim Login an windream - Evtl. Keine Verbindung zu windream: " & ex.Message, True)
|
||||
'If Err.Number = -2147220985 Then
|
||||
' ClassLogger.Add("Achtung Fehler beim Login an windream - Keine Verbindung zu windream: " & ex.Message, True)
|
||||
' MsgBox("Die installierte windream-Version ist nicht ausreichend für den Betrieb der Tool Collection für windream." & vbNewLine & _
|
||||
' "Bitte kontaktieren Sie Digital Data." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & Err.Description, MsgBoxStyle.Exclamation, "Unzureichende windream-Version")
|
||||
'Else
|
||||
' ClassLogger.Add("Achtung Fehler beim Login an windream - Keine Verbindung zu windream: " & ex.Message, True)
|
||||
'End If
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "+++++ Funktionen die für den Objekttyp relevate Informationen zurückliefern +++++"
|
||||
|
||||
''' <summary>
|
||||
''' Liefert alle Indexe eines Objekttypen.
|
||||
''' </summary>
|
||||
''' <param name="name">Name des Objekttyps</param>
|
||||
''' <returns>Array mit allen Objekttyp zugeordneten Indexen als String</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function GetIndicesByObjecttype(ByVal name As String) As String()
|
||||
Try
|
||||
Dim oObjectType As WMObject
|
||||
Dim oIndexAttributes As WMObjectRelation
|
||||
Dim oIndexAttribute As WMObject
|
||||
Dim oIndex As WMObject
|
||||
Dim oRelProperties As WMObjectRelationClass
|
||||
|
||||
' den Objekttyp laden
|
||||
oObjectType = Me.oSession.GetWMObjectByName(WMEntityObjectType, name)
|
||||
|
||||
' Beziehung zu Indizes des Objekttyp auslesen
|
||||
oIndexAttributes = oObjectType.GetWMObjectRelationByName("TypeAttributes")
|
||||
|
||||
' Array für Indizes vorbereiten
|
||||
Dim aIndexNames(oIndexAttributes.Count - 1) As String
|
||||
|
||||
' alle Indizes durchlaufen
|
||||
For j As Integer = 0 To oIndexAttributes.Count - 1
|
||||
|
||||
' aktuellen Index auslesen
|
||||
oIndexAttribute = oIndexAttributes.Item(j)
|
||||
|
||||
' Eigenschaften des Index auslesen
|
||||
oRelProperties = oIndexAttribute.GetWMObjectRelationByName("Attribute")
|
||||
|
||||
' Index aus den Eigenschaften auslesen
|
||||
oIndex = oRelProperties.Item(0)
|
||||
|
||||
' Indexname speichern
|
||||
aIndexNames(j) = oIndex.aName
|
||||
Next
|
||||
|
||||
' Indexarray zurückgeben
|
||||
Return aIndexNames
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung: Fehler beim Auslesen der windream-Indexe: " & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Liefert einen Objekttyp als WMObject an Hand dessen Name.
|
||||
''' </summary>
|
||||
''' <param name="objekttypName">Name des Objekttyps</param>
|
||||
''' <returns>Objekttyp als WMObject</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function GetObjecttypeByName(ByVal objekttypName As String) As WMObject
|
||||
Try
|
||||
' alle Objekttypen auslesen
|
||||
Dim oObjectTypes As WMObjects = Me.oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
|
||||
|
||||
' alle Objekttypen durchlaufen und nach dem mit dem angegebenen Namen suchen
|
||||
For Each oObjectType As WMObject In oObjectTypes
|
||||
If oObjectType.aName = objekttypName Then
|
||||
Return oObjectType
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Nothing
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung: Fehler in GetObjecttypeByName: " & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Überprüft ob der angegebene Index im Objekttyp existiert
|
||||
''' </summary>
|
||||
''' <param name="objekttyp">Name des zu durchsuchenden Objekttyps</param>
|
||||
''' <param name="indexname">Name des zu suchenden Indexes</param>
|
||||
''' <returns>Liefert True wenn der Index im Objekttyp existiert, sonst False</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function ExistIndexInObjekttyp(ByVal objekttyp As String, ByVal indexname As String) As Boolean
|
||||
Try
|
||||
Dim indexnamen() As String = Me.GetIndicesByObjecttype(objekttyp)
|
||||
|
||||
If indexnamen Is Nothing Then Return False
|
||||
|
||||
For Each index As String In indexnamen
|
||||
If index = indexname Then Return True
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung: Fehler in ExistIndexInObjekttyp: " & ex.Message)
|
||||
End Try
|
||||
|
||||
Return False
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "+++++ Allgemeine Funktionen die Informationen zurückliefern +++++"
|
||||
|
||||
''' <summary>
|
||||
''' Liefert True wenn die windream-Session angemeldet ist und False für den Fall, dass die Session nicht eingeloggt ist.
|
||||
''' </summary>
|
||||
''' <returns>Anmeldestatus als Boolean</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function IsLoggedIn() As Boolean
|
||||
Try
|
||||
Return Me.oSession.aLoggedin
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung: Fehler in IsLoggedIn: " & ex.Message)
|
||||
End Try
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Liefert den Servernamen an dem windream aktuell angemeldet ist.
|
||||
''' </summary>
|
||||
''' <returns>Servername als String</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function GetCurrentServer() As String
|
||||
Try
|
||||
Return Me.oBrowser.GetCurrentServer 'ClassWindream.oBrowser.GetCurrentServer
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Achtung: Fehler in GetCurrentServer: " & ex.Message)
|
||||
End Try
|
||||
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
'Public Function GetSharedCurrentServer() As String
|
||||
' Try
|
||||
' Return ClassWindream.oBrowser.GetCurrentServer
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Der aktuell gewählte windream-Server konnte nicht ausgelesen werden." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen des windream-Servers")
|
||||
' End Try
|
||||
|
||||
' Return ""
|
||||
'End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Liefert das Windream-Laufwerk des windream-Servers, in Form '[Laufwerksbuchstabe]:'. (z.B. 'W:')
|
||||
''' </summary>
|
||||
''' <returns>Laufwerksbuchstabe mit Doppelpunkt als String</returns>
|
||||
''' <remarks></remarks>
|
||||
'Public Function GetWindreamDriveLetter() As String
|
||||
|
||||
' Try
|
||||
' Dim oControl As AISCONTROLDATACOMLib.AISControlData
|
||||
' Dim sDrive As String = ""
|
||||
|
||||
' oControl = New AISCONTROLDATACOMLib.AISControlData
|
||||
|
||||
' sDrive = oControl.GetStringValue(&H10040003)
|
||||
|
||||
' Return sDrive & ":"
|
||||
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Fehlernachricht: " & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen des windream-Laufwerks")
|
||||
' End Try
|
||||
|
||||
' Return ""
|
||||
'End Function
|
||||
|
||||
''' <summary>
|
||||
''' Liefert den Typen eines Indexes als Integer.
|
||||
''' </summary>
|
||||
''' <param name="indexname">Name des zu überprüfenden Indexfeldes</param>
|
||||
''' <returns>Liefert eine Zahl, die einen Typen beschreibt</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function GetTypeOfIndexAsIntByName(ByVal indexname As String) As Integer
|
||||
Try
|
||||
Dim oAttribute = Me.oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, indexname)
|
||||
Dim vType = oAttribute.getVariableValue("dwAttrType")
|
||||
Return vType
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
#End Region
|
||||
End Class
|
||||
138
app/DD_PM_Server/DD_PM_Server.vbproj
Normal file
138
app/DD_PM_Server/DD_PM_Server.vbproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>
|
||||
</SchemaVersion>
|
||||
<ProjectGuid>{7ED90CF1-7B5B-403A-A138-7CCB9F8963E9}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<StartupObject>DD_PM_Server.Modul_Main</StartupObject>
|
||||
<RootNamespace>DD_PM_Server</RootNamespace>
|
||||
<AssemblyName>DD_PM_Server</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Console</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DD_PM_Server.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DD_PM_Server.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Interop.WINDREAMLib">
|
||||
<HintPath>..\..\..\..\..\DLL\windreamDLL\Interop.WINDREAMLib.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.WMOBRWSLib">
|
||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOBRWSLib.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.WMOSRCHLib">
|
||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOSRCHLib.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.WMOTOOLLib">
|
||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOTOOLLib.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ClassEmail.vb" />
|
||||
<Compile Include="ClassLogger.vb" />
|
||||
<Compile Include="ClassPMWindream.vb" />
|
||||
<Compile Include="ClassDatabase.vb" />
|
||||
<Compile Include="ClassWindream_allgemein.vb" />
|
||||
<Compile Include="Modul_Main.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
306
app/DD_PM_Server/Modul_Main.vb
Normal file
306
app/DD_PM_Server/Modul_Main.vb
Normal file
@ -0,0 +1,306 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports WINDREAMLib
|
||||
Imports System.Globalization
|
||||
Module Modul_Main
|
||||
Public vIntervall As Integer
|
||||
Private _windreamPM As ClassPMWindream
|
||||
Private _wdDokument As WMObject
|
||||
Private email As New ClassEmail
|
||||
Private email_Reminder As Boolean
|
||||
Private email_from, email_user, email_pw, email_smtp, Reminder_Head, Reminder_Footer As String
|
||||
|
||||
Sub Main()
|
||||
Try
|
||||
ClassLogger.Init("", "logPM_Server", True)
|
||||
ClassLogger.Add(" ######## ProcessManager - Server gestartet - " & Now, False)
|
||||
Catch ex As System.Exception
|
||||
'MsgBox("Fehler bei Log Create: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
|
||||
End Try
|
||||
Try
|
||||
' Windream instanziieren
|
||||
_windreamPM = New ClassPMWindream()
|
||||
'Windream initialisieren (Connection, Session, ... aufbauen)
|
||||
_windreamPM.Init()
|
||||
ClassLogger.Add(" >> windream initialisiert", False)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Fehler in windream-Init: " & ex.Message, True)
|
||||
If My.Settings.Email_senden = True Then
|
||||
email.Send_Error_Mail("Fehler in windream-Init (Modul main): <br> >> Fehlermeldung: <br>" & ex.Message)
|
||||
End If
|
||||
End Try
|
||||
Load_Konfig()
|
||||
Check_Profiles()
|
||||
Send_Reminder()
|
||||
End Sub
|
||||
Sub Run_Timer_Refresh_Files()
|
||||
ClassLogger.Add(">> Timer Refresh_Files gestartet!", False)
|
||||
Check_Profiles()
|
||||
End Sub
|
||||
Sub Send_Reminder()
|
||||
Try
|
||||
If email_Reminder = True Then
|
||||
Dim list As New List(Of Integer)
|
||||
list.Add(8)
|
||||
list.Add(9)
|
||||
list.Add(10)
|
||||
list.Add(12)
|
||||
list.Add(14)
|
||||
list.Add(16)
|
||||
list.Add(18)
|
||||
Dim hour As Integer = My.Computer.Clock.LocalTime.Hour
|
||||
Dim start As Boolean = False
|
||||
Dim i As Integer
|
||||
For i = 0 To list.Count - 1
|
||||
If list.Item(i) = hour Then
|
||||
start = True
|
||||
End If
|
||||
Next i
|
||||
'Wenn diese Stunde eine Email versendet werden soll
|
||||
If start = True Then
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable("Select * from VWPM_EMAIL_PROFIL where ANZ_FILES > 0")
|
||||
If DT Is Nothing = False Then
|
||||
If DT.Rows.Count > 0 Then
|
||||
For Each Row As DataRow In DT.Rows
|
||||
'If Row.Item("LAST_HOUR") = 0 Then
|
||||
If Row.Item("LAST_HOUR") <> hour Then
|
||||
If CBool(Row.Item("EMAIL_ONCE_DAY")) = True Then
|
||||
If hour = 12 Then
|
||||
Dim Body As String = "- Profilnam: '" & Row.Item("PROFIL_TITLE") & "' - Anzahl der Dokumente: " & Row.Item("ANZ_FILES")
|
||||
If ClassEmail.Send_Reminder_Mail(Body, email_from, email_smtp, email_user, email_pw, Row.Item("EMAIL"), Reminder_Head, Reminder_Footer) = True Then
|
||||
ClassDatabase.Execute_MSSQL("UPDATE TBPM_USER SET LAST_EMAIL_SEND = " & hour & " WHERE GUID = " & Row.Item("USER_ID"))
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Dim Body As String = "- Profilnam: '" & Row.Item("PROFIL_TITLE") & "' - Anzahl der Dokumente: " & Row.Item("ANZ_FILES")
|
||||
If ClassEmail.Send_Reminder_Mail(Body, email_from, email_smtp, email_user, email_pw, Row.Item("EMAIL"), Reminder_Head, Reminder_Footer) = True Then
|
||||
ClassDatabase.Execute_MSSQL("UPDATE TBPM_USER SET LAST_EMAIL_SEND = " & hour & " WHERE GUID = " & Row.Item("USER_ID"))
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
'End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("###Fehler in Send_Reminder: " & ex.Message)
|
||||
If My.Settings.Email_senden = True Then
|
||||
email.Send_Error_Mail("Fehler in Send_Reminder (Modul main): <br> >> Fehlermeldung: <br>" & ex.Message)
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
Sub Load_Konfig()
|
||||
Try
|
||||
Dim myConnection As SqlConnection
|
||||
myConnection = New SqlConnection(My.Settings.SQLConnection)
|
||||
Dim mySQLcommand As SqlCommand
|
||||
mySQLcommand = New SqlCommand("SELECT * FROM TBPM_KONFIGURATION WHERE GUID = 1", myConnection)
|
||||
|
||||
' mySQLcommand.CommandText = "SELECT * FROM TBPM_KONFIGURATION WHERE GUID = 1"
|
||||
Try
|
||||
myConnection.Open()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Fehler in Load_Konfig DB aufbauen - Fehler: " & ex.Message, False)
|
||||
ClassLogger.Add("Prüfen Sie die Anwendungsdatei-Angaben für die Connection", False)
|
||||
myConnection.Close()
|
||||
Exit Sub
|
||||
End Try
|
||||
Dim adapter1 As SqlDataAdapter = New SqlDataAdapter(mySQLcommand)
|
||||
Dim dt As DataTable = New DataTable()
|
||||
adapter1.Fill(dt)
|
||||
|
||||
If dt.Rows.Count = 1 Then
|
||||
Dim Konfig_Row As System.Data.DataRow
|
||||
'---------------------- für jedes Profil die Dateien überprüfen ------------------------
|
||||
For Each Konfig_Row In dt.Rows
|
||||
If CBool(Konfig_Row.Item("EMAIL_ACTIVE")) = True Then
|
||||
email_Reminder = CBool(Konfig_Row.Item("EMAIL_ACTIVE"))
|
||||
email_from = Konfig_Row.Item("EMAIL_FROM")
|
||||
email_user = Konfig_Row.Item("EMAIL_USER")
|
||||
email_pw = Konfig_Row.Item("EMAIL_PW")
|
||||
email_smtp = Konfig_Row.Item("EMAIL_SMTP")
|
||||
Reminder_Head = Konfig_Row.Item("EMAIL_REMINDER_HEADER")
|
||||
Reminder_Footer = Konfig_Row.Item("EMAIL_REMINDER_FOOTER")
|
||||
Else
|
||||
email_Reminder = False
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("###Fehler in Load_Konfig: " & ex.Message)
|
||||
If My.Settings.Email_senden = True Then
|
||||
email.Send_Error_Mail("Fehler in Load_Konfig (Modul main): <br> >> Fehlermeldung: <br>" & ex.Message)
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
Sub Check_Profiles()
|
||||
Dim stp As String
|
||||
' windream-Suche für Profil starten
|
||||
_windreamPM = New ClassPMWindream()
|
||||
stp = 1
|
||||
Try
|
||||
ClassLogger.Add(" >> Check_Profiles gestartet", False)
|
||||
Dim WD_Search As String
|
||||
Dim myConnection As SqlConnection
|
||||
stp = 2
|
||||
myConnection = New SqlConnection(My.Settings.SQLConnection)
|
||||
stp = 3
|
||||
Dim mySQLcommand As SqlCommand
|
||||
mySQLcommand = New SqlCommand("SELECT GUID,NAME,WD_OBJECTTYPE,WD_SEARCH FROM TBPM_PROFILE WHERE ACTIVE = 1", myConnection)
|
||||
stp = 4
|
||||
mySQLcommand.CommandText = "SELECT GUID,NAME,WD_OBJECTTYPE,WD_SEARCH FROM TBPM_PROFILE WHERE ACTIVE = 1"
|
||||
stp = 5
|
||||
Try
|
||||
myConnection.Open()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Fehler in Check_Profiles DB aufbauen - Fehler: " & ex.Message, False)
|
||||
myConnection.Close()
|
||||
Exit Sub
|
||||
End Try
|
||||
stp = 6
|
||||
Dim adapter1 As SqlDataAdapter = New SqlDataAdapter(mySQLcommand)
|
||||
stp = 7
|
||||
Dim dt As DataTable = New DataTable()
|
||||
stp = 8
|
||||
adapter1.Fill(dt)
|
||||
stp = 9
|
||||
|
||||
Console.WriteLine(">> Evtl alte nicht aktualisierte PROFILE-FILE Daten werden gelöscht")
|
||||
'---------------------- Evtl alte nicht aktualisierte PROFILE-FILE Daten werden gelöscht ------------------------
|
||||
Dim delete As String = "DELETE FROM TBPM_PROFILE_FILES WHERE ACTIVE = 0 AND IN_WORK = 0"
|
||||
ClassDatabase.Execute_MSSQL(delete)
|
||||
|
||||
Dim sel4 = "select count(*) from TBPM_PROFILE_FILES"
|
||||
Dim EMPTYTABLE = ClassDatabase.Execute_Scalar(sel4)
|
||||
If EMPTYTABLE = 0 Then
|
||||
ClassLogger.Add(">> Tabelle ist noch komplett leer", False)
|
||||
End If
|
||||
'delete = "DELETE FROM TBPM_PROFILE_FILES_TEMP"
|
||||
'ClassDatabase.Execute_MSSQL(delete)
|
||||
stp = 10
|
||||
|
||||
If dt.Rows.Count > 0 Then
|
||||
Dim Profile_Row As System.Data.DataRow
|
||||
'---------------------- für jedes Profil die Dateien überprüfen ------------------------
|
||||
For Each Profile_Row In dt.Rows
|
||||
stp = "a"
|
||||
Console.WriteLine(">> Dateien für Profil '" & Profile_Row.Item("NAME") & "' eintragen")
|
||||
ClassLogger.Add(">> Dateien für Profil '" & Profile_Row.Item("NAME") & "' eintragen", False)
|
||||
Dim ID As Integer = Profile_Row.Item("GUID")
|
||||
WD_Search = Nothing
|
||||
WD_Search = Profile_Row.Item("WD_SEARCH")
|
||||
stp = "b"
|
||||
If WD_Search Is Nothing = False Then
|
||||
'---------------------- Die Dateien auslesen ------------------------
|
||||
Dim windreamSucheErgebnisse As WMObjects
|
||||
stp = "c"
|
||||
windreamSucheErgebnisse = _windreamPM.GetSearchDocuments(WD_Search)
|
||||
stp = "d"
|
||||
Dim Anzahl_Doks As Integer = 0
|
||||
If windreamSucheErgebnisse Is Nothing = False Then
|
||||
If windreamSucheErgebnisse.Count > 0 Then
|
||||
stp = "e"
|
||||
'Die aktuellen Files auf refreshed = 0 setzten
|
||||
Dim upd As String = "UPDATE TBPM_PROFILE_FILES SET REFRESHED = 0 WHERE PROFIL_ID = " & ID
|
||||
If ClassDatabase.Execute_MSSQL(upd) = True Then
|
||||
stp = "e-1"
|
||||
'Ein Array mit Dateiinformationen anlegen
|
||||
Dim Profil_Docs(windreamSucheErgebnisse.Count - 1, 2) As String
|
||||
For Each dok As WMObject In windreamSucheErgebnisse
|
||||
Profil_Docs(Anzahl_Doks, 0) = ID
|
||||
Profil_Docs(Anzahl_Doks, 1) = My.Settings.WD_LW & ":" & dok.aPath
|
||||
'------DMS Erstell-Datum holen --------
|
||||
Dim DMSErstellt = dok.GetVariableValue(My.Settings.vIDX_DMS_ERSTELLT)
|
||||
Dim DOC_ID
|
||||
Try
|
||||
DOC_ID = dok.GetVariableValue("Dokument-ID")
|
||||
Catch ex As Exception
|
||||
DOC_ID = 0
|
||||
End Try
|
||||
|
||||
'ClassLogger.Add(">> DMSErstellt: '" & DMSErstellt.ToString, False)
|
||||
Dim date_EN As String
|
||||
If My.Settings.vIDX_DMS_ERSTELLT.EndsWith("reated") Then
|
||||
Dim arr() = DMSErstellt.ToString.Split(".")
|
||||
If arr.Length = 3 Then
|
||||
date_EN = arr(2).Replace(" 00:00:00", "") & "-" & arr(1) & "-" & arr(0)
|
||||
ClassLogger.Add(">> date_EN: '" & date_EN, False)
|
||||
DMSErstellt = date_EN
|
||||
End If
|
||||
End If
|
||||
'-------------------- Überprüfen ob das Dokument bereits enthalten ist? Kann nur passieren wenn das Dok gerade in Bearbeitung ist ----------
|
||||
Dim sel1 As String = "SELECT GUID FROM TBPM_PROFILE_FILES WHERE PROFIL_ID = " & ID & " AND FILE_PATH = '" & My.Settings.WD_LW & ":" & dok.aPath & "'"
|
||||
Dim check = ClassDatabase.Execute_Scalar(sel1)
|
||||
'---------------------- Das Dokument inserten ------------------------
|
||||
Try
|
||||
If check Is Nothing Or EMPTYTABLE = 0 Then
|
||||
Dim insert As String = "INSERT INTO TBPM_PROFILE_FILES (PROFIL_ID, FILE_PATH, ACTIVE, DMS_ERSTELLT_DATE,DOC_ID) VALUES (" & ID & ", '" & My.Settings.WD_LW & ":" & dok.aPath & "',1, CONVERT(DATE,'" & DMSErstellt & "')," & DOC_ID & ")"
|
||||
If ClassDatabase.Execute_MSSQL(insert) = False Then
|
||||
ClassLogger.Add("### Unexpected Error while Inserting File-Record")
|
||||
End If
|
||||
' aktuelles Dokument der Klasse mitteilen
|
||||
Else
|
||||
If CInt(check) > 0 Then
|
||||
Dim upd1 As String = "UPDATE TBPM_PROFILE_FILES SET REFRESHED = 1, EDIT = 0 WHERE GUID = " & CInt(check)
|
||||
ClassDatabase.Execute_MSSQL(upd1)
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("###Fehler IN Insert or Update File-Record - ast step: " & stp)
|
||||
ClassLogger.Add("###Fehler-Nachricht: " & ex.Message)
|
||||
End Try
|
||||
|
||||
Anzahl_Doks += 1
|
||||
Next
|
||||
stp = "f - vor Delete Refreshed = 0"
|
||||
Dim Del As String = "DELETE FROM TBPM_PROFILE_FILES WHERE PROFIL_ID = " & ID & " AND REFRESHED = 0"
|
||||
ClassDatabase.Execute_MSSQL(Del)
|
||||
'---------------------- Aktuelle Anzahl in Profiltabelle updaten ------------------------
|
||||
Dim update As String = "UPDATE TBPM_PROFILE SET NO_OF_DOCUMENTS = " & Anzahl_Doks & " WHERE GUID = " & ID
|
||||
stp = "g - " & Anzahl_Doks.ToString
|
||||
ClassDatabase.Execute_MSSQL(update)
|
||||
ClassLogger.Add(">> Profil '" & Profile_Row.Item("NAME") & "' aktualisiert - Anzahl Dateien: " & Anzahl_Doks.ToString, False)
|
||||
Else
|
||||
ClassLogger.Add(">> ACHTUNG: Refresh konnte nicht ausgeführt werden: " & upd, False)
|
||||
End If
|
||||
Else
|
||||
stp = "g"
|
||||
ClassLogger.Add(">> KEINE DATEIEN FÜR PROFIL VORHANDEN.", False)
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> ACHTUNG: WINDREAM-SUCHE ist NOTHING.", False)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
stp = "h"
|
||||
''------------------------------- Bearbeitete Daten löschen ------------------------
|
||||
If ClassDatabase.Execute_MSSQL("DELETE FROM TBPM_PROFILE_FILES WHERE EDIT = 1") = True Then
|
||||
' stp = "i"
|
||||
' Console.WriteLine(">> Alte PROFILE-FILE Daten geleert")
|
||||
' '---------------------- DIE NEUEN DATEN AUF ACTIVE SETZEN ------------------------
|
||||
' Dim update As String = "UPDATE TBPM_PROFILE_FILES SET ACTIVE = 1 WHERE ACTIVE = 0"
|
||||
' ClassDatabase.Execute_MSSQL(update)
|
||||
' stp = "j"
|
||||
' Console.WriteLine(">> Neue PROFILE-FILE Daten aktiv gesetzt")
|
||||
End If
|
||||
ClassDatabase.Execute_MSSQL("EXEC PRPM_REMOVE_NE_FILES")
|
||||
End If
|
||||
myConnection.Close()
|
||||
stp = "k"
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("###Fehler IN Check_Profiles - last step: " & stp)
|
||||
ClassLogger.Add("###Fehler IN Check_Profiles: " & ex.Message)
|
||||
If ex.Message.Contains("Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.") = False Then
|
||||
If My.Settings.Email_senden = True Then
|
||||
email.Send_Error_Mail("Fehler in Check_Profiles (Modul main): <br> >> Fehlermeldung: <br>" & ex.Message)
|
||||
End If
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
End Module
|
||||
13
app/DD_PM_Server/My Project/Application.Designer.vb
generated
Normal file
13
app/DD_PM_Server/My Project/Application.Designer.vb
generated
Normal file
@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.261
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
10
app/DD_PM_Server/My Project/Application.myapp
Normal file
10
app/DD_PM_Server/My Project/Application.myapp
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>2</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
35
app/DD_PM_Server/My Project/AssemblyInfo.vb
Normal file
35
app/DD_PM_Server/My Project/AssemblyInfo.vb
Normal file
@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die mit einer Assembly verknüpft sind.
|
||||
|
||||
' Die Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("DD_PM_Server")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("DD_PM_Server")>
|
||||
<Assembly: AssemblyCopyright("Copyright © Digital Data 2013")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
<Assembly: Guid("3dcc8666-324a-4061-8e72-b75e63a2adb7")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.3.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.1.0.0")>
|
||||
62
app/DD_PM_Server/My Project/Resources.Designer.vb
generated
Normal file
62
app/DD_PM_Server/My Project/Resources.Designer.vb
generated
Normal file
@ -0,0 +1,62 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.261
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DD_PM_Server.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
117
app/DD_PM_Server/My Project/Resources.resx
Normal file
117
app/DD_PM_Server/My Project/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
203
app/DD_PM_Server/My Project/Settings.Designer.vb
generated
Normal file
203
app/DD_PM_Server/My Project/Settings.Designer.vb
generated
Normal file
@ -0,0 +1,203 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.34014
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Funktion zum automatischen Speichern von My.Settings"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("Data Source=172.24.12.41\tests;Initial Catalog=DD_DMS;Persist Security Info=True;"& _
|
||||
"User ID=sa;Password=dd")> _
|
||||
Public ReadOnly Property SQLConnection() As String
|
||||
Get
|
||||
Return CType(Me("SQLConnection"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
|
||||
Public ReadOnly Property Email_senden() As Boolean
|
||||
Get
|
||||
Return CType(Me("Email_senden"),Boolean)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public ReadOnly Property Email_Empfaenger() As String
|
||||
Get
|
||||
Return CType(Me("Email_Empfaenger"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public ReadOnly Property Email_From() As String
|
||||
Get
|
||||
Return CType(Me("Email_From"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public ReadOnly Property Email_User() As String
|
||||
Get
|
||||
Return CType(Me("Email_User"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public ReadOnly Property Email_PW() As String
|
||||
Get
|
||||
Return CType(Me("Email_PW"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("Fehler in DD Process Manager - Server")> _
|
||||
Public ReadOnly Property Email_Betreff() As String
|
||||
Get
|
||||
Return CType(Me("Email_Betreff"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("Das Modul 'DD Process Manager - Server' meldet folgenden unvorhergesehen Fehler: "& _
|
||||
"<p>")> _
|
||||
Public ReadOnly Property Email_Body() As String
|
||||
Get
|
||||
Return CType(Me("Email_Body"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public ReadOnly Property Email_SMTP() As String
|
||||
Get
|
||||
Return CType(Me("Email_SMTP"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("W")> _
|
||||
Public ReadOnly Property WD_LW() As String
|
||||
Get
|
||||
Return CType(Me("WD_LW"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("DMS erstellt")> _
|
||||
Public ReadOnly Property vIDX_DMS_ERSTELLT() As String
|
||||
Get
|
||||
Return CType(Me("vIDX_DMS_ERSTELLT"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("<table border=""0"">")> _
|
||||
Public ReadOnly Property vBodyTag() As String
|
||||
Get
|
||||
Return CType(Me("vBodyTag"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("Hinweis Process-Manager Digital Data")> _
|
||||
Public ReadOnly Property Email_ReminderBetreff() As String
|
||||
Get
|
||||
Return CType(Me("Email_ReminderBetreff"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("E:\SchreiberM\Visual Studio\Kunden - Produktiv\PROCESSMANAGER\DD_PM_Server\DD_PM_"& _
|
||||
"Server\bin\Debug")> _
|
||||
Public ReadOnly Property Email_ReminderStartup() As String
|
||||
Get
|
||||
Return CType(Me("Email_ReminderStartup"),String)
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.DD_PM_Server.My.MySettings
|
||||
Get
|
||||
Return Global.DD_PM_Server.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
53
app/DD_PM_Server/My Project/Settings.settings
Normal file
53
app/DD_PM_Server/My Project/Settings.settings
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="SQLConnection" Type="(Connection string)" Scope="Application">
|
||||
<DesignTimeValue Profile="(Default)"><?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=172.24.12.41\tests;Initial Catalog=DD_DMS;Persist Security Info=True;User ID=sa;Password=dd</ConnectionString>
|
||||
<ProviderName>System.Data.SqlClient</ProviderName>
|
||||
</SerializableConnectionString></DesignTimeValue>
|
||||
<Value Profile="(Default)">Data Source=172.24.12.41\tests;Initial Catalog=DD_DMS;Persist Security Info=True;User ID=sa;Password=dd</Value>
|
||||
</Setting>
|
||||
<Setting Name="Email_senden" Type="System.Boolean" Scope="Application">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="Email_Empfaenger" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Email_From" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Email_User" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Email_PW" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Email_Betreff" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">Fehler in DD Process Manager - Server</Value>
|
||||
</Setting>
|
||||
<Setting Name="Email_Body" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">Das Modul 'DD Process Manager - Server' meldet folgenden unvorhergesehen Fehler: <p></Value>
|
||||
</Setting>
|
||||
<Setting Name="Email_SMTP" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="WD_LW" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">W</Value>
|
||||
</Setting>
|
||||
<Setting Name="vIDX_DMS_ERSTELLT" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">DMS erstellt</Value>
|
||||
</Setting>
|
||||
<Setting Name="vBodyTag" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)"><table border="0"></Value>
|
||||
</Setting>
|
||||
<Setting Name="Email_ReminderBetreff" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">Hinweis Process-Manager Digital Data</Value>
|
||||
</Setting>
|
||||
<Setting Name="Email_ReminderStartup" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">E:\SchreiberM\Visual Studio\Kunden - Produktiv\PROCESSMANAGER\DD_PM_Server\DD_PM_Server\bin\Debug</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
77
app/DD_PM_Server/app.config
Normal file
77
app/DD_PM_Server/app.config
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="DD_PM_Server.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="DD_PM_Server.My.MySettings.SQLConnection" connectionString="Data Source=172.24.12.41\tests;Initial Catalog=DD_DMS;Persist Security Info=True;User ID=sa;Password=dd"
|
||||
providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<system.diagnostics>
|
||||
<sources>
|
||||
<!-- Dieser Abschnitt definiert die Protokollierungskonfiguration für My.Application.Log -->
|
||||
<source name="DefaultSource" switchName="DefaultSwitch">
|
||||
<listeners>
|
||||
<add name="FileLog"/>
|
||||
<!-- Auskommentierung des nachfolgenden Abschnitts aufheben, um in das Anwendungsereignisprotokoll zu schreiben -->
|
||||
<!--<add name="EventLog"/>-->
|
||||
</listeners>
|
||||
</source>
|
||||
</sources>
|
||||
<switches>
|
||||
<add name="DefaultSwitch" value="Information" />
|
||||
</switches>
|
||||
<sharedListeners>
|
||||
<add name="FileLog"
|
||||
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
|
||||
initializeData="FileLogWriter"/>
|
||||
<!-- Auskommentierung des nachfolgenden Abschnitts aufheben und APPLICATION_NAME durch den Namen der Anwendung ersetzen, um in das Anwendungsereignisprotokoll zu schreiben -->
|
||||
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
|
||||
</sharedListeners>
|
||||
</system.diagnostics>
|
||||
<applicationSettings>
|
||||
<DD_PM_Server.My.MySettings>
|
||||
<setting name="Email_senden" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="Email_Empfaenger" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="Email_From" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="Email_User" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="Email_PW" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="Email_Betreff" serializeAs="String">
|
||||
<value>Fehler in DD Process Manager - Server</value>
|
||||
</setting>
|
||||
<setting name="Email_Body" serializeAs="String">
|
||||
<value>Das Modul 'DD Process Manager - Server' meldet folgenden unvorhergesehen Fehler: <p></value>
|
||||
</setting>
|
||||
<setting name="Email_SMTP" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="WD_LW" serializeAs="String">
|
||||
<value>W</value>
|
||||
</setting>
|
||||
<setting name="vIDX_DMS_ERSTELLT" serializeAs="String">
|
||||
<value>DMS erstellt</value>
|
||||
</setting>
|
||||
<setting name="vBodyTag" serializeAs="String">
|
||||
<value><table border="0"></value>
|
||||
</setting>
|
||||
<setting name="Email_ReminderBetreff" serializeAs="String">
|
||||
<value>Hinweis Process-Manager Digital Data</value>
|
||||
</setting>
|
||||
<setting name="Email_ReminderStartup" serializeAs="String">
|
||||
<value>E:\SchreiberM\Visual Studio\Kunden - Produktiv\PROCESSMANAGER\DD_PM_Server\DD_PM_Server\bin\Debug</value>
|
||||
</setting>
|
||||
</DD_PM_Server.My.MySettings>
|
||||
</applicationSettings>
|
||||
</configuration>
|
||||
Loading…
x
Reference in New Issue
Block a user