rename frmMain to frmAdmin, work on result forms
This commit is contained in:
@@ -82,10 +82,10 @@
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="frmDocumentResult.Designer.vb">
|
||||
<DependentUpon>frmDocumentResult.vb</DependentUpon>
|
||||
<Compile Include="frmResult.Designer.vb">
|
||||
<DependentUpon>frmResult.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmDocumentResult.vb">
|
||||
<Compile Include="frmResult.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IResultForm.vb" />
|
||||
@@ -106,8 +106,8 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="frmDocumentResult.resx">
|
||||
<DependentUpon>frmDocumentResult.vb</DependentUpon>
|
||||
<EmbeddedResource Include="frmResult.resx">
|
||||
<DependentUpon>frmResult.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\licenses.licx" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmDocumentResult
|
||||
Partial Class frmResult
|
||||
Inherits DevExpress.XtraEditors.XtraForm
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
@@ -19,14 +19,16 @@ Partial Class frmDocumentResult
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.XtraTabControl = New DevExpress.XtraTab.XtraTabControl()
|
||||
Me.XtraTabPage1 = New DevExpress.XtraTab.XtraTabPage()
|
||||
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.BarManager1 = New DevExpress.XtraBars.BarManager()
|
||||
Me.BarManager1 = New DevExpress.XtraBars.BarManager(Me.components)
|
||||
Me.Bar2 = New DevExpress.XtraBars.Bar()
|
||||
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.Bar3 = New DevExpress.XtraBars.Bar()
|
||||
Me.LabelStatus = New DevExpress.XtraBars.BarStaticItem()
|
||||
Me.barDockControlTop = New DevExpress.XtraBars.BarDockControl()
|
||||
Me.barDockControlBottom = New DevExpress.XtraBars.BarDockControl()
|
||||
Me.barDockControlLeft = New DevExpress.XtraBars.BarDockControl()
|
||||
@@ -43,7 +45,6 @@ Partial Class frmDocumentResult
|
||||
Me.XtraTabPage5 = New DevExpress.XtraTab.XtraTabPage()
|
||||
Me.GridControl5 = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView5 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.LabelStatus = New DevExpress.XtraBars.BarStaticItem()
|
||||
CType(Me.XtraTabControl, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.XtraTabControl.SuspendLayout()
|
||||
Me.XtraTabPage1.SuspendLayout()
|
||||
@@ -70,7 +71,7 @@ Partial Class frmDocumentResult
|
||||
Me.XtraTabControl.Location = New System.Drawing.Point(0, 20)
|
||||
Me.XtraTabControl.Name = "XtraTabControl"
|
||||
Me.XtraTabControl.SelectedTabPage = Me.XtraTabPage1
|
||||
Me.XtraTabControl.Size = New System.Drawing.Size(697, 483)
|
||||
Me.XtraTabControl.Size = New System.Drawing.Size(796, 483)
|
||||
Me.XtraTabControl.TabIndex = 0
|
||||
Me.XtraTabControl.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.XtraTabPage1, Me.XtraTabPage2, Me.XtraTabPage3, Me.XtraTabPage4, Me.XtraTabPage5})
|
||||
'
|
||||
@@ -78,7 +79,7 @@ Partial Class frmDocumentResult
|
||||
'
|
||||
Me.XtraTabPage1.Controls.Add(Me.GridControl1)
|
||||
Me.XtraTabPage1.Name = "XtraTabPage1"
|
||||
Me.XtraTabPage1.Size = New System.Drawing.Size(691, 455)
|
||||
Me.XtraTabPage1.Size = New System.Drawing.Size(790, 455)
|
||||
Me.XtraTabPage1.Text = "XtraTabPage1"
|
||||
'
|
||||
'GridControl1
|
||||
@@ -88,7 +89,7 @@ Partial Class frmDocumentResult
|
||||
Me.GridControl1.MainView = Me.GridView1
|
||||
Me.GridControl1.MenuManager = Me.BarManager1
|
||||
Me.GridControl1.Name = "GridControl1"
|
||||
Me.GridControl1.Size = New System.Drawing.Size(691, 455)
|
||||
Me.GridControl1.Size = New System.Drawing.Size(790, 455)
|
||||
Me.GridControl1.TabIndex = 0
|
||||
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
|
||||
'
|
||||
@@ -141,13 +142,19 @@ Partial Class frmDocumentResult
|
||||
Me.Bar3.OptionsBar.UseWholeRow = True
|
||||
Me.Bar3.Text = "Statusleiste"
|
||||
'
|
||||
'LabelStatus
|
||||
'
|
||||
Me.LabelStatus.Caption = "Status"
|
||||
Me.LabelStatus.Id = 1
|
||||
Me.LabelStatus.Name = "LabelStatus"
|
||||
'
|
||||
'barDockControlTop
|
||||
'
|
||||
Me.barDockControlTop.CausesValidation = False
|
||||
Me.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.barDockControlTop.Location = New System.Drawing.Point(0, 0)
|
||||
Me.barDockControlTop.Manager = Me.BarManager1
|
||||
Me.barDockControlTop.Size = New System.Drawing.Size(697, 20)
|
||||
Me.barDockControlTop.Size = New System.Drawing.Size(796, 20)
|
||||
'
|
||||
'barDockControlBottom
|
||||
'
|
||||
@@ -155,7 +162,7 @@ Partial Class frmDocumentResult
|
||||
Me.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.barDockControlBottom.Location = New System.Drawing.Point(0, 503)
|
||||
Me.barDockControlBottom.Manager = Me.BarManager1
|
||||
Me.barDockControlBottom.Size = New System.Drawing.Size(697, 25)
|
||||
Me.barDockControlBottom.Size = New System.Drawing.Size(796, 25)
|
||||
'
|
||||
'barDockControlLeft
|
||||
'
|
||||
@@ -169,7 +176,7 @@ Partial Class frmDocumentResult
|
||||
'
|
||||
Me.barDockControlRight.CausesValidation = False
|
||||
Me.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.barDockControlRight.Location = New System.Drawing.Point(697, 20)
|
||||
Me.barDockControlRight.Location = New System.Drawing.Point(796, 20)
|
||||
Me.barDockControlRight.Manager = Me.BarManager1
|
||||
Me.barDockControlRight.Size = New System.Drawing.Size(0, 483)
|
||||
'
|
||||
@@ -177,7 +184,7 @@ Partial Class frmDocumentResult
|
||||
'
|
||||
Me.XtraTabPage2.Controls.Add(Me.GridControl2)
|
||||
Me.XtraTabPage2.Name = "XtraTabPage2"
|
||||
Me.XtraTabPage2.Size = New System.Drawing.Size(691, 457)
|
||||
Me.XtraTabPage2.Size = New System.Drawing.Size(790, 455)
|
||||
Me.XtraTabPage2.Text = "XtraTabPage2"
|
||||
'
|
||||
'GridControl2
|
||||
@@ -187,7 +194,7 @@ Partial Class frmDocumentResult
|
||||
Me.GridControl2.MainView = Me.GridView2
|
||||
Me.GridControl2.MenuManager = Me.BarManager1
|
||||
Me.GridControl2.Name = "GridControl2"
|
||||
Me.GridControl2.Size = New System.Drawing.Size(691, 457)
|
||||
Me.GridControl2.Size = New System.Drawing.Size(790, 455)
|
||||
Me.GridControl2.TabIndex = 0
|
||||
Me.GridControl2.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView2})
|
||||
'
|
||||
@@ -200,7 +207,7 @@ Partial Class frmDocumentResult
|
||||
'
|
||||
Me.XtraTabPage3.Controls.Add(Me.GridControl3)
|
||||
Me.XtraTabPage3.Name = "XtraTabPage3"
|
||||
Me.XtraTabPage3.Size = New System.Drawing.Size(691, 457)
|
||||
Me.XtraTabPage3.Size = New System.Drawing.Size(790, 455)
|
||||
Me.XtraTabPage3.Text = "XtraTabPage3"
|
||||
'
|
||||
'GridControl3
|
||||
@@ -210,7 +217,7 @@ Partial Class frmDocumentResult
|
||||
Me.GridControl3.MainView = Me.GridView3
|
||||
Me.GridControl3.MenuManager = Me.BarManager1
|
||||
Me.GridControl3.Name = "GridControl3"
|
||||
Me.GridControl3.Size = New System.Drawing.Size(691, 457)
|
||||
Me.GridControl3.Size = New System.Drawing.Size(790, 455)
|
||||
Me.GridControl3.TabIndex = 0
|
||||
Me.GridControl3.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView3})
|
||||
'
|
||||
@@ -223,7 +230,7 @@ Partial Class frmDocumentResult
|
||||
'
|
||||
Me.XtraTabPage4.Controls.Add(Me.GridControl4)
|
||||
Me.XtraTabPage4.Name = "XtraTabPage4"
|
||||
Me.XtraTabPage4.Size = New System.Drawing.Size(691, 457)
|
||||
Me.XtraTabPage4.Size = New System.Drawing.Size(790, 455)
|
||||
Me.XtraTabPage4.Text = "XtraTabPage4"
|
||||
'
|
||||
'GridControl4
|
||||
@@ -233,7 +240,7 @@ Partial Class frmDocumentResult
|
||||
Me.GridControl4.MainView = Me.GridView4
|
||||
Me.GridControl4.MenuManager = Me.BarManager1
|
||||
Me.GridControl4.Name = "GridControl4"
|
||||
Me.GridControl4.Size = New System.Drawing.Size(691, 457)
|
||||
Me.GridControl4.Size = New System.Drawing.Size(790, 455)
|
||||
Me.GridControl4.TabIndex = 0
|
||||
Me.GridControl4.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView4})
|
||||
'
|
||||
@@ -246,7 +253,7 @@ Partial Class frmDocumentResult
|
||||
'
|
||||
Me.XtraTabPage5.Controls.Add(Me.GridControl5)
|
||||
Me.XtraTabPage5.Name = "XtraTabPage5"
|
||||
Me.XtraTabPage5.Size = New System.Drawing.Size(691, 457)
|
||||
Me.XtraTabPage5.Size = New System.Drawing.Size(790, 455)
|
||||
Me.XtraTabPage5.Text = "XtraTabPage5"
|
||||
'
|
||||
'GridControl5
|
||||
@@ -256,7 +263,7 @@ Partial Class frmDocumentResult
|
||||
Me.GridControl5.MainView = Me.GridView5
|
||||
Me.GridControl5.MenuManager = Me.BarManager1
|
||||
Me.GridControl5.Name = "GridControl5"
|
||||
Me.GridControl5.Size = New System.Drawing.Size(691, 457)
|
||||
Me.GridControl5.Size = New System.Drawing.Size(790, 455)
|
||||
Me.GridControl5.TabIndex = 0
|
||||
Me.GridControl5.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView5})
|
||||
'
|
||||
@@ -265,24 +272,18 @@ Partial Class frmDocumentResult
|
||||
Me.GridView5.GridControl = Me.GridControl5
|
||||
Me.GridView5.Name = "GridView5"
|
||||
'
|
||||
'LabelStatus
|
||||
'
|
||||
Me.LabelStatus.Caption = "Status"
|
||||
Me.LabelStatus.Id = 1
|
||||
Me.LabelStatus.Name = "LabelStatus"
|
||||
'
|
||||
'frmDocumentResult
|
||||
'frmResult
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(697, 528)
|
||||
Me.ClientSize = New System.Drawing.Size(796, 528)
|
||||
Me.Controls.Add(Me.XtraTabControl)
|
||||
Me.Controls.Add(Me.barDockControlLeft)
|
||||
Me.Controls.Add(Me.barDockControlRight)
|
||||
Me.Controls.Add(Me.barDockControlBottom)
|
||||
Me.Controls.Add(Me.barDockControlTop)
|
||||
Me.Name = "frmDocumentResult"
|
||||
Me.Text = "frmDocumentResult"
|
||||
Me.Name = "frmResult"
|
||||
Me.Text = "Ergebnis"
|
||||
CType(Me.XtraTabControl, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.XtraTabControl.ResumeLayout(False)
|
||||
Me.XtraTabPage1.ResumeLayout(False)
|
||||
@@ -10,7 +10,7 @@ Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.ZooFlow.Params
|
||||
Imports Patterns.ClassPatterns
|
||||
|
||||
Public Class frmDocumentResult
|
||||
Public Class frmResult
|
||||
Implements IResultForm
|
||||
|
||||
Private _LogConfig As LogConfig
|
||||
@@ -20,8 +20,9 @@ Public Class frmDocumentResult
|
||||
Private _DocumentSearches As DataTable
|
||||
Private _MatchingProfiles As List(Of ProfileData)
|
||||
Private _Database As MSSQLServer
|
||||
Private _ResultType As ResultType
|
||||
|
||||
Private Class DocSearch
|
||||
Private Class Search
|
||||
Public DataTable As DataTable
|
||||
Public TabIndex As Integer
|
||||
Public TabCaption As String
|
||||
@@ -29,9 +30,14 @@ Public Class frmDocumentResult
|
||||
Public SQLCommand As String
|
||||
End Class
|
||||
|
||||
Public Enum ResultType
|
||||
Data
|
||||
Document
|
||||
End Enum
|
||||
|
||||
Public Property ShouldReturnToMatchForm As Boolean = False Implements IResultForm.ShouldReturnToMatchForm
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As ClipboardWatcherParams)
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As ClipboardWatcherParams, ResultType As ResultType)
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
@@ -39,29 +45,43 @@ Public Class frmDocumentResult
|
||||
_MatchingProfiles = Params.MatchingProfiles
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger
|
||||
_Database = Environment.Database
|
||||
_Environment = Environment
|
||||
_Params = Params
|
||||
_ResultType = ResultType
|
||||
End Sub
|
||||
|
||||
Private Async Sub frmDocumentResult_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Private Async Sub frmResult_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
GridView1.ShowLoadingPanel()
|
||||
|
||||
Dim oSearches = Await LoadSearchesAsync()
|
||||
Dim oSearches As New List(Of Search)
|
||||
|
||||
For Each oSearch As DocSearch In oSearches
|
||||
If _ResultType = ResultType.Data Then
|
||||
oSearches = Await LoadDataSearchesAsync()
|
||||
Else
|
||||
oSearches = Await LoadDocumentSearchesAsync()
|
||||
End If
|
||||
|
||||
For Each oSearch As Search In oSearches
|
||||
RefreshTabDoc(oSearch.ProfileId, oSearch.DataTable, oSearch.TabIndex, oSearch.TabCaption)
|
||||
Next
|
||||
|
||||
GridView1.HideLoadingPanel()
|
||||
End Sub
|
||||
|
||||
Private Async Function LoadSearchesAsync() As Task(Of List(Of DocSearch))
|
||||
Return Await Task.Run(AddressOf DoLoadSearches)
|
||||
Private Async Function LoadDocumentSearchesAsync() As Task(Of List(Of Search))
|
||||
Return Await Task.Run(AddressOf DoLoadDocumentSearches)
|
||||
End Function
|
||||
|
||||
Private Function DoLoadSearches() As List(Of DocSearch)
|
||||
Private Async Function LoadDataSearchesAsync() As Task(Of List(Of Search))
|
||||
Return Await Task.Run(AddressOf DoLoadDataSearches)
|
||||
End Function
|
||||
|
||||
Private Function DoLoadDocumentSearches() As List(Of Search)
|
||||
Dim oMatchingIds = String.Join(",", _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 = _Database.GetDatatable(oSQL)
|
||||
Dim oDocSearches As New List(Of DocSearch)
|
||||
Dim oDocSearches As New List(Of Search)
|
||||
Dim oCounter As Integer = 0
|
||||
Dim oPatterns As New Patterns.ClassPatterns(_LogConfig)
|
||||
|
||||
@@ -77,7 +97,7 @@ Public Class frmDocumentResult
|
||||
oSQL = oPatterns.ReplaceInternalValues(oSQL)
|
||||
|
||||
Dim oDatatable As DataTable = _Database.GetDatatable(oSQL, oConnectionId)
|
||||
oDocSearches.Add(New DocSearch() With {
|
||||
oDocSearches.Add(New Search() With {
|
||||
.DataTable = oDatatable,
|
||||
.ProfileId = oProfileId,
|
||||
.TabCaption = oTabTitle,
|
||||
@@ -91,6 +111,40 @@ Public Class frmDocumentResult
|
||||
Return oDocSearches
|
||||
End Function
|
||||
|
||||
Private Function DoLoadDataSearches() As List(Of Search)
|
||||
Dim oMatchingIds = String.Join(",", _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 = _Database.GetDatatable(oSQL)
|
||||
Dim oDataSearches As New List(Of Search)
|
||||
Dim oCounter As Integer = 0
|
||||
Dim oPatterns As New Patterns.ClassPatterns(_LogConfig)
|
||||
|
||||
_DocumentSearches = oSearchesDataTable
|
||||
|
||||
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 = _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
|
||||
|
||||
Sub RefreshTabDoc(ProfileId As Integer, Datatable As DataTable, TabIndex As Integer, TabCaption As String)
|
||||
Try
|
||||
Dim oSelectedGridControl As GridControl = GridControl1
|
||||
@@ -130,9 +184,13 @@ Public Class frmDocumentResult
|
||||
XtraTabControl.TabPages(TabIndex).Text = $"{TabCaption} ({Datatable.Rows.Count})"
|
||||
'clsWMDocGrid.DTDocuments = Datatable
|
||||
|
||||
Create_GridControl(oSelectedGridView, Datatable)
|
||||
'Dim oxmlPath As String = Get_DocGrid_Layout_Filename(XtraTabControlDocs.SelectedTabPageIndex)
|
||||
If _ResultType = ResultType.Document Then
|
||||
CreateDocumentGrid(oSelectedGridView, Datatable)
|
||||
Else
|
||||
CreateDataGrid(oSelectedGridView, Datatable)
|
||||
End If
|
||||
|
||||
'Dim oxmlPath As String = Get_DocGrid_Layout_Filename(XtraTabControlDocs.SelectedTabPageIndex)
|
||||
'If File.Exists(oxmlPath) Then
|
||||
' oSelectedGridView.RestoreLayoutFromXml(oxmlPath)
|
||||
' oSelectedGridView.GuessAutoFilterRowValuesFromFilter()
|
||||
@@ -147,7 +205,10 @@ Public Class frmDocumentResult
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Create_GridControl(MyGridView As GridView, _datatable As DataTable)
|
||||
Private Sub CreateDataGrid(GridView As GridView, Datatable As DataTable)
|
||||
End Sub
|
||||
|
||||
Private Sub CreateDocumentGrid(MyGridView As GridView, _datatable As DataTable)
|
||||
Dim oMyDocDatatable As New DataTable
|
||||
Try
|
||||
'Die Icon Colum erstellen und konfigurieren
|
||||
Reference in New Issue
Block a user