Rename TemplateConfigItem to FieldConfig
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Imports DigitalData.Modules.Language
|
||||
|
||||
Namespace Templates
|
||||
Public Class TemplateConfigItem
|
||||
Public Class FieldConfig
|
||||
Public Property Name As String
|
||||
Public Property Table As String
|
||||
Public Property Type As ColumnType
|
||||
@@ -123,7 +123,7 @@ Namespace Templates
|
||||
''' Required value from Schema. This value will be written in the ColumnConfig and is not relevant from that point on.
|
||||
''' </summary>
|
||||
Public Property IsRequired As Boolean
|
||||
Public Property Config As TemplateConfigItem
|
||||
Public Property Config As FieldConfig
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Name
|
||||
|
||||
@@ -6,9 +6,9 @@ Namespace Templates
|
||||
''' Class for loading column/field config from database
|
||||
''' </summary>
|
||||
Public Class TemplateConfig
|
||||
Public Property Items As List(Of TemplateConfigItem)
|
||||
Public Property Items As List(Of FieldConfig)
|
||||
|
||||
Public ReadOnly Property SqlItems As List(Of TemplateConfigItem)
|
||||
Public ReadOnly Property SqlItems As List(Of FieldConfig)
|
||||
Get
|
||||
Return Items.
|
||||
Where(Function(item) item.Function.Name = Constants.FUNCTION_SQL).
|
||||
@@ -16,7 +16,7 @@ Namespace Templates
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function GetColumn(pName As String, pTable As String) As TemplateConfigItem
|
||||
Public Function GetColumn(pName As String, pTable As String) As FieldConfig
|
||||
Return Items.
|
||||
Where(Function(c) c.Name = pName And c.Table = pTable).
|
||||
FirstOrDefault()
|
||||
|
||||
@@ -154,14 +154,14 @@ Namespace Templates
|
||||
Public Async Function LoadTemplateConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_VWMT_ITEMS)
|
||||
Dim oItems As New List(Of TemplateConfigItem)
|
||||
Dim oItems As New List(Of FieldConfig)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oColumn As New TemplateConfigItem() With {
|
||||
Dim oColumn As New FieldConfig() With {
|
||||
.Template = oRow.ItemEx("TEMPLATE_NAME", String.Empty),
|
||||
.Table = oRow.ItemEx("XML_TABLE", String.Empty),
|
||||
.Name = oRow.ItemEx("XML_ITEM", String.Empty),
|
||||
.Type = TemplateConfigItem.ConvertType(ItemEx(oRow, "DATA_TYPE", String.Empty)),
|
||||
.Type = FieldConfig.ConvertType(ItemEx(oRow, "DATA_TYPE", String.Empty)),
|
||||
.OrderKey = oRow.ItemEx("ORDER_KEY", 0),
|
||||
.IsReadOnly = oRow.ItemEx("IS_READ_ONLY", False),
|
||||
.IsVisible = oRow.ItemEx("IS_VISIBLE", True),
|
||||
@@ -169,7 +169,7 @@ Namespace Templates
|
||||
.IsVirtual = oRow.ItemEx("IS_VIRTUAL", False),
|
||||
.IsHead = oRow.ItemEx("IS_HEAD", True),
|
||||
.PreferExternalValue = oRow.ItemEx("PREFER_EXTERNAL", True),
|
||||
.[Function] = New TemplateConfigItem.ColumnFunction With {
|
||||
.[Function] = New FieldConfig.ColumnFunction With {
|
||||
.Id = oRow.ItemEx("FUNCTION_ID", 0),
|
||||
.Name = oRow.ItemEx("FUNCTION_NAME", String.Empty),
|
||||
.Params = oRow.ItemEx("FUNCTION_PARAMETERS", String.Empty)
|
||||
@@ -243,10 +243,10 @@ Namespace Templates
|
||||
|
||||
For Each oTable In oTemplate.Tables
|
||||
For Each oColumn As Template.Column In oTable.Columns
|
||||
Dim oConfig As TemplateConfigItem = pTemplateConfig.GetColumn(oColumn.Name, oTable.Name)
|
||||
Dim oConfig As FieldConfig = pTemplateConfig.GetColumn(oColumn.Name, oTable.Name)
|
||||
|
||||
If oConfig Is Nothing Then
|
||||
oConfig = New TemplateConfigItem With {
|
||||
oConfig = New FieldConfig With {
|
||||
.IsRequired = oColumn.IsRequired,
|
||||
.Name = oColumn.Name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user