This commit is contained in:
Jonathan Jenne
2019-09-24 16:53:31 +02:00
parent 16a7d5b915
commit cc2d8cbe33
22 changed files with 655 additions and 70 deletions

View File

@@ -144,6 +144,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules.Database\Database.vbproj">
<Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project>
<Name>Database</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Language\Language.vbproj">
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
<Name>Language</Name>
@@ -156,6 +160,10 @@
<Project>{81CAC44F-3711-4C8F-AE98-E02A7448782A}</Project>
<Name>ZooFlow</Name>
</ProjectReference>
<ProjectReference Include="..\Patterns\Patterns.vbproj">
<Project>{7C3B0C7E-59FE-4E1A-A655-27AE119F9444}</Project>
<Name>Patterns</Name>
</ProjectReference>
<ProjectReference Include="..\Windows\Windows.vbproj">
<Project>{5efaef9b-90b9-4f05-9f70-f79ad77fff86}</Project>
<Name>Windows</Name>

View File

@@ -1,9 +1,12 @@
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.ZooFlow.Params
Imports DigitalData.Modules.ZooFlow.State
Imports Patterns
Public Class ProfileFilter
Private _ProfileMatch As ProfileMatch
@@ -215,7 +218,7 @@ Public Class ProfileFilter
Next
If oFound Then
oFilteredProfiles.Add(oProfile)
oControls.Add(oControl)
End If
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oControl.WindowId & "-WINDOW")
@@ -235,58 +238,76 @@ Public Class ProfileFilter
Return oFilteredProfiles
End Function
'Public Function FilterProfilesBySearchResults(Profiles As List(Of ProfileData), DataSearchTable As DataTable, DocSearchTable As DataTable) As List(Of ProfileData)
' Dim oProfiles As New List(Of ProfileData)
Public Function FilterProfilesBySearchResults(Profiles As List(Of ProfileData), Database As MSSQLServer, User As UserState) As List(Of ProfileData)
Dim oProfiles As New List(Of ProfileData)
' For Each oProfile In Profiles
' Dim oResultDocs As Integer = 0
' Dim oResultData As Integer = 0
For Each oProfile In Profiles
Dim oResultDocs As Integer = 0
Dim oResultData As Integer = 0
' Dim oPatterns As New ClassPatterns(_LogConfig)
' Dim oDataSearches As DataTable = DataSearchTable
' Dim oDocSearches As DataTable = DocSearchTable
Dim oPatterns As New ClassPatterns(_LogConfig)
' For Each oRow As DataRow In oDataSearches.Rows
' Dim oCountCommand = String.Empty
' Try
' oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
Dim oDataSearches As DataTable
Dim oDocSearches As DataTable
' If oCountCommand = String.Empty Then
' Continue For
' End If
Try
oDataSearches = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
Catch ex As Exception
_Logger.Error(ex)
Continue For
End Try
' oCountCommand = oPatterns.ReplaceAllValues(oCountCommand, My.Application.User)
' oResultData += NotNull(Of Integer)(My.Database.GetScalarValue(oCountCommand), 0)
' Catch ex As Exception
' _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
' End Try
' Next
Try
oDocSearches = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
Catch ex As Exception
_Logger.Error(ex)
Continue For
End Try
' For Each oRow As DataRow In oDocSearches.Rows
' Dim oCountCommand = String.Empty
' Try
' oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
For Each oRow As DataRow In oDataSearches.Rows
Dim oCountCommand = String.Empty
Try
oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
' If oCountCommand = String.Empty Then
' Continue For
' End If
If oCountCommand = String.Empty Then
Continue For
End If
' oCountCommand = oPatterns.ReplaceAllValues(oCountCommand, My.Application.User)
' oResultDocs += NotNull(Of Integer)(My.Database.GetScalarValue(oCountCommand), 0)
' Catch ex As Exception
' _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
' End Try
' Next
oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
' If oResultData > 0 Or oResultDocs > 0 Then
' oProfile.CountData = oResultData
' oProfile.CountDocs = oResultDocs
' oProfiles.Add(oProfile)
' End If
' Next
oResultData += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0)
Catch ex As Exception
_Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
End Try
Next
' Return oProfiles
'End Function
For Each oRow As DataRow In oDocSearches.Rows
Dim oCountCommand = String.Empty
Try
oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
If oCountCommand = String.Empty Then
Continue For
End If
oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
oResultDocs += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0)
Catch ex As Exception
_Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
End Try
Next
If oResultData > 0 Or oResultDocs > 0 Then
oProfile.CountData = oResultData
oProfile.CountDocs = oResultDocs
oProfiles.Add(oProfile)
End If
Next
Return oProfiles
End Function
Public Function FilterWindowsByWindowClipboardRegex(Profiles As List(Of ProfileData), ClipboardContents As String) As List(Of ProfileData)
Dim oProfiles As New List(Of ProfileData)

View File

@@ -22,7 +22,9 @@ Partial Class frmTreeView
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmTreeView))
Me.TreeView1 = New System.Windows.Forms.TreeView()
Me.ImageList1 = New System.Windows.Forms.ImageList()
Me.SuspendLayout()
'
'TreeView1
@@ -33,6 +35,16 @@ Partial Class frmTreeView
Me.TreeView1.Size = New System.Drawing.Size(800, 450)
Me.TreeView1.TabIndex = 0
'
'ImageList1
'
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
Me.ImageList1.Images.SetKeyName(0, "award_star_gold_1.png")
Me.ImageList1.Images.SetKeyName(1, "application_xp.png")
Me.ImageList1.Images.SetKeyName(2, "application_form.png")
Me.ImageList1.Images.SetKeyName(3, "brick.png")
Me.ImageList1.Images.SetKeyName(4, "application_view_tile.png")
'
'frmTreeView
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -46,4 +58,5 @@ Partial Class frmTreeView
End Sub
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
End Class

View File

@@ -117,4 +117,65 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ImageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="ImageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAAD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