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:
42
EnvelopeGenerator.ServiceHost/Jobs/EnvelopeModel.cs
Normal file
42
EnvelopeGenerator.ServiceHost/Jobs/EnvelopeModel.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user