Modules.Jobs: Replace Case-Insensitiv
This commit is contained in:
parent
447c7ea600
commit
d7d2ecf8a0
@ -7,6 +7,7 @@ Imports DigitalData.Modules.Logging
|
|||||||
Imports GdPicture14
|
Imports GdPicture14
|
||||||
Imports System.Drawing
|
Imports System.Drawing
|
||||||
Imports System.Linq
|
Imports System.Linq
|
||||||
|
Imports System.Text.RegularExpressions
|
||||||
Public Class XRechnungViewDocument
|
Public Class XRechnungViewDocument
|
||||||
Private ReadOnly _logger As Logger
|
Private ReadOnly _logger As Logger
|
||||||
Private ReadOnly _logConfig As LogConfig
|
Private ReadOnly _logConfig As LogConfig
|
||||||
@ -25,28 +26,35 @@ Public Class XRechnungViewDocument
|
|||||||
_file = New ZUGFeRD.FileFunctions(LogConfig, MSSQL)
|
_file = New ZUGFeRD.FileFunctions(LogConfig, MSSQL)
|
||||||
_gdpictureLicenseKey = GDPictureLicenseKey
|
_gdpictureLicenseKey = GDPictureLicenseKey
|
||||||
End Sub
|
End Sub
|
||||||
Public Function Create_PDFfromXML(oxmlFile As FileInfo, pDTItemValues As DataTable) As FileInfo
|
Public Function Create_PDFfromXML(pXmlFile As FileInfo, pDTItemValues As DataTable) As FileInfo
|
||||||
|
|
||||||
_logger.Debug("Create_PDFfromXML() Start")
|
_logger.Debug("Create_PDFfromXML() Start")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oXRechnungFile = oxmlFile.FullName
|
Dim oXRechnungFile = pXmlFile.FullName
|
||||||
Dim oNewFileinfo As FileInfo
|
Dim oNewFileinfo As FileInfo
|
||||||
Dim oxmlFilePath = oxmlFile.FullName
|
Dim oXmlFilePath = pXmlFile.FullName
|
||||||
Dim oViewRecieptFilename = oxmlFile.Name
|
Dim oViewRecieptFilename = pXmlFile.Name
|
||||||
Dim oTempFilePath = Path.GetDirectoryName(oxmlFilePath) + "\Temp"
|
Dim oTempFilePath = Path.Combine(Path.GetDirectoryName(oXmlFilePath), "temp")
|
||||||
If Not Directory.Exists(oTempFilePath) Then
|
If Not Directory.Exists(oTempFilePath) Then
|
||||||
Directory.CreateDirectory(oTempFilePath)
|
Directory.CreateDirectory(oTempFilePath)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
oTempFilePath = oTempFilePath + "\xrechnung.xml"
|
oTempFilePath = Path.Combine(oTempFilePath, "xrechnung.xml")
|
||||||
If File.Exists(oTempFilePath) Then
|
If File.Exists(oTempFilePath) Then
|
||||||
File.Delete(oTempFilePath)
|
File.Delete(oTempFilePath)
|
||||||
End If
|
End If
|
||||||
File.Move(oxmlFilePath, oTempFilePath)
|
|
||||||
oxmlFile = New FileInfo(oTempFilePath)
|
_logger.Debug("Vor MOVE... oxmlFilePath: [{0}] / oTempFilePath: [{1}]", oXmlFilePath, oTempFilePath)
|
||||||
oViewRecieptFilename = oViewRecieptFilename.Replace("xml", "pdf")
|
|
||||||
Dim oOutputPath = Path.GetDirectoryName(oxmlFilePath) + "\" + oViewRecieptFilename
|
File.Move(oXmlFilePath, oTempFilePath)
|
||||||
|
pXmlFile = New FileInfo(oTempFilePath)
|
||||||
|
|
||||||
|
'oViewRecieptFilename = oViewRecieptFilename.Replace(".xml", ".pdf")
|
||||||
|
oViewRecieptFilename = Regex.Replace(oViewRecieptFilename, ".xml", ".pdf", RegexOptions.IgnoreCase)
|
||||||
|
|
||||||
|
Dim oOutputPath = Path.Combine(Path.GetDirectoryName(oXmlFilePath), oViewRecieptFilename)
|
||||||
|
_logger.Debug("Create_PDFfromXML() Resulting PDF Filepath: [{0}]", oOutputPath)
|
||||||
If File.Exists(oOutputPath) Then
|
If File.Exists(oOutputPath) Then
|
||||||
File.Delete(oOutputPath)
|
File.Delete(oOutputPath)
|
||||||
End If
|
End If
|
||||||
@ -417,7 +425,7 @@ Public Class XRechnungViewDocument
|
|||||||
File.Delete(oXRechnungFile)
|
File.Delete(oXRechnungFile)
|
||||||
oNewFileinfo = New FileInfo(oOutputPath)
|
oNewFileinfo = New FileInfo(oOutputPath)
|
||||||
|
|
||||||
_logger.Debug("Create_PDFfromXML() End successfully")
|
_logger.Debug("Create_PDFfromXML() End successfully. File [{0}] written.", oNewFileinfo.FullName)
|
||||||
Return oNewFileinfo
|
Return oNewFileinfo
|
||||||
Else
|
Else
|
||||||
_logger.Debug("Create_PDFfromXML() Ends with nothing")
|
_logger.Debug("Create_PDFfromXML() Ends with nothing")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user