directories per template, export tweaks
This commit is contained in:
@@ -1,26 +1,8 @@
|
||||
Namespace Templates
|
||||
Public Class GeneralConfig
|
||||
Public Property InputDirectory As String = ""
|
||||
Public Property OutputDirectory As String = ""
|
||||
Public Property TemplateDirectory As String = ""
|
||||
|
||||
Public ReadOnly Property OutputReportDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "Reports")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputWebserviceDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "WebService")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputXmlFileDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "XmlFiles")
|
||||
End Get
|
||||
End Property
|
||||
Public Property Templates As New List(Of TemplateConfig)
|
||||
|
||||
Public Property Webservice As New WebServiceConfig()
|
||||
Public Property DefaultYearOverride As Integer = 0
|
||||
|
||||
@@ -1,12 +1,38 @@
|
||||
Namespace Templates
|
||||
Public Class Template
|
||||
Public Property Guid As Integer
|
||||
Public Property Name As String
|
||||
Public Property FileName As String
|
||||
Public Property Description As String
|
||||
Public Property IsImport As Boolean
|
||||
Public Property Parameter1 As String
|
||||
Public Property Parameter2 As String
|
||||
Public Property FinalSQL As String
|
||||
|
||||
Public Property Tables As New List(Of Table)
|
||||
|
||||
Public Property InputDirectory As String
|
||||
Public Property OutputDirectory As String
|
||||
Public Property ArchiveDirectory As String
|
||||
|
||||
Public ReadOnly Property OutputReportDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "Reports")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputWebserviceDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "WebService")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputXmlFileDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "XmlFiles")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Class Table
|
||||
Public Property Name As String
|
||||
Public Property Columns As New List(Of Column)
|
||||
|
||||
@@ -34,10 +34,14 @@ Namespace Templates
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oTemplate As New Template With {
|
||||
.Guid = oRow.Item("GUID"),
|
||||
.Name = oRow.ItemEx("NAME", String.Empty),
|
||||
.Description = oRow.ItemEx("DESCRIPTION", String.Empty),
|
||||
.FileName = oRow.ItemEx("FILE_NAME", String.Empty),
|
||||
.IsImport = oRow.ItemEx("IS_IMPORT", True)
|
||||
.IsImport = oRow.ItemEx("IS_IMPORT", True),
|
||||
.FinalSQL = oRow.ItemEx("FINAL_SQL", String.Empty),
|
||||
.Parameter1 = oRow.ItemEx("PARAMETER_1", String.Empty),
|
||||
.Parameter2 = oRow.ItemEx("PARAMETER_2", String.Empty)
|
||||
}
|
||||
|
||||
oTemplates.Add(oTemplate)
|
||||
@@ -80,12 +84,6 @@ Namespace Templates
|
||||
Case "WEBSERVICE_IMPORT_RELATIVE_PATH"
|
||||
oGeneralConfig.Webservice.ImportRelativePath = oValue
|
||||
|
||||
Case "INPUT_DIRECTORY"
|
||||
oGeneralConfig.InputDirectory = oValue
|
||||
|
||||
Case "OUTPUT_DIRECTORY"
|
||||
oGeneralConfig.OutputDirectory = oValue
|
||||
|
||||
Case "TEMPLATE_DIRECTORY"
|
||||
oGeneralConfig.TemplateDirectory = oValue
|
||||
|
||||
@@ -237,7 +235,7 @@ Namespace Templates
|
||||
Return pTemplate
|
||||
End Function
|
||||
|
||||
Public Function UpdateTemplateFromDatabase(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template
|
||||
Public Function UpdateTemplateTablesFromDatabase(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template
|
||||
If pTemplateConfig Is Nothing Then
|
||||
Return pTemplate
|
||||
End If
|
||||
@@ -260,6 +258,35 @@ Namespace Templates
|
||||
Return pTemplate
|
||||
End Function
|
||||
|
||||
Public Function UpdateTemplateFromDatabase(pTemplate As Template) As Template
|
||||
Try
|
||||
Dim oTable As DataTable = Database.GetDatatable($"{SQL_TBEDI_XML_CONFIG} WHERE TEMPLATE_ID = {pTemplate.Guid}")
|
||||
Dim oGeneralConfig As New GeneralConfig
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oValue As String = oRow.ItemEx("VALUE", String.Empty)
|
||||
|
||||
Select Case oRow.Item("KEY")
|
||||
Case "INPUT_DIRECTORY"
|
||||
pTemplate.InputDirectory = oValue
|
||||
|
||||
Case "OUTPUT_DIRECTORY"
|
||||
pTemplate.OutputDirectory = oValue
|
||||
|
||||
Case "ARCHIVE_DIRECTORY"
|
||||
pTemplate.ArchiveDirectory = oValue
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
Return pTemplate
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return pTemplate
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetElementType(pElement As XElement) As Constants.ColumnType
|
||||
Dim oTypeString = XmlData.GetElementAttribute(pElement, "type")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user