- Programmiersprache von VSC zu C# geändert - Framework von .NET Framework zu .NET geändert
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|