From 9b70ca8ce61ab6977ae92339e6d1b244877d6dc7 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Wed, 25 Feb 2026 11:30:22 +0100 Subject: [PATCH] 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"). --- EnvelopeGenerator.Domain/Entities/Envelope.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index fcaad3f5..f4a8ea6a 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -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 (this.IsReadAndSign() && rescourceManager.GetString(statusName + "4RaC") is string translationRaC) + return translationRaC; - if (!string.IsNullOrEmpty(translationRaC)) - return translationRaC; - } - - return resourceManager.GetString(statusName); + return rescourceManager.GetString(statusName); } }