Files
EnvelopeGenerator/EnvelopeGenerator.Form/ModuleSettings.vb
OlgunR d29abf53e7 Set envelope default message by type using resources
Added "Please read and confirm this document" to resource files and updated resource class. Replaced Envelope constructor with WithDefaultMessage extension method to set default message based on EnvelopeTypeId. Updated controller and editor form to use this method. Cleaned up imports and comments.
2026-03-06 14:23:18 +01:00

52 lines
2.0 KiB
VB.net

Imports System.Runtime.CompilerServices
Imports System.Resources
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.CommonServices
Imports EnvelopeGenerator.CommonServices.My
Imports EnvelopeGenerator.Domain.Entities
Imports EnvelopeGenerator.Domain
Module ModuleSettings
Public ENVELOPE_TEMP_DOCUMENT As String = ""
Public CurrLogConfig As LogConfig
Public Directory2Delete As String = ""
Public MS_GDPICTUREKEY As String = ""
Public DB_DD_ECM As MSSQLServer = Nothing
Public DEF_TF_ENABLED As Boolean = False
Public DEF_TF_ENABLED_WITH_PHONE As Boolean = False
Public MYUSER As FormUser
Public MyTempFiles As TempFiles
Public SQL_REP_ENV_USER_LM As String = ""
Public SQL_REP_ENV_USER_TM As String = ""
Public SQL_REP_ENV_USER_Y As String = ""
Public SQL_REP_ENV_USER_ALL As String = ""
Public SQL_REP_ENV_ALL_USER_MONTH As String = ""
Public SQL_REP_ENV_ALL_USER_LAST_MONTH As String = ""
Public DT_CHARTS As DataTable
Public MyLogger As Logger
Public USER_GHOST_MODE_USRNAME As String = ""
Public USER_GHOST_MODE_ACTIVE As Boolean = False
Public MyUserModel As UserModel
Public MyState As State
Public CurrentEnvelopID As Integer = 0
Public CurrentEnvelopetitle As String = ""
<Extension()>
Public Function WithDefaultMessage(ByVal envelope As Envelope) As Envelope
If envelope Is Nothing Then
Throw New ArgumentNullException(NameOf(envelope))
End If
Dim resourceManager As New ResourceManager("EnvelopeGenerator.Domain.Resources.Envelope", GetType(EnvelopeGenerator.Domain.Entities.Envelope).Assembly)
If envelope.EnvelopeTypeId = 1 Then
envelope.Message = resourceManager.GetString("Please read and sign this document")
ElseIf envelope.EnvelopeTypeId = 2 Then
envelope.Message = resourceManager.GetString("Please read and confirm this document")
End If
Return envelope
End Function
End Module