feat(FinalizeDocument): aus CommonJobs kopiert, mit einfachen Fehlerbehebungen unter Verwendung von Copilot

- Programmiersprache von VSC zu C# geändert
 - Framework von .NET Framework zu .NET geändert
This commit is contained in:
2026-02-23 17:12:25 +01:00
parent 41cca7fa64
commit c93c32307a
21 changed files with 1538 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using DigitalData.Modules.Base;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.ServiceHost.Jobs;
public class EnvelopeModel : BaseModel
{
public EnvelopeModel(State state) : base(state)
{
}
public Envelope? GetById(int envelopeId)
{
try
{
var sql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE GUID = {envelopeId}";
var table = Database.GetDatatable(sql);
var row = table.Rows.Cast<System.Data.DataRow>().SingleOrDefault();
if (row is null)
{
return null;
}
return new Envelope
{
Id = row.ItemEx("GUID", 0),
Uuid = row.ItemEx("ENVELOPE_UUID", string.Empty),
FinalEmailToCreator = row.ItemEx("FINAL_EMAIL_TO_CREATOR", 0),
FinalEmailToReceivers = row.ItemEx("FINAL_EMAIL_TO_RECEIVERS", 0),
UserId = row.ItemEx("USER_ID", 0),
User = null!,
EnvelopeReceivers = new List<EnvelopeReceiver>()
};
}
catch (Exception ex)
{
Logger.Error(ex);
return null;
}
}
}