directories per template, export tweaks
This commit is contained in:
@@ -10,7 +10,7 @@ Namespace Documents
|
||||
Public Mandator As Mandator
|
||||
|
||||
Public TemplateName As String
|
||||
Public TemplateType As Integer
|
||||
Public Property TemplateType As Integer
|
||||
Public [Option] As Integer
|
||||
Public PrintVoucher As Integer
|
||||
|
||||
|
||||
@@ -6,18 +6,18 @@ Namespace Documents
|
||||
Public Class DocumentCleaner
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly GeneralConfig As GeneralConfig
|
||||
Private ReadOnly Template As Template
|
||||
Private ReadOnly FileEx As DigitalData.Modules.Filesystem.File
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pGeneralConfig As GeneralConfig)
|
||||
Public Sub New(pLogConfig As LogConfig, pTemplate As Template)
|
||||
MyBase.New(pLogConfig)
|
||||
GeneralConfig = pGeneralConfig
|
||||
Template = pTemplate
|
||||
FileEx = New DigitalData.Modules.Filesystem.File(LogConfig)
|
||||
End Sub
|
||||
|
||||
Public Function CleanImportedDocuments(pDocuments As List(Of Document)) As Boolean
|
||||
Dim oResult = True
|
||||
Dim oOutputDirectory = FileEx.GetDateDirectory(GeneralConfig.OutputXmlFileDirectory)
|
||||
Dim oOutputDirectory = FileEx.GetDateDirectory(Template.OutputXmlFileDirectory)
|
||||
Dim oImportedDocuments = pDocuments.
|
||||
Where(Function(doc) doc.Imported = True).
|
||||
ToList()
|
||||
|
||||
@@ -29,17 +29,12 @@ Namespace Documents
|
||||
TemplateConfig = pTemplateConfig
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function LoadFiles(pInputDirectory As String, pTemplate As Template, pMandator As Mandator) As Boolean
|
||||
If pInputDirectory = String.Empty Then
|
||||
Throw New ArgumentNullException("InputDirectory")
|
||||
End If
|
||||
|
||||
Logger.Info("Loading files from directory [{0}]", pInputDirectory)
|
||||
Public Function LoadFiles(pTemplate As Template, pMandator As Mandator) As Boolean
|
||||
Logger.Info("Loading files from directory [{0}]", pTemplate.InputDirectory)
|
||||
Files.Clear()
|
||||
|
||||
Try
|
||||
Dim oDirectory As New DirectoryInfo(pInputDirectory)
|
||||
Dim oDirectory As New DirectoryInfo(pTemplate.InputDirectory)
|
||||
Dim oFiles = oDirectory.GetFiles()
|
||||
|
||||
Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory)
|
||||
|
||||
Reference in New Issue
Block a user