MS EnvelopeGenerator.Common v1.6 Reason for Aborting

XX.Form v1.7 Reason Aborting
This commit is contained in:
SchreiberM 2024-05-29 12:58:15 +02:00
parent 81220ac9b4
commit 48db26931c
12 changed files with 332 additions and 22 deletions

View File

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

View File

@ -34,13 +34,13 @@ Public Class ActionService
Return True
End Function
Public Function DeleteEnvelope(pEnvelope As Envelope) As Boolean
Public Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeDeleted, pEnvelope.User.Email) = False Then
Return False
End If
Dim oSendResult = pEnvelope.Receivers.
Select(Function(r) EmailService.SendEnvelopeDeletedEmail(pEnvelope, r)).
Select(Function(r) EmailService.SendEnvelopeDeletedEmail(pEnvelope, r, pReason)).
All(Function(r) r = True)
If oSendResult = False Then

View File

@ -15,14 +15,14 @@ Public Class EmailService
EmailTemplate = New TemplateService(pState)
End Sub
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pReason As String) As Boolean
Logger.Debug("Creating email data object.")
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageDeletionSent) With
{
.SignatureLink = ""
}
EmailTemplate.FillEnvelopeDeletedEmailBody(oEmailData)
EmailTemplate.FillEnvelopeDeletedEmailBody(oEmailData, pReason)
If EmailModel.Insert(oEmailData) = False Then
Logger.Error("EMail data could not be inserted.")

View File

@ -16,7 +16,7 @@ Public Class TemplateService
EmailHtmlTemplateModel = New EmailTemplateModel(pState)
End Sub
Private Sub InitDictionary(pEmailData As EmailData)
Private Sub InitDictionary(pEmailData As EmailData, Optional pReason As String = "")
Logger.Debug("Initializing dictionary..")
_replaceDictionary = New Dictionary(Of String, String) From {
@ -28,7 +28,8 @@ Public Class TemplateService
{"[LINK_TO_DOCUMENT_TEXT]", $"{pEmailData.SignatureLink.Truncate(40)}.."},
{"[DOCUMENT_TITLE]", pEmailData.EnvelopeTitle},
{"[MESSAGE]", pEmailData.Message},
{"[DOCUMENT_ACCESS_CODE]", pEmailData.ReceiverAccessCode}
{"[DOCUMENT_ACCESS_CODE]", pEmailData.ReceiverAccessCode},
{"[REASON]", pReason}
}
End Sub
@ -40,11 +41,11 @@ Public Class TemplateService
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
End Sub
Public Sub FillEnvelopeDeletedEmailBody(pEmailData As EmailData)
Public Sub FillEnvelopeDeletedEmailBody(pEmailData As EmailData, pReason As String)
InitDictionary(pEmailData)
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentDeleted)
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
pEmailData.EmailBody = FillTemplate(oTemplate.Body, pReason)
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
End Sub
@ -72,7 +73,7 @@ Public Class TemplateService
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
End Sub
Private Function FillTemplate(pTemplate As String) As String
Private Function FillTemplate(pTemplate As String, Optional pReason As String = "") As String
Dim oText As String = pTemplate
For Each dictItem As KeyValuePair(Of String, String) In _replaceDictionary

View File

@ -42,7 +42,7 @@ Public MustInherit Class BaseController
ChartModel = New ChartModel(pState)
End Sub
Public Function DeleteEnvelope(pEnvelope As Envelope) As Boolean
Public Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
If pEnvelope Is Nothing Then
Return True
End If
@ -52,7 +52,7 @@ Public MustInherit Class BaseController
Return False
End If
Return ActionService.DeleteEnvelope(pEnvelope)
Return ActionService.DeleteEnvelope(pEnvelope, pReason)
Else
Return DeleteEnvelopeFromDisk(pEnvelope)
End If

View File

@ -15,8 +15,8 @@ Public Class EnvelopeListController
Return EnvelopeModel.ListCompleted()
End Function
Public Overloads Function DeleteEnvelope(pEnvelope As Envelope) As Boolean
Return MyBase.DeleteEnvelope(pEnvelope)
Public Overloads Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
Return MyBase.DeleteEnvelope(pEnvelope, pReason)
End Function
Public Function GetPieChart() As ChartControl

View File

@ -150,6 +150,12 @@
<Compile Include="frmMain.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmRueckruf.Designer.vb">
<DependentUpon>frmRueckruf.vb</DependentUpon>
</Compile>
<Compile Include="frmRueckruf.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmSplashScreen.Designer.vb">
<DependentUpon>frmSplashScreen.vb</DependentUpon>
</Compile>
@ -194,6 +200,9 @@
<DependentUpon>frmMain.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmRueckruf.resx">
<DependentUpon>frmRueckruf.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmSplashScreen.resx">
<DependentUpon>frmSplashScreen.vb</DependentUpon>
</EmbeddedResource>

View File

@ -32,5 +32,5 @@ Imports System.Runtime.InteropServices
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' [assembly: AssemblyVersion("1.0.*")]
<Assembly: AssemblyVersion("2.6.0.0")>
<Assembly: AssemblyVersion("2.7.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -130,14 +130,14 @@ Public Class frmMain
End Try
End Sub
Private Sub DeleteEnvelope(pRowHandle As Integer)
Private Sub DeleteEnvelope(pRowHandle As Integer, pReason As String)
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(pRowHandle)
If MsgBox(Resources.Envelope.Do_you_really_want_to_delete_this_envelope, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.No Then
Exit Sub
End If
'If MsgBox(Resources.Envelope.Do_you_really_want_to_delete_this_envelope, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.No Then
' Exit Sub
'End If
If Controller.DeleteEnvelope(oEnvelope) Then
If Controller.DeleteEnvelope(oEnvelope, pReason) Then
LoadEnvelopeData()
Else
MsgBox(Resources.Envelope.The_envelope_could_not_be_deleted, MsgBoxStyle.Critical, Text)
@ -154,7 +154,16 @@ Public Class frmMain
Private Sub btnDeleteEnvelope_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeleteEnvelope.ItemClick
Dim oSelectedRows = ViewEnvelopes.GetSelectedRows()
If oSelectedRows.Count > 0 Then
DeleteEnvelope(oSelectedRows.First)
Dim ofrmAbort As New frmRueckruf
frmRueckruf.ShowDialog()
MsgBox("Abort: " + frmRueckruf.Abort & vbNewLine & "Reason: " + frmRueckruf.Reject_reason)
If frmRueckruf.Abort = False Then
MsgBox(frmRueckruf.Abort & vbNewLine & frmRueckruf.Reject_reason)
DeleteEnvelope(oSelectedRows.First, frmRueckruf.Reject_reason)
Else
End If
End If
End Sub

View File

@ -0,0 +1,129 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmRueckruf
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Label2 = New System.Windows.Forms.Label()
Me.txtReason = New System.Windows.Forms.TextBox()
Me.btnWeiter = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.btnCancel = New System.Windows.Forms.Button()
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
Me.tsstatus = New System.Windows.Forms.ToolStripStatusLabel()
Me.StatusStrip1.SuspendLayout()
Me.SuspendLayout()
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(22, 20)
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(432, 16)
Me.Label2.TabIndex = 0
Me.Label2.Text = "Bitte geben Sie einen Grund für den Abbruch/Rückruf des Umschlages ein:"
'
'txtReason
'
Me.txtReason.AcceptsReturn = True
Me.txtReason.Location = New System.Drawing.Point(25, 40)
Me.txtReason.Margin = New System.Windows.Forms.Padding(4)
Me.txtReason.Multiline = True
Me.txtReason.Name = "txtReason"
Me.txtReason.Size = New System.Drawing.Size(429, 87)
Me.txtReason.TabIndex = 1
'
'btnWeiter
'
Me.btnWeiter.Location = New System.Drawing.Point(25, 134)
Me.btnWeiter.Name = "btnWeiter"
Me.btnWeiter.Size = New System.Drawing.Size(203, 44)
Me.btnWeiter.TabIndex = 2
Me.btnWeiter.Text = "Weiter"
Me.btnWeiter.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(28, 87)
Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(0, 16)
Me.Label1.TabIndex = 3
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(251, 134)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(203, 44)
Me.btnCancel.TabIndex = 4
Me.btnCancel.Text = "Abbruch"
Me.btnCancel.UseVisualStyleBackColor = True
'
'StatusStrip1
'
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsstatus})
Me.StatusStrip1.Location = New System.Drawing.Point(0, 185)
Me.StatusStrip1.Name = "StatusStrip1"
Me.StatusStrip1.Size = New System.Drawing.Size(488, 22)
Me.StatusStrip1.TabIndex = 5
Me.StatusStrip1.Text = "StatusStrip1"
'
'tsstatus
'
Me.tsstatus.Name = "tsstatus"
Me.tsstatus.Size = New System.Drawing.Size(0, 17)
'
'frmRueckruf
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(488, 207)
Me.Controls.Add(Me.StatusStrip1)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.btnWeiter)
Me.Controls.Add(Me.txtReason)
Me.Controls.Add(Me.Label2)
Me.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Margin = New System.Windows.Forms.Padding(4)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmRueckruf"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Abbruch - Bestätigung"
Me.StatusStrip1.ResumeLayout(False)
Me.StatusStrip1.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label2 As Label
Friend WithEvents txtReason As TextBox
Friend WithEvents btnWeiter As Button
Friend WithEvents Label1 As Label
Friend WithEvents btnCancel As Button
Friend WithEvents StatusStrip1 As StatusStrip
Friend WithEvents tsstatus As ToolStripStatusLabel
End Class

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,39 @@
Imports EnvelopeGenerator.Common.My
Public Class frmRueckruf
Public Continue_Reject As Boolean = False
Public Reject_reason As String = ""
Public Abort As Boolean = False
Public Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnWeiter.Click
If txtReason.Text <> "" Then
If MsgBox(Resources.Envelope.Do_you_really_want_to_delete_this_envelope, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.No Then
Abort = True
Me.Close()
End If
tsstatus.Text = ""
Continue_Reject = True
Reject_reason = txtReason.Text
Else
tsstatus.Text = "Please add a reason for aborting - " & Now
End If
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Abort = True
Me.Close()
End Sub
Private Sub frmRueckruf_Load(sender As Object, e As EventArgs) Handles Me.Load
txtReason.Text = ""
tsstatus.Text = ""
End Sub
End Class