Fix DocumentTypes for Exports, Prepare Price calculation, load template parameters

This commit is contained in:
Jonathan Jenne
2022-02-28 11:58:01 +01:00
parent 2e7b0bef8a
commit 213bcef732
6 changed files with 188 additions and 81 deletions

View File

@@ -1,4 +1,7 @@
Namespace Templates
Imports DigitalData.Modules.Language
Namespace Templates
Public Class Template
Public Property Guid As Integer
Public Property Name As String
@@ -33,6 +36,38 @@
End Get
End Property
Public Function GetParameter(pName As String) As String
Dim oParam1 As String = Utils.NotNull(Parameter1, String.Empty)
Dim oParam2 As String = Utils.NotNull(Parameter2, String.Empty)
Dim oParamValue1 = TryGetParameter(oParam1)
Dim oParamValue2 = TryGetParameter(oParam2)
If oParamValue1 IsNot Nothing AndAlso oParamValue1.Item1 = pName Then
Return oParamValue1.Item2
End If
If oParamValue2 IsNot Nothing AndAlso oParamValue2.Item1 = pName Then
Return oParamValue2.Item2
End If
Return Nothing
End Function
Private Function TryGetParameter(pParameterString As String) As Tuple(Of String, String)
If pParameterString <> String.Empty Then
Dim oSplit = pParameterString.Split("=").ToList()
If oSplit.Count = 2 Then
Return New Tuple(Of String, String)(oSplit.First, oSplit.Last)
Else
Return Nothing
End If
Else
Return Nothing
End If
End Function
Class Table
Public Property Name As String
Public Property Columns As New List(Of Column)