Compare commits

..

2 Commits

Author SHA1 Message Date
OlgunR
f303ba042b Refactor contract type handling in EnvelopeType entity
Replaced Constants.ContractType enum with integer property in EnvelopeType. Updated related references in EnvelopeEditorController. Removed EnvelopeType variable from ModuleSettings. Made EnvelopeType property bindable and initialized in frmEnvelopeMainData to improve consistency and simplify contract type management.
2026-02-19 13:57:31 +01:00
OlgunR
ae33254743 Refactor envelope type handling and validation logic
- Change ContractType property to use Constants.ContractType enum for improved type safety.
- Move EnvelopeType selection to a shared module-level variable for consistent access.
- Allow user selection of contract type when creating envelopes.
- Refine envelope validation to check for required elements per receiver, with improved error messages.
2026-02-19 13:37:58 +01:00
2 changed files with 16 additions and 12 deletions

View File

@@ -50,17 +50,21 @@ Public Class EnvelopeEditorController
Public Function ValidateEnvelopeForSending(pErrors As List(Of String)) As List(Of String) Public Function ValidateEnvelopeForSending(pErrors As List(Of String)) As List(Of String)
Dim oEnvelopeErrors = pErrors Dim oEnvelopeErrors = pErrors
If ElementModel.ElementsExist(Envelope.Id) = False Then If Envelope.EnvelopeTypeId <> ContractType.ReadAndSign Then
oEnvelopeErrors.Add(Resources.Envelope.Missing_Elements)
End If
If ElementModel.OneElementPerReceiverExist(Envelope.Id) = False Then If ElementModel.ElementsExist(Envelope.Id) = False Then
oEnvelopeErrors.Add(Resources.Envelope.Missing_Elements)
End If
For Each receiverItem As Receiver In Envelope.Receivers If ElementModel.OneElementPerReceiverExist(Envelope.Id) = False Then
If ElementModel.ElementsExist(Envelope.Id, receiverItem.Id) = False Then
oEnvelopeErrors.Add(String.Format(Resources.Envelope.Missing_Elements_for_Receiver, receiverItem.Name)) For Each receiverItem As Receiver In Envelope.Receivers
End If If ElementModel.ElementsExist(Envelope.Id, receiverItem.Id) = False Then
Next oEnvelopeErrors.Add(String.Format(Resources.Envelope.Missing_Elements_for_Receiver, receiverItem.Name))
End If
Next
End If
End If End If

View File

@@ -59,7 +59,7 @@ Public Class frmEnvelopeMainData
cmbLanguage.Properties.Items.AddRange(New List(Of String) From {"de", "en"}) cmbLanguage.Properties.Items.AddRange(New List(Of String) From {"de", "en"})
groupAllOptions.Expanded = False groupAllOptions.Expanded = False
Dim EnvelopeType = oTypes.FirstOrDefault() EnvelopeType = oTypes.FirstOrDefault()
If NewEnvelopeMode = True Then If NewEnvelopeMode = True Then
@@ -139,8 +139,8 @@ Public Class frmEnvelopeMainData
Envelope.FinalEmailToCreator = cmbEmailToCreator.SelectedIndex Envelope.FinalEmailToCreator = cmbEmailToCreator.SelectedIndex
Envelope.FinalEmailToReceivers = cmbEmailToReceivers.SelectedIndex Envelope.FinalEmailToReceivers = cmbEmailToReceivers.SelectedIndex
Envelope.TFA_Enabled = chked_2Faktor.EditValue Envelope.TFA_Enabled = chked_2Faktor.EditValue
' ContractType kann zzt nicht über die Oberfläche gesetzt werden ' ContractType kann zzt nicht über die Oberfläche gesetzt werden - jetzt sollte es gehen.
Envelope.ContractType = ContractType.Contract Envelope.EnvelopeType = EnvelopeType
End Sub End Sub
Private Sub frmEnvelopeMainData_Shown(sender As Object, e As EventArgs) Handles Me.Shown Private Sub frmEnvelopeMainData_Shown(sender As Object, e As EventArgs) Handles Me.Shown