Compare commits

...

2 Commits

Author SHA1 Message Date
OlgunR
9b70ca8ce6 Refactor envelope status translation logic
Simplified the logic for translating envelope status by using pattern matching to directly return the "Read and Sign" translation if available, otherwise falling back to the default. Also renamed the resource manager variable (note: introduced a typo as "rescourceManager").
2026-02-25 11:30:22 +01:00
OlgunR
66c1fb3698 Replace ContractType.ReadAndSign with literal value 2
Updated envelope validation to compare EnvelopeTypeId directly to the integer 2 instead of using the ContractType.ReadAndSign constant. This simplifies the condition and removes dependency on the constant.
2026-02-24 11:30:26 +01:00
2 changed files with 5 additions and 11 deletions

View File

@@ -135,19 +135,13 @@ namespace EnvelopeGenerator.Domain.Entities
{
get
{
var resourceManager = My.Resources.Model.ResourceManager;
var statusName = ((Constants.EnvelopeStatus)Status).ToString();
var rescourceManager = My.Resources.Model.ResourceManager;
if (this.IsReadAndSign())
{
var statusNameRaC = statusName + "4RaC";
var translationRaC = resourceManager.GetString(statusNameRaC);
if (!string.IsNullOrEmpty(translationRaC))
if (this.IsReadAndSign() && rescourceManager.GetString(statusName + "4RaC") is string translationRaC)
return translationRaC;
}
return resourceManager.GetString(statusName);
return rescourceManager.GetString(statusName);
}
}

View File

@@ -50,7 +50,7 @@ Public Class EnvelopeEditorController
Public Function ValidateEnvelopeForSending(pErrors As List(Of String)) As List(Of String)
Dim oEnvelopeErrors = pErrors
If Envelope.EnvelopeTypeId <> ContractType.ReadAndSign Then
If Envelope.EnvelopeTypeId <> 2 Then
If ElementModel.ElementsExist(Envelope.Id) = False Then
oEnvelopeErrors.Add(Resources.Envelope.Missing_Elements)