DocumentResultList
This commit is contained in:
parent
4cf70e1c4e
commit
d78254fc9c
@ -51,6 +51,7 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.Utils.v18.1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.XtraEditors.v18.1.dll</HintPath>
|
||||
@ -115,6 +116,7 @@
|
||||
</Compile>
|
||||
<Compile Include="ProfileFilter.vb" />
|
||||
<Compile Include="ProfileMatch.vb" />
|
||||
<Compile Include="ProfileSearches.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="frmMatch.resx">
|
||||
|
||||
@ -238,7 +238,7 @@ Public Class ProfileFilter
|
||||
Return oFilteredProfiles
|
||||
End Function
|
||||
|
||||
Public Function FilterProfilesBySearchResults(Profiles As List(Of ProfileData), Database As MSSQLServer, User As UserState) As List(Of ProfileData)
|
||||
Public Function FilterProfilesBySearchResults(Profiles As List(Of ProfileData), Database As MSSQLServer, User As UserState, ClipboardContents As String) As List(Of ProfileData)
|
||||
Dim oProfiles As New List(Of ProfileData)
|
||||
|
||||
For Each oProfile In Profiles
|
||||
@ -275,6 +275,7 @@ Public Class ProfileFilter
|
||||
|
||||
oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
|
||||
oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
|
||||
oCountCommand = oPatterns.ReplaceClipboardContents(oCountCommand, ClipboardContents)
|
||||
|
||||
oResultData += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0)
|
||||
Catch ex As Exception
|
||||
@ -293,6 +294,8 @@ Public Class ProfileFilter
|
||||
|
||||
oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
|
||||
oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
|
||||
oCountCommand = oPatterns.ReplaceClipboardContents(oCountCommand, ClipboardContents)
|
||||
|
||||
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)
|
||||
|
||||
97
ClipboardWatcher/ProfileSearches.vb
Normal file
97
ClipboardWatcher/ProfileSearches.vb
Normal file
@ -0,0 +1,97 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
|
||||
Public Class ProfileSearches
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Logger As Logger
|
||||
Private _Environment As Environment
|
||||
Private _Params As ClipboardWatcherParams
|
||||
|
||||
Public Class Search
|
||||
Public DataTable As DataTable
|
||||
Public TabIndex As Integer
|
||||
Public TabCaption As String
|
||||
Public ProfileId As Integer
|
||||
Public SQLCommand As String
|
||||
End Class
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As ClipboardWatcherParams)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Environment = Environment
|
||||
_Params = Params
|
||||
End Sub
|
||||
|
||||
Public Async Function LoadDocumentSearchesAsync() As Task(Of List(Of Search))
|
||||
Return Await Task.Run(AddressOf DoLoadDocumentSearches)
|
||||
End Function
|
||||
|
||||
Private Function DoLoadDocumentSearches() As List(Of Search)
|
||||
Dim oMatchingIds = String.Join(",", _Params.MatchingProfiles.Select(Function(p) p.Guid).ToArray())
|
||||
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID in ({oMatchingIds}) ORDER BY TAB_INDEX"
|
||||
Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
|
||||
Dim oDocSearches As New List(Of Search)
|
||||
Dim oCounter As Integer = 0
|
||||
Dim oPatterns As New Patterns.ClassPatterns(_LogConfig)
|
||||
|
||||
For Each oRow As DataRow In oSearchesDataTable.Rows
|
||||
Dim oProfileId As Integer = oRow.Item("PROFILE_ID")
|
||||
Dim oTabTitle As String = oRow.Item("TAB_TITLE")
|
||||
Dim oConnectionId As Integer = oRow.Item("CONN_ID")
|
||||
|
||||
oSQL = oRow.Item("SQL_COMMAND")
|
||||
oSQL = oPatterns.ReplaceUserValues(oSQL, _Environment.User)
|
||||
oSQL = oPatterns.ReplaceInternalValues(oSQL)
|
||||
oSQL = oPatterns.ReplaceClipboardContents(oSQL, _Params.ClipboardContents)
|
||||
|
||||
Dim oDatatable As DataTable = _Environment.Database.GetDatatable(oSQL, oConnectionId)
|
||||
oDocSearches.Add(New Search() With {
|
||||
.DataTable = oDatatable,
|
||||
.ProfileId = oProfileId,
|
||||
.TabCaption = oTabTitle,
|
||||
.TabIndex = oCounter,
|
||||
.SQLCommand = oSQL
|
||||
})
|
||||
|
||||
oCounter += 1
|
||||
Next
|
||||
|
||||
Return oDocSearches
|
||||
End Function
|
||||
|
||||
Public Async Function LoadDataSearchesAsync() As Task(Of List(Of Search))
|
||||
Return Await Task.Run(AddressOf DoLoadDataSearches)
|
||||
End Function
|
||||
|
||||
Private Function DoLoadDataSearches() As List(Of Search)
|
||||
Dim oMatchingIds = String.Join(",", _Params.MatchingProfiles.Select(Function(p) p.Guid).ToArray())
|
||||
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID in ({oMatchingIds}) ORDER BY TAB_INDEX"
|
||||
Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
|
||||
Dim oDataSearches As New List(Of Search)
|
||||
Dim oCounter As Integer = 0
|
||||
Dim oPatterns As New Patterns.ClassPatterns(_LogConfig)
|
||||
|
||||
For Each oRow As DataRow In oSearchesDataTable.Rows
|
||||
Dim oProfileId As Integer = oRow.Item("PROFILE_ID")
|
||||
Dim oTabTitle As String = oRow.Item("TAB_TITLE")
|
||||
Dim oConnectionId As Integer = oRow.Item("CONN_ID")
|
||||
|
||||
oSQL = oRow.Item("SQL_COMMAND")
|
||||
oSQL = oPatterns.ReplaceUserValues(oSQL, _Environment.User)
|
||||
oSQL = oPatterns.ReplaceInternalValues(oSQL)
|
||||
|
||||
Dim oDatatable As DataTable = _Environment.Database.GetDatatable(oSQL, oConnectionId)
|
||||
oDataSearches.Add(New Search() With {
|
||||
.DataTable = oDatatable,
|
||||
.ProfileId = oProfileId,
|
||||
.TabCaption = oTabTitle,
|
||||
.TabIndex = oCounter,
|
||||
.SQLCommand = oSQL
|
||||
})
|
||||
|
||||
oCounter += 1
|
||||
Next
|
||||
|
||||
Return oDataSearches
|
||||
End Function
|
||||
End Class
|
||||
@ -177,52 +177,58 @@ Public Class frmMatch
|
||||
oForm.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub TileControlMatch_ItemClick(sender As Object, e As TileItemEventArgs) Handles TileControlMatch.ItemClick
|
||||
Private Async Sub TileControlMatch_ItemClick(sender As Object, e As TileItemEventArgs) Handles TileControlMatch.ItemClick
|
||||
Dim oItem As TileItem = e.Item
|
||||
Dim oProfileId As Integer = oItem.Tag
|
||||
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params)
|
||||
|
||||
Select Case oItem.Group.Name
|
||||
Case TileGroupData.Name
|
||||
OpenResultForms(oProfileId, ProfileType.DATA_ONLY)
|
||||
'OpenResultForms(oProfileId, ProfileType.DATA_ONLY)
|
||||
|
||||
Case TileGroupDocuments.Name
|
||||
OpenResultForms(oProfileId, ProfileType.DOCS_ONLY)
|
||||
Dim oSearches = Await oProfileSearch.LoadDocumentSearchesAsync()
|
||||
OpenDocumentResults(oProfileId, oSearches)
|
||||
|
||||
Case Else
|
||||
OpenResultForms(oProfileId, ProfileType.ANY)
|
||||
'OpenResultForms(oProfileId, ProfileType.ANY)
|
||||
End Select
|
||||
|
||||
Hide()
|
||||
End Sub
|
||||
|
||||
Private Sub OpenDocumentResults(ProfileId As Integer, Searches As List(Of ProfileSearches.Search))
|
||||
Dim oParams = New ResultListParams()
|
||||
|
||||
For Each oSearch In Searches
|
||||
oParams.Results.Add(New DocumentResult() With {
|
||||
.Datatable = oSearch.DataTable
|
||||
})
|
||||
Next
|
||||
|
||||
Dim oForm As New frmDocumentResultList(_LogConfig, _Environment, oParams)
|
||||
oForm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub OpenResultForms(ProfileId As Integer, OpenType As ProfileType)
|
||||
Dim oMatchingProfiles As New List(Of ProfileData)
|
||||
'If OpenType = ProfileType.ANY Or OpenType = ProfileType.DOCS_ONLY Then
|
||||
' ' Show Result Document Form
|
||||
' Dim oForm As New frmResult(_LogConfig, _Environment, _Params, frmResult.ResultType.Document)
|
||||
' AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
' OpenForms.Add(oForm)
|
||||
|
||||
' TODO: Implement Show All
|
||||
' oForm.Show()
|
||||
'End If
|
||||
|
||||
' Click on specific profile
|
||||
Dim oProfile As ProfileData = _Params.MatchingProfiles.
|
||||
Where(Function(p) p.Guid = ProfileId).
|
||||
First()
|
||||
oMatchingProfiles.Add(oProfile)
|
||||
'If OpenType = ProfileType.ANY Or OpenType = ProfileType.DATA_ONLY Then
|
||||
' ' Show Result Data Form
|
||||
' Dim oForm As New frmResult(_LogConfig, _Environment, _Params, frmResult.ResultType.Data)
|
||||
' AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
' OpenForms.Add(oForm)
|
||||
|
||||
If OpenType = ProfileType.ANY Or OpenType = ProfileType.DOCS_ONLY Then
|
||||
' Show Result Document Form
|
||||
Dim oForm As New frmResult(_LogConfig, _Environment, _Params, frmResult.ResultType.Document)
|
||||
AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
OpenForms.Add(oForm)
|
||||
|
||||
oForm.Show()
|
||||
End If
|
||||
|
||||
If OpenType = ProfileType.ANY Or OpenType = ProfileType.DATA_ONLY Then
|
||||
' Show Result Data Form
|
||||
Dim oForm As New frmResult(_LogConfig, _Environment, _Params, frmResult.ResultType.Data)
|
||||
AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
OpenForms.Add(oForm)
|
||||
|
||||
oForm.Show()
|
||||
End If
|
||||
' oForm.Show()
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub ProfileResultForm_Closed(sender As Object, e As FormClosedEventArgs)
|
||||
|
||||
@ -110,6 +110,7 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ResultListParams.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="frmDocumentResultList.resx">
|
||||
|
||||
7
Common/ResultListParams.vb
Normal file
7
Common/ResultListParams.vb
Normal file
@ -0,0 +1,7 @@
|
||||
Public Class ResultListParams
|
||||
Public Results As New List(Of DocumentResult)
|
||||
End Class
|
||||
|
||||
Public Class DocumentResult
|
||||
Public Datatable As DataTable
|
||||
End Class
|
||||
71
Common/frmDocumentResultList.Designer.vb
generated
71
Common/frmDocumentResultList.Designer.vb
generated
@ -20,26 +20,26 @@ Partial Class frmDocumentResultList
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
||||
Me.BarToggleSwitchItem1 = New DevExpress.XtraBars.BarToggleSwitchItem()
|
||||
Me.BarToggleSwitchItem2 = New DevExpress.XtraBars.BarToggleSwitchItem()
|
||||
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
|
||||
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
||||
Me.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
|
||||
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.GridControl2 = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView2 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.GridControl3 = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView3 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.BarToggleSwitchItem1 = New DevExpress.XtraBars.BarToggleSwitchItem()
|
||||
Me.BarToggleSwitchItem2 = New DevExpress.XtraBars.BarToggleSwitchItem()
|
||||
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl1.SuspendLayout()
|
||||
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl2.SuspendLayout()
|
||||
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl2.SuspendLayout()
|
||||
CType(Me.GridControl2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridView2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridControl3, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
@ -57,6 +57,18 @@ Partial Class frmDocumentResultList
|
||||
Me.RibbonControl.Size = New System.Drawing.Size(1189, 143)
|
||||
Me.RibbonControl.StatusBar = Me.RibbonStatusBar
|
||||
'
|
||||
'BarToggleSwitchItem1
|
||||
'
|
||||
Me.BarToggleSwitchItem1.Caption = "BarToggleSwitchItem1"
|
||||
Me.BarToggleSwitchItem1.Id = 1
|
||||
Me.BarToggleSwitchItem1.Name = "BarToggleSwitchItem1"
|
||||
'
|
||||
'BarToggleSwitchItem2
|
||||
'
|
||||
Me.BarToggleSwitchItem2.Caption = "BarToggleSwitchItem2"
|
||||
Me.BarToggleSwitchItem2.Id = 2
|
||||
Me.BarToggleSwitchItem2.Name = "BarToggleSwitchItem2"
|
||||
'
|
||||
'RibbonPage1
|
||||
'
|
||||
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1})
|
||||
@ -91,21 +103,6 @@ Partial Class frmDocumentResultList
|
||||
Me.SplitContainerControl1.TabIndex = 2
|
||||
Me.SplitContainerControl1.Text = "SplitContainerControl1"
|
||||
'
|
||||
'SplitContainerControl2
|
||||
'
|
||||
Me.SplitContainerControl2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerControl2.Horizontal = False
|
||||
Me.SplitContainerControl2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerControl2.Name = "SplitContainerControl2"
|
||||
Me.SplitContainerControl2.Panel1.Controls.Add(Me.GridControl2)
|
||||
Me.SplitContainerControl2.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerControl2.Panel2.Controls.Add(Me.GridControl3)
|
||||
Me.SplitContainerControl2.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl2.Size = New System.Drawing.Size(653, 497)
|
||||
Me.SplitContainerControl2.SplitterPosition = 223
|
||||
Me.SplitContainerControl2.TabIndex = 0
|
||||
Me.SplitContainerControl2.Text = "SplitContainerControl2"
|
||||
'
|
||||
'GridControl1
|
||||
'
|
||||
Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
@ -121,6 +118,22 @@ Partial Class frmDocumentResultList
|
||||
'
|
||||
Me.GridView1.GridControl = Me.GridControl1
|
||||
Me.GridView1.Name = "GridView1"
|
||||
Me.GridView1.OptionsView.ShowAutoFilterRow = True
|
||||
'
|
||||
'SplitContainerControl2
|
||||
'
|
||||
Me.SplitContainerControl2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerControl2.Horizontal = False
|
||||
Me.SplitContainerControl2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerControl2.Name = "SplitContainerControl2"
|
||||
Me.SplitContainerControl2.Panel1.Controls.Add(Me.GridControl2)
|
||||
Me.SplitContainerControl2.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerControl2.Panel2.Controls.Add(Me.GridControl3)
|
||||
Me.SplitContainerControl2.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl2.Size = New System.Drawing.Size(653, 497)
|
||||
Me.SplitContainerControl2.SplitterPosition = 223
|
||||
Me.SplitContainerControl2.TabIndex = 0
|
||||
Me.SplitContainerControl2.Text = "SplitContainerControl2"
|
||||
'
|
||||
'GridControl2
|
||||
'
|
||||
@ -137,6 +150,7 @@ Partial Class frmDocumentResultList
|
||||
'
|
||||
Me.GridView2.GridControl = Me.GridControl2
|
||||
Me.GridView2.Name = "GridView2"
|
||||
Me.GridView2.OptionsView.ShowAutoFilterRow = True
|
||||
'
|
||||
'GridControl3
|
||||
'
|
||||
@ -153,18 +167,7 @@ Partial Class frmDocumentResultList
|
||||
'
|
||||
Me.GridView3.GridControl = Me.GridControl3
|
||||
Me.GridView3.Name = "GridView3"
|
||||
'
|
||||
'BarToggleSwitchItem1
|
||||
'
|
||||
Me.BarToggleSwitchItem1.Caption = "BarToggleSwitchItem1"
|
||||
Me.BarToggleSwitchItem1.Id = 1
|
||||
Me.BarToggleSwitchItem1.Name = "BarToggleSwitchItem1"
|
||||
'
|
||||
'BarToggleSwitchItem2
|
||||
'
|
||||
Me.BarToggleSwitchItem2.Caption = "BarToggleSwitchItem2"
|
||||
Me.BarToggleSwitchItem2.Id = 2
|
||||
Me.BarToggleSwitchItem2.Name = "BarToggleSwitchItem2"
|
||||
Me.GridView3.OptionsView.ShowAutoFilterRow = True
|
||||
'
|
||||
'frmDocumentResultList
|
||||
'
|
||||
@ -181,10 +184,10 @@ Partial Class frmDocumentResultList
|
||||
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl1.ResumeLayout(False)
|
||||
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl2.ResumeLayout(False)
|
||||
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl2.ResumeLayout(False)
|
||||
CType(Me.GridControl2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.GridView2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.GridControl3, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
|
||||
@ -1,6 +1,193 @@
|
||||
Public Class frmDocumentResultList
|
||||
Private Sub frmDocumentResultList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Imports System.Drawing
|
||||
Imports DevExpress.Utils
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
|
||||
Public Class frmDocumentResultList
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Logger As Logger
|
||||
Private _Environment As Environment
|
||||
Private _ResultLists As List(Of DocumentResult)
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As ResultListParams)
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Environment = Environment
|
||||
_ResultLists = Params.Results
|
||||
End Sub
|
||||
|
||||
Private Sub frmDocumentResultList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Dim oCounter = 1
|
||||
|
||||
For Each oList In _ResultLists
|
||||
Select Case _ResultLists.Count
|
||||
Case 1
|
||||
CreateDocumentGrid(GridView1, oList.Datatable)
|
||||
Case 2
|
||||
CreateDocumentGrid(GridView2, oList.Datatable)
|
||||
Case 3
|
||||
CreateDocumentGrid(GridView3, oList.Datatable)
|
||||
End Select
|
||||
oCounter += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CreateDocumentGrid(GridView As GridView, Datatable As DataTable)
|
||||
Dim oMyDocDatatable As New DataTable
|
||||
Try
|
||||
'Die Icon Colum erstellen und konfigurieren
|
||||
Dim oColIcon As New DataColumn() With {
|
||||
.DataType = GetType(Image),
|
||||
.ColumnName = "ICON",
|
||||
.Caption = ""
|
||||
}
|
||||
oMyDocDatatable.Columns.Add(oColIcon)
|
||||
|
||||
Dim oColPath As New DataColumn() With {
|
||||
.DataType = GetType(String),
|
||||
.ColumnName = "FULL_FILENAME",
|
||||
.Caption = "Fullpath"
|
||||
}
|
||||
oMyDocDatatable.Columns.Add(oColPath)
|
||||
|
||||
Dim oColDocID As New DataColumn() With {
|
||||
.DataType = GetType(Int32),
|
||||
.ColumnName = "DocID",
|
||||
.Caption = "DocID"
|
||||
}
|
||||
oMyDocDatatable.Columns.Add(oColDocID)
|
||||
|
||||
Dim oColFilename As New DataColumn() With {
|
||||
.DataType = GetType(String),
|
||||
.ColumnName = "Filename",
|
||||
.Caption = "Filename"
|
||||
}
|
||||
oMyDocDatatable.Columns.Add(oColFilename)
|
||||
|
||||
Dim oRestColArray As New List(Of String)
|
||||
For Each oCol As DataColumn In Datatable.Columns
|
||||
Dim onewColumn As New DataColumn()
|
||||
If oCol.ColumnName <> "DocID" And oCol.ColumnName <> "FULL_FILENAME" And oCol.ColumnName <> "Filename" Then
|
||||
onewColumn.DataType = GetType(String)
|
||||
onewColumn.ColumnName = oCol.ColumnName
|
||||
onewColumn.Caption = oCol.Caption
|
||||
oMyDocDatatable.Columns.Add(onewColumn)
|
||||
oRestColArray.Add(onewColumn.ColumnName)
|
||||
End If
|
||||
|
||||
Next
|
||||
For Each oRow As DataRow In Datatable.Rows
|
||||
Dim oFullpath = oRow.Item("FULL_FILENAME")
|
||||
Dim oDocID = oRow.Item("DocID")
|
||||
'Dim Folderpath = Path.GetDirectoryName(fullpath)
|
||||
Dim oFilename = IO.Path.GetFileName(oFullpath)
|
||||
Dim oFileextension = IO.Path.GetExtension(oFullpath)
|
||||
Dim oNewRow As DataRow
|
||||
oNewRow = oMyDocDatatable.NewRow()
|
||||
'Icon zuweisen
|
||||
Select Case oFileextension.ToUpper
|
||||
Case ".csv".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.xls
|
||||
Case ".txt".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.txt
|
||||
Case ".pdf".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.pdf
|
||||
Case ".doc".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.doc
|
||||
Case ".docx".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.doc
|
||||
Case ".xls".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.xls
|
||||
Case ".xlsx".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.xls
|
||||
Case ".xlsm".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.xls
|
||||
Case ".ppt".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.ppt
|
||||
Case ".pptx".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.ppt
|
||||
Case ".dwg".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.dwg
|
||||
Case ".dxf".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.dxf
|
||||
Case ".msg".ToUpper
|
||||
oNewRow.Item(0) = My.Resources._page
|
||||
Case ".msg".ToUpper
|
||||
oNewRow.Item(0) = My.Resources._page
|
||||
Case ".tif".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.tiff
|
||||
Case ".tiff".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.tiff
|
||||
Case ".jpg".ToUpper
|
||||
oNewRow.Item(0) = My.Resources.jpg
|
||||
Case Else
|
||||
oNewRow.Item(0) = My.Resources._blank
|
||||
End Select
|
||||
'Den Filepath mitgeben
|
||||
oNewRow.Item(1) = oFullpath
|
||||
oNewRow.Item(2) = oDocID
|
||||
oNewRow.Item(3) = oFilename
|
||||
|
||||
Dim i = 4 'Fängt bei 3 an, um die definierten Spalten zu überspringen
|
||||
For Each Colname As String In oRestColArray
|
||||
Dim oRowValue
|
||||
oRowValue = oRow.Item(Colname)
|
||||
oNewRow.Item(i) = oRowValue.ToString
|
||||
i += 1
|
||||
Next
|
||||
oMyDocDatatable.Rows.Add(oNewRow)
|
||||
Next
|
||||
|
||||
Dim oGridControl As GridControl = GridView.GridControl
|
||||
oGridControl.DataSource = oMyDocDatatable
|
||||
oGridControl.ForceInitialize()
|
||||
Try
|
||||
GridView.Columns.Item("DocID").Visible = False
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Try
|
||||
GridView.Columns.Item("FULL_FILENAME").Visible = False
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
|
||||
Dim created, changed As String
|
||||
If _Environment.User.Language <> "de-DE" Then
|
||||
changed = "Changed"
|
||||
created = "Created"
|
||||
Else
|
||||
changed = "Geändert"
|
||||
created = "Erstellt"
|
||||
End If
|
||||
|
||||
Dim createdColumn = GridView.Columns(created)
|
||||
If Not IsNothing(createdColumn) Then
|
||||
createdColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
createdColumn.DisplayFormat.FormatString = _Environment.User.DateFormat & " HH:MM:ss"
|
||||
End If
|
||||
|
||||
Dim changedColumn = GridView.Columns(changed)
|
||||
If Not IsNothing(changedColumn) Then
|
||||
changedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
changedColumn.DisplayFormat.FormatString = _Environment.User.DateFormat & " HH:MM:ss"
|
||||
End If
|
||||
' Alle Spalten aus ReadOnly setzen, danach werden alle passenden auf nicht ReadOnly gesetzt
|
||||
For Each column As GridColumn In GridView.Columns
|
||||
column.OptionsColumn.AllowEdit = False
|
||||
Next
|
||||
GridView.Columns.Item("ICON").MaxWidth = 24
|
||||
GridView.Columns.Item("ICON").MinWidth = 24
|
||||
GridView.OptionsView.BestFitMaxRowCount = -1
|
||||
GridView.BestFitColumns(True)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub BarToggleSwitchItem1_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarToggleSwitchItem1.CheckedChanged
|
||||
|
||||
@ -84,6 +84,8 @@ Public Class ClassPatterns
|
||||
oResult = oResult.Replace(CLIPBOARD_VALUE_DE.ToUpper, ClipboardContents)
|
||||
oResult = oResult.Replace(CLIPBOARD_VALUE_EN.ToLower, ClipboardContents)
|
||||
oResult = oResult.Replace(CLIPBOARD_VALUE_EN.ToUpper, ClipboardContents)
|
||||
oResult = oResult.Replace(CLIPBOARD_VALUE_DE, ClipboardContents)
|
||||
oResult = oResult.Replace(CLIPBOARD_VALUE_EN, ClipboardContents)
|
||||
|
||||
Return oResult
|
||||
End Function
|
||||
|
||||
2
ZooFlow/My Project/Application.Designer.vb
generated
2
ZooFlow/My Project/Application.Designer.vb
generated
@ -30,7 +30,7 @@ Namespace My
|
||||
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()>
|
||||
Protected Overrides Sub OnCreateMainForm()
|
||||
Me.MainForm = Global.DigitalData.GUIs.ZooFlow.frmAdmin
|
||||
End Sub
|
||||
|
||||
4
ZooFlow/My Project/Settings.Designer.vb
generated
4
ZooFlow/My Project/Settings.Designer.vb
generated
@ -43,8 +43,8 @@ Partial Friend NotInheritable Class Settings
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Public Class ClassClipboardWatcherQueries
|
||||
Public Function VWCW_USER_PROFILE(UserId As Integer) As String
|
||||
Return $"SELECT DISTINCT GUID, NAME, REGEX_EXPRESSION, COMMENT, PROC_NAME, PROFILE_TYPE FROM VWCW_USER_PROFILE WHERE USER_ID = {UserId} OR GROUP_ID IN (SELECT DISTINCT GUID FROM TBDD_GROUPS WHERE GUID IN (SELECT GROUP_ID FROM TBDD_GROUPS_USER WHERE USER_ID = {0}))"
|
||||
Return $"SELECT DISTINCT GUID, NAME, REGEX_EXPRESSION, COMMENT, PROC_NAME, PROFILE_TYPE FROM VWCW_USER_PROFILE WHERE USER_ID = {UserId} OR GROUP_ID IN (SELECT DISTINCT GUID FROM TBDD_GROUPS WHERE GUID IN (SELECT GROUP_ID FROM TBDD_GROUPS_USER WHERE USER_ID = {UserId}))"
|
||||
End Function
|
||||
|
||||
Public Function TBCW_PROFILE_PROCESS(UserId As Integer) As String
|
||||
|
||||
@ -94,6 +94,7 @@ Partial Public Class frmAdmin
|
||||
Dim oWindow As New Window(My.LogConfig)
|
||||
Dim oWindowInfo = oWindow.GetWindowInfo()
|
||||
Dim oClipboardContents As String = Clipboard.GetText()
|
||||
Dim oUserState = My.Application.User
|
||||
|
||||
Try
|
||||
oProfileFilter = New ProfileFilter(My.LogConfig,
|
||||
@ -112,7 +113,8 @@ Partial Public Class frmAdmin
|
||||
Return oProfileFilter.FilterProfilesBySearchResults(
|
||||
oMatchingProfiles,
|
||||
My.Database,
|
||||
My.Application.User)
|
||||
oUserState,
|
||||
oClipboardContents)
|
||||
End Function)
|
||||
oMatchingProfiles = oProfileFilter.ClearNotMatchedProfiles(oMatchingProfiles)
|
||||
Catch ex As Exception
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user