This commit is contained in:
Jonathan Jenne
2019-08-09 17:12:34 +02:00
parent ee2cacb6cd
commit 16a6febb34
21 changed files with 531 additions and 402 deletions

View File

@@ -113,7 +113,7 @@ Public Class frmStart
Try
oProfileFilter = New ClassProfileFilter(DT_USER_PROFILES, DTPROFILE_REL_WINDOW, DTPROFILE_REL_CONTROL)
Catch ex As Exception
MsgBox("Fehler beim Laden der Profile. Möglicherweise liegt ein Konfigurationsfehler vor.")
MsgBox("Fehler beim Laden der Profile. Möglicherweise liegt ein Konfigurationsfehler vor.", MsgBoxStyle.Critical, Text)
Exit Sub
End Try
@@ -123,7 +123,7 @@ Public Class frmStart
oProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oProfiles, oWindowInfo.WindowTitle)
oProfiles = oProfileFilter.FilterWindowsByWindowClipboardRegex(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.FilterProfilesByFocusedControl(oProfiles)
oProfiles = oProfileFilter.FilterProfilesByFocusedControl(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.RemoveDuplicateProfiles()
oProfiles = oProfiles.ToList()
@@ -147,8 +147,6 @@ Public Class frmStart
Dim oInvalidDataSQL = False
For Each oProfile In oProfiles
Dim oDocumentSQL = oProfile.SQLCountDocs
Dim oDataSQL = oProfile.SQLCountData
Dim oResultDocs As Integer = 0
Dim oResultData As Integer = 0
@@ -156,34 +154,36 @@ Public Class frmStart
Dim oDocSearches As DataTable = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
For Each oRow As DataRow In oDataSearches.Rows
Dim oCountCommand = String.Empty
Try
Dim oCountCommand = oRow.Item("COUNT_COMMAND")
oCountCommand = oRow.Item("COUNT_COMMAND")
If oCountCommand = String.Empty Then
Continue For
End If
oDataSQL = clsPatterns.ReplaceAllValues(oCountCommand, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, oProfile.Guid)
oResultData += Database.NewExecuteScalar(oDataSQL)
oCountCommand = clsPatterns.ReplaceAllValues(oCountCommand, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, oProfile.Guid)
oResultData += Database.NewExecuteScalar(oCountCommand)
Catch ex As Exception
Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oDataSQL)
Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
oInvalidDataSQL = True
End Try
Next
For Each oRow As DataRow In oDocSearches.Rows
Dim oCountCommand = String.Empty
Try
Dim oCountCommand = oRow.Item("COUNT_COMMAND")
oCountCommand = oRow.Item("COUNT_COMMAND")
If oCountCommand = String.Empty Then
Continue For
End If
oDataSQL = clsPatterns.ReplaceAllValues(oCountCommand, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, oProfile.Guid)
oResultDocs += Database.NewExecuteScalar(oDataSQL)
oCountCommand = clsPatterns.ReplaceAllValues(oCountCommand, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, oProfile.Guid)
oResultDocs += Database.NewExecuteScalar(oCountCommand)
Catch ex As Exception
Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
oInvalidDocumentSQL = True
Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oDataSQL)
End Try
Next
@@ -193,6 +193,7 @@ Public Class frmStart
If oInvalidDocumentSQL Or oInvalidDataSQL Then
MsgBox("Ein oder mehrere Abfragen konnten nicht ausgeführt werden. Bitte überprüfen Sie das Log.", MsgBoxStyle.Exclamation, "Warnung")
Exit Sub
End If
Dim oForm As New frmProfileMatch()
@@ -293,4 +294,10 @@ Public Class frmStart
TimerClose.Start()
MONITORING_ACTIVE = True
End Sub
Private Sub ClientBeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClientBeendenToolStripMenuItem.Click
If MsgBox("Wollen Sie das Programm beenden?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.Yes Then
Close()
End If
End Sub
End Class