WIP: Filters
This commit is contained in:
5
MultiTool.Common/Templates/FilterConfig.vb
Normal file
5
MultiTool.Common/Templates/FilterConfig.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Namespace Templates
|
||||
Public Class FilterConfig
|
||||
Public Property Items As New List(Of FilterConfigItem)
|
||||
End Class
|
||||
End Namespace
|
||||
8
MultiTool.Common/Templates/FilterConfigItem.vb
Normal file
8
MultiTool.Common/Templates/FilterConfigItem.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
Namespace Templates
|
||||
Public Class FilterConfigItem
|
||||
Public Property Guid As Integer
|
||||
Public Property SQLCommand As String
|
||||
Public Property TableId As Integer
|
||||
Public Property ColumnName As String
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -10,11 +10,14 @@ Namespace Templates
|
||||
Private ReadOnly ns As XNamespace = "http://www.w3.org/2001/XMLSchema"
|
||||
|
||||
Public Property TemplateList As List(Of Template)
|
||||
|
||||
Public Property TemplateConfiguration As New TemplateConfig
|
||||
Public Property MappingConfiguration As New MappingConfig
|
||||
Public Property MandatorConfiguration As New MandatorConfig
|
||||
Public Property GeneralConfiguration As New GeneralConfig
|
||||
Public Property FilterConfiguration As New FilterConfig
|
||||
|
||||
Private Const SQL_TBMT_FILTERS = "SELECT * FROM [DD_ECM].[dbo].[TBMT_FILTERS]"
|
||||
Private Const SQL_VWMT_ITEMS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_ITEMS]"
|
||||
Private Const SQL_VWMT_MAPPING = "SELECT * FROM [DD_ECM].[dbo].[VWMT_MAPPING]"
|
||||
Private Const SQL_TBMT_MANDATORS = "SELECT * FROM [DD_ECM].[dbo].[TBMT_MANDATORS] ORDER BY ORDER_KEY"
|
||||
@@ -25,6 +28,32 @@ Namespace Templates
|
||||
MyBase.New(pLogConfig, pMSSQL)
|
||||
End Sub
|
||||
|
||||
Public Async Function LoadFilterConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_TBMT_FILTERS)
|
||||
Dim oFilters As New List(Of FilterConfigItem)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oFilter As New FilterConfigItem With {
|
||||
.Guid = oRow.Item("GUID"),
|
||||
.SQLCommand = oRow.ItemEx("SQL_COMMAND", String.Empty),
|
||||
.TableId = oRow.ItemEx("TABLE_ID", 0),
|
||||
.ColumnName = oRow.ItemEx("COLUMN_NAME", String.Empty)
|
||||
}
|
||||
|
||||
oFilters.Add(oFilter)
|
||||
Next
|
||||
|
||||
FilterConfiguration.Items = oFilters
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadTemplates() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_TBMT_TEMPLATES)
|
||||
|
||||
Reference in New Issue
Block a user