Compare commits
3 Commits
e20f42a88e
...
ac3bbc79f3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac3bbc79f3 | ||
|
|
859e971b26 | ||
|
|
d603fcfec6 |
@@ -6,13 +6,26 @@ Public Class EmailTemplate
|
|||||||
Private _DocumentCompletedBodyTemplate As List(Of String)
|
Private _DocumentCompletedBodyTemplate As List(Of String)
|
||||||
Private _DocumentDeletedBodyTemplate As List(Of String)
|
Private _DocumentDeletedBodyTemplate As List(Of String)
|
||||||
|
|
||||||
|
Private _DocumentReceivedSubjectTemplate As String
|
||||||
|
Private _DocumentSignedSubjectTemplate As String
|
||||||
|
Private _DocumentDeletedSubjectTemplate As String
|
||||||
|
Private _DocumentCompletedSubjectTemplate As String
|
||||||
|
|
||||||
Private _replaceDictionary As Dictionary(Of String, String)
|
Private _replaceDictionary As Dictionary(Of String, String)
|
||||||
|
|
||||||
Public Sub New()
|
Public Sub New()
|
||||||
InitTemplates()
|
InitBodyTemplates()
|
||||||
|
InitSubjectTemplates()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub InitTemplates()
|
Private Sub InitSubjectTemplates()
|
||||||
|
_DocumentReceivedSubjectTemplate = "Dokument zur Unterschrift erhalten: '<DOCUMENT_TITLE>'"
|
||||||
|
_DocumentSignedSubjectTemplate = "Dokument unterschrieben: '<DOCUMENT_TITLE>'"
|
||||||
|
_DocumentDeletedSubjectTemplate = "Dokument zurueckgezogen: '<DOCUMENT_TITLE>'"
|
||||||
|
_DocumentCompletedSubjectTemplate = "Dokument abgeschlossen: '<DOCUMENT_TITLE>'"
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub InitBodyTemplates()
|
||||||
_DocumentReceivedBodyTemplate = New List(Of String) From {
|
_DocumentReceivedBodyTemplate = New List(Of String) From {
|
||||||
"Guten Tag, <NAME_RECEIVER>,",
|
"Guten Tag, <NAME_RECEIVER>,",
|
||||||
"",
|
"",
|
||||||
@@ -82,6 +95,21 @@ Public Class EmailTemplate
|
|||||||
FillEmailBody(pEmailData, _DocumentCompletedBodyTemplate)
|
FillEmailBody(pEmailData, _DocumentCompletedBodyTemplate)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub FillEmailSubject(pEmailData As EmailData, pTemplate As String)
|
||||||
|
InitDictionary(pEmailData)
|
||||||
|
|
||||||
|
Dim resultSubject As String = pTemplate
|
||||||
|
|
||||||
|
For Each dictItem As KeyValuePair(Of String, String) In _replaceDictionary
|
||||||
|
If resultSubject.Contains(dictItem.Key) Then
|
||||||
|
resultSubject = resultSubject.Replace(dictItem.Key, dictItem.Value)
|
||||||
|
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Sub FillEmailBody(pEmailData As EmailData, pTemplate As List(Of String))
|
Public Sub FillEmailBody(pEmailData As EmailData, pTemplate As List(Of String))
|
||||||
|
|
||||||
InitDictionary(pEmailData)
|
InitDictionary(pEmailData)
|
||||||
|
|||||||
@@ -1,20 +1,35 @@
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Database
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
Imports Quartz
|
Imports Quartz
|
||||||
|
|
||||||
Public Class CertificateDocumentJob
|
Public Class CertificateDocumentJob
|
||||||
Implements IJob
|
Implements IJob
|
||||||
|
|
||||||
Public Function Execute(context As IJobExecutionContext) As Task Implements IJob.Execute
|
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||||
Dim connectionString As String = context.MergedJobDataMap.Item(Constants.DATABASE)
|
Dim oLogConfig As LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
||||||
Dim logConfig As LogConfig = context.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Constants.DATABASE)
|
||||||
Dim logger As Logger = logConfig.GetLogger
|
Dim oLogger As Logger = oLogConfig.GetLogger()
|
||||||
|
|
||||||
Dim JobId = context.JobDetail.Key
|
Try
|
||||||
logger.Info("Starting job {0}", JobId)
|
Dim oDatabase As New MSSQLServer(oLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||||
|
Dim JobId = pContext.JobDetail.Key
|
||||||
|
oLogger.Info("Starting job {0}", JobId)
|
||||||
|
|
||||||
' Do important work...
|
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {Constants.EnvelopeStatus.EnvelopeCompletelySigned}"
|
||||||
|
Dim oTable = oDatabase.GetDatatable(oSql)
|
||||||
|
|
||||||
logger.Info("Completed job {0}", JobId)
|
oLogger.Info("Found [{0}] completed envelopes.", oTable.Rows.Count)
|
||||||
Return Task.FromResult(True)
|
|
||||||
|
' Do important work...
|
||||||
|
|
||||||
|
oLogger.Info("Completed job {0}", JobId)
|
||||||
|
Return Task.FromResult(True)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
oLogger.Warn("Certificate Document job failed!")
|
||||||
|
oLogger.Error(ex)
|
||||||
|
|
||||||
|
Return Task.FromException(ex)
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -62,11 +62,9 @@ Partial Public Class frmFieldEditor
|
|||||||
For Each oReceiver In Receivers
|
For Each oReceiver In Receivers
|
||||||
LoadAnnotations(oReceiver.Id)
|
LoadAnnotations(oReceiver.Id)
|
||||||
Next
|
Next
|
||||||
'LoadAnnotations(SelectedReceiver.Id)
|
|
||||||
GDViewer.DisplayFirstPage()
|
GDViewer.DisplayFirstPage()
|
||||||
|
|
||||||
ThumbnailEx2.LoadFromGdViewer(GDViewer)
|
ThumbnailEx2.LoadFromGdViewer(GDViewer)
|
||||||
ThumbnailEx2.Refresh()
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -76,6 +74,9 @@ Partial Public Class frmFieldEditor
|
|||||||
|
|
||||||
If DocumentViewer1.PdfViewer IsNot Nothing Then
|
If DocumentViewer1.PdfViewer IsNot Nothing Then
|
||||||
GDViewer = DocumentViewer1.PdfViewer
|
GDViewer = DocumentViewer1.PdfViewer
|
||||||
|
AddHandler GDViewer.BeforeAnnotationAddedByUser, AddressOf Viewer_BeforeAnnotationAddedByUser
|
||||||
|
AddHandler GDViewer.AnnotationAddedByUser, AddressOf Viewer_AnnotationAddedByUser
|
||||||
|
|
||||||
Manager = GDViewer.GetAnnotationManager()
|
Manager = GDViewer.GetAnnotationManager()
|
||||||
Manager.InitFromGdViewer(GDViewer)
|
Manager.InitFromGdViewer(GDViewer)
|
||||||
Else
|
Else
|
||||||
@@ -95,8 +96,6 @@ Partial Public Class frmFieldEditor
|
|||||||
Return oItem
|
Return oItem
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
|
|
||||||
@@ -122,6 +121,8 @@ Partial Public Class frmFieldEditor
|
|||||||
DisplayPage(oCurrentPage)
|
DisplayPage(oCurrentPage)
|
||||||
GDViewer.SetVScrollBarPosition(oCurrentPosition)
|
GDViewer.SetVScrollBarPosition(oCurrentPosition)
|
||||||
GDViewer.Redraw()
|
GDViewer.Redraw()
|
||||||
|
ThumbnailEx2.ReloadThumbnails()
|
||||||
|
|
||||||
TestViewerActionSuccessful("ReceiverItem_Click/Redraw")
|
TestViewerActionSuccessful("ReceiverItem_Click/Redraw")
|
||||||
Else
|
Else
|
||||||
MsgBox(Resources.Envelope.Elements_could_not_be_saved, MsgBoxStyle.Critical, Text)
|
MsgBox(Resources.Envelope.Elements_could_not_be_saved, MsgBoxStyle.Critical, Text)
|
||||||
@@ -144,22 +145,16 @@ Partial Public Class frmFieldEditor
|
|||||||
GDViewer.LockViewer = False
|
GDViewer.LockViewer = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
Private Sub BarButtonItem1_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||||
If GDViewer IsNot Nothing Then
|
If GDViewer IsNot Nothing Then
|
||||||
|
|
||||||
AddHandler GDViewer.BeforeAnnotationAddedByUser, AddressOf Viewer_BeforeAnnotationAddedByUser
|
|
||||||
AddHandler GDViewer.AnnotationAddedByUser, AddressOf Viewer_AnnotationAddedByUser
|
|
||||||
|
|
||||||
GDViewer.AddStickyNoteAnnotationInteractive(SIGNATURE_LABEL, Color.Black, "Arial", FontStyle.Regular, 10, 1, 0)
|
GDViewer.AddStickyNoteAnnotationInteractive(SIGNATURE_LABEL, Color.Black, "Arial", FontStyle.Regular, 10, 1, 0)
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Viewer_BeforeAnnotationAddedByUser(pAnnotationIdx As Integer)
|
Private Sub Viewer_BeforeAnnotationAddedByUser(pAnnotationIdx As Integer)
|
||||||
Dim oAnnotation As Annotation = GDViewer.GetAnnotationFromIdx(pAnnotationIdx)
|
Dim oAnnotation As Annotation = GDViewer.GetAnnotationFromIdx(pAnnotationIdx)
|
||||||
ApplyAnnotationStyleForNewAnnotation(oAnnotation, SelectedReceiver.Color)
|
ApplyAnnotationStyleForNewAnnotation(oAnnotation, SelectedReceiver.Color)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnSave_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btnSave.ItemClick
|
Private Sub btnSave_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btnSave.ItemClick
|
||||||
|
|||||||
Reference in New Issue
Block a user