Add IsReadAndSign and enhance StatusTranslated logic
Refactored StatusTranslated to append "4RaC" to the resource key for "Read and Sign" envelopes (EnvelopeTypeId == 2). Introduced an IsReadAndSign extension method for Envelope. Added necessary namespace import for extension support.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using DigitalData.UserManager.Domain.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using EnvelopeGenerator.Domain;
|
||||
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -129,7 +131,21 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public bool IsAlreadySent => Status > (int)Constants.EnvelopeStatus.EnvelopeSaved;
|
||||
|
||||
[NotMapped]
|
||||
public string StatusTranslated => My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString());
|
||||
public string StatusTranslated
|
||||
{
|
||||
get
|
||||
{
|
||||
if(this.IsReadAndSign())
|
||||
{
|
||||
return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString() + "4RaC");
|
||||
}
|
||||
else
|
||||
{
|
||||
return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public bool TFA_Enabled { get; set; } = false;
|
||||
@@ -168,4 +184,12 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
return errors;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static bool IsReadAndSign(this Envelope envelope)
|
||||
{
|
||||
return envelope.EnvelopeTypeId == 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user