MS Sync Hakan

This commit is contained in:
2024-06-25 13:26:35 +02:00
parent 2f8aed8640
commit 54b246f8e4
10 changed files with 104 additions and 134 deletions

View File

@@ -32,8 +32,6 @@
Public Property History As New List(Of EnvelopeHistoryEntry)
Public Property EnvelopeType As EnvelopeType
Public Property DOC_RESULT As Byte()
Public Property Doc1 As Byte()
Public ReadOnly Property EnvelopeTypeTitle As String
Get
Return EnvelopeType?.Title

View File

@@ -220,6 +220,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Model.resx</DependentUpon>
</Compile>
<Compile Include="TempFiles.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\licenses.licx" />

View File

@@ -43,6 +43,7 @@ Namespace Jobs
Private ReadOnly CompleteWaitTime As Integer = 5
Private ParentFolderUID As String = ""
Private myTempFiles As TempFiles
Private Class EnvelopeData
Public EnvelopeId As Integer
@@ -56,7 +57,8 @@ Namespace Jobs
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Constants.GDPICTURE)
LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
Logger = LogConfig.GetLogger()
myTempFiles = New TempFiles(LogConfig)
myTempFiles.Create()
Dim JobId = pContext.JobDetail.Key
Logger.Info("Starting job {0}", JobId)
@@ -410,14 +412,18 @@ Namespace Jobs
Else
Logger.Info($"we got bytes..")
oInputPath = Config.DocumentPathOrigin
Dim oTempFolder = TempFiles.TempPath
Logger.Info($"oInputPath: {Config.DocumentPathOrigin}")
End If
If IsNothing(pEnvelopeData.DocAsByte) Then
Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath)
Dim split As String() = oDirectorySource.Split("\")
ParentFolderUID = split(split.Length - 1)
Else
ParentFolderUID = pEnvelopeData.EnvelopeId
End If
Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath)
Dim split As String() = oDirectorySource.Split("\")
ParentFolderUID = split(split.Length - 1)
Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID)
Dim oInputDocumentBuffer As Byte()

View File

@@ -41,8 +41,6 @@ Namespace Jobs.FinalizeDocument
Throw New BurnAnnotationException($"Adding Annotation failed")
End If
Next
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
If oResult <> GdPictureStatus.OK Then
Throw New BurnAnnotationException($"Could not burn annotations to file: [{oResult}]")
@@ -71,6 +69,7 @@ Namespace Jobs.FinalizeDocument
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
For Each oAnnotation In oAnnotationData.annotations
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
Select Case oAnnotation.type
Case ANNOTATION_TYPE_IMAGE
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)

View File

@@ -26,7 +26,7 @@ Public Class EmailModel
'oCommand.Parameters.Add("EMAIL_ATTMT1", SqlDbType.NVarChar).Value = pEmail.EmailAttachment
oCommand.Parameters.Add("WF_ID", SqlDbType.Int).Value = pEmail.EmailType ' Wegen DB-Trigger MUSS dieser Wert gesetzt werden
oCommand.Parameters.Add("ATT1_RELATED_ID", SqlDbType.Int).Value = pEmail.ATT1_RELATED_ID
oCommand.Parameters.Add("ATT1_REL_TYP", SqlDbType.NVarChar).Value = pEmail.ATT1_REL_TYPE
oCommand.Parameters.Add("ATT1_REL_TYPE", SqlDbType.NVarChar).Value = pEmail.ATT1_REL_TYPE
If Database.ExecuteNonQuery(oCommand) Then
Return True

View File

@@ -193,6 +193,9 @@ Public Class EnvelopeModel
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
oCommand.Parameters.Add("ENVELOPE_TYPE", SqlDbType.Int).Value = pEnvelope.EnvelopeTypeId
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.Int).Value = pEnvelope.ContractType
If IsNothing(pEnvelope.Language) Then
pEnvelope.Language = "de-DE"
End If
oCommand.Parameters.Add("LANGUAGE", SqlDbType.NVarChar).Value = pEnvelope.Language
oCommand.Parameters.Add("CERTIFICATION_TYPE", SqlDbType.Int).Value = pEnvelope.CertificationType
oCommand.Parameters.Add("EXPIRES_WHEN_DAYS", SqlDbType.Int).Value = pEnvelope.ExpiresWhenDays

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.7.0.0")>
<Assembly: AssemblyFileVersion("1.7.0.0")>
<Assembly: AssemblyVersion("1.8.0.0")>
<Assembly: AssemblyFileVersion("1.8.0.0")>

View File

@@ -0,0 +1,60 @@
Imports System.IO
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Public Class TempFiles
Inherits BaseClass
Public Property TempPath As String
Public Sub New(pLogConfig As LogConfig)
MyBase.New(pLogConfig)
Dim oTempDirectoryPath = Path.GetTempPath()
TempPath = Path.Combine(oTempDirectoryPath, "EnvelopeGenerator")
End Sub
Public Function Create() As Boolean
Try
If Directory.Exists(TempPath) = False Then
Directory.CreateDirectory(TempPath)
Else
CleanUpFiles()
End If
Return True
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Private Function CleanUpFiles() As Boolean
Try
For Each fileItem As String In Directory.GetFiles(TempPath)
Logger.Debug("Deleting tempPath-file: {0} ...", fileItem)
File.Delete(fileItem)
Next
Return True
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function CleanUp() As Boolean
Try
Logger.Debug("Deleting tempPath-Data: {0} ...", TempPath)
Directory.Delete(TempPath, True)
Return True
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
End Class