WIP: Profile Matching

This commit is contained in:
Jonathan Jenne
2019-07-18 16:04:03 +02:00
parent 1652a4fb96
commit f7ff19afeb
8 changed files with 376 additions and 164 deletions

View File

@@ -1,6 +1,10 @@
Imports DevExpress.XtraEditors
Public Class frmProfileMatch
Private PrimaryFont As New Font("Segoe UI", 12, FontStyle.Bold)
Private SecondaryFont As New Font("Segoe UI", 10)
Private Sub frmProfileMatch_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not ConfigManager.Config.MatchWindowLocation.IsEmpty Then
Location = ConfigManager.Config.MatchWindowLocation
@@ -21,38 +25,35 @@ Public Class frmProfileMatch
Sub CreateTiles()
Try
Dim oPrimaryFont As New Font("Segoe UI", 12, FontStyle.Bold)
Dim oSecondaryFont As New Font("Segoe UI", 10)
Dim oGroup = TileControl1.Groups.Item("TileGroupDocuments")
oGroup.Items.Clear()
For Each oRow As DataRow In CurrDT_PROFILE_MATCH.Rows
Dim oItem As New TileItem() With {.Tag = oRow.Item("GUID")}
For Each oProfile As ClassProfileFilter.ProfileData In CURRENT_MATCHING_PROFILES
Dim oItem As New TileItem() With {.Tag = oProfile.Guid}
oItem.Elements.Clear()
Dim oNameElement = New TileItemElement()
oNameElement.Text = oRow.Item("NAME")
oNameElement.Text = oProfile.Name
oNameElement.TextAlignment = TileItemContentAlignment.TopLeft
oNameElement.Appearance.Normal.Font = oPrimaryFont
oNameElement.Appearance.Normal.Font = PrimaryFont
oItem.Elements.Add(oNameElement)
Dim oCommentElement = New TileItemElement()
oCommentElement.Text = oRow.Item("COMMENT")
oCommentElement.Text = oProfile.Comment
oCommentElement.TextAlignment = TileItemContentAlignment.MiddleLeft
oCommentElement.Appearance.Normal.Font = oSecondaryFont
oCommentElement.Appearance.Normal.Font = SecondaryFont
oItem.Elements.Add(oCommentElement)
Dim oCountElement = New TileItemElement()
oCountElement.TextAlignment = TileItemContentAlignment.BottomRight
oCountElement.Appearance.Normal.Font = oSecondaryFont
oCountElement.Appearance.Normal.Font = SecondaryFont
Dim oText As String
If oRow.Item("COUNT") = 99999 Then
If oProfile.Count = 99999 Then
oText = "DocCount 0 = Check Your MatchCountConfig in Profiles!"
ElseIf oRow.Item("COUNT") = 99998 Then
ElseIf oProfile.Count = 99998 Then
oText = "DocCount (MatchCountConfig has not been configured)"
Else
oText = $"{oRow.Item("COUNT")} files!"
oText = $"{oProfile.Count} files!"
End If
oCountElement.Text = oText
@@ -61,19 +62,11 @@ Public Class frmProfileMatch
oGroup.Items.Add(oItem)
Next
Catch ex As Exception
Logger.Error(ex)
MsgBox("Error while creating profile tiles!" & vbNewLine & ex.Message)
End Try
End Sub
Sub OpenResults_Doc()
Dim oFrmResultDoc As Form = New frmResultDoc
oFrmResultDoc.Show()
End Sub
Sub OpenResults_Data()
Dim oFrmResultData As Form = New frmResultSQL
oFrmResultData.Show()
End Sub
Private Sub frmProfileMatch_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
ConfigManager.Config.MatchWindowSize = Size
@@ -99,11 +92,11 @@ Public Class frmProfileMatch
If oProfileId Is Nothing Then
Dim oResult As String = ""
For Each oRow As DataRow In CurrDT_PROFILE_MATCH.Rows
For Each oProfile As ClassProfileFilter.ProfileData In CURRENT_MATCHING_PROFILES
If oResult = "" Then
oResult = oRow.Item("GUID")
oResult = oProfile.Guid
Else
oResult &= "," & oRow.Item("GUID")
oResult &= "," & oProfile.Guid
End If
Next
CurrDocSearch2Load = oResult
@@ -113,20 +106,11 @@ Public Class frmProfileMatch
CurrDataSearch2Load = oProfileId
End If
OpenResults_Doc()
OpenResults_Data()
Me.Hide()
End Sub
' Show Result Document Form
Dim oFrmResultDoc As Form = New frmResultDoc(Me)
oFrmResultDoc.Show()
Private Sub frmProfileMatch_VisibleChanged(sender As Object, e As EventArgs) Handles Me.VisibleChanged
If Me.Visible = True Then
If CurrSearchOpen = True Then
End If
Else
If CurrSearchOpen = True Then
End If
End If
' ..and hide myself
Hide()
End Sub
End Class