15.01.2024

This commit is contained in:
Jonathan Jenne
2024-01-15 16:31:35 +01:00
parent a4ed41419d
commit 0a01bf59ef
14 changed files with 397 additions and 426 deletions

View File

@@ -0,0 +1,31 @@
Imports DigitalData.Modules.Base
Imports EnvelopeGenerator.Common.Constants
Public Class EmailTemplateModel
Inherits BaseModel
Public Sub New(pState As State)
MyBase.New(pState)
End Sub
Private Function ToEmailTemplate(pRow As DataRow) As EmailTemplate
Return New EmailTemplate() With {
.Id = pRow.ItemEx("GUID", 0),
.Name = pRow.ItemEx("NAME", ""),
.Body = pRow.ItemEx("BODY", ""),
.Subject = pRow.ItemEx("SUBJECT", "")
}
End Function
Public Function GetById(pEmailTemplateName As EmailTemplateType) As EmailTemplate
Dim oSql As String = $"SELECT * FROM TBSIG_EMAIL_TEMPLATE WHERE NAME = '{pEmailTemplateName}'"
Dim oTable As DataTable = Database.GetDatatable(oSql)
If oTable.Rows.Count = 0 Then
Return Nothing
End If
Dim oRow = oTable.Rows.Item(0)
Return ToEmailTemplate(oRow)
End Function
End Class