Support import without printing documents
This commit is contained in:
@@ -35,6 +35,19 @@ Namespace Templates
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PrintDocument As Boolean
|
||||
Get
|
||||
Dim oPrintDocument = GetParameter("PRINT")
|
||||
Dim oDefaultValue = True
|
||||
|
||||
If oPrintDocument IsNot Nothing Then
|
||||
oDefaultValue = IIf(oPrintDocument = "0", False, True)
|
||||
End If
|
||||
|
||||
Return oDefaultValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DocTypeCategory As DocumentTypeCategory
|
||||
Get
|
||||
Select Case DocType
|
||||
@@ -80,8 +93,8 @@ Namespace Templates
|
||||
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)
|
||||
Dim oParamValue1 = TryGetParameter(oParam1, pName)
|
||||
Dim oParamValue2 = TryGetParameter(oParam2, pName)
|
||||
|
||||
If oParamValue1 IsNot Nothing AndAlso oParamValue1.Item1 = pName Then
|
||||
Return oParamValue1.Item2
|
||||
@@ -94,15 +107,17 @@ Namespace Templates
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Private Function TryGetParameter(pParameterString As String) As Tuple(Of String, String)
|
||||
Private Function TryGetParameter(pParameterString As String, pName As String) As Tuple(Of String, String)
|
||||
If pParameterString <> String.Empty Then
|
||||
Dim oSplit = pParameterString.Split("=").ToList()
|
||||
For Each oParameter In pParameterString.Split(",")
|
||||
Dim oSplit = oParameter.Split("=").ToList()
|
||||
|
||||
If oSplit.Count = 2 Then
|
||||
Return New Tuple(Of String, String)(oSplit.First, oSplit.Last)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
If oSplit.Count = 2 AndAlso oSplit.First = pName Then
|
||||
Return New Tuple(Of String, String)(oSplit.First, oSplit.Last)
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Nothing
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user