Refactor name retrieval to use GetFullName method
Updated the `CertificateModel.vb` and `EmailData.vb` files to replace direct access to the `FullName` property with the `GetFullName()` method for retrieving creator, sender, and receiver names. This change enhances flexibility and maintains consistency across the codebase. Additionally, added a new static `GetFullName` method in the `EGUserExtensions.cs` file to centralize the formatting of user names by concatenating the `Prename` and `Name` properties.
This commit is contained in:
parent
5d29ad889d
commit
07381e78b4
@ -34,7 +34,7 @@ Public Class CertificateModel
|
||||
oCommand.Parameters.Add("ENVELOPE_UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
|
||||
oCommand.Parameters.Add("ENVELOPE_SUBJECT", SqlDbType.NVarChar).Value = String.Empty
|
||||
oCommand.Parameters.Add("CREATOR_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
oCommand.Parameters.Add("CREATOR_NAME", SqlDbType.NVarChar).Value = pEnvelope.User.FullName
|
||||
oCommand.Parameters.Add("CREATOR_NAME", SqlDbType.NVarChar).Value = pEnvelope.User.GetFullName()
|
||||
oCommand.Parameters.Add("CREATOR_EMAIL", SqlDbType.NVarChar).Value = pEnvelope.User.Email
|
||||
oCommand.Parameters.Add("ENVELOPE_STATUS", SqlDbType.Int).Value = pEnvelope.Status
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ Public Class EmailData
|
||||
ReceiverName = pReceiver.Name
|
||||
ReceiverAccessCode = pReceiver.AccessCode
|
||||
SenderAdress = pEnvelope.User.Email
|
||||
SenderName = pEnvelope.User.FullName
|
||||
SenderName = pEnvelope.User.GetFullName()
|
||||
EnvelopeTitle = pEnvelope.Title
|
||||
End Sub
|
||||
Public Function TextToHtml(input As String) As String
|
||||
@ -72,10 +72,10 @@ Public Class EmailData
|
||||
Message = pEnvelope.Message
|
||||
ReferenceID = pEnvelope.Id
|
||||
ReferenceString = pEnvelope.Uuid
|
||||
ReceiverName = pEnvelope.User.FullName
|
||||
ReceiverName = pEnvelope.User.GetFullName()
|
||||
ReceiverAccessCode = String.Empty
|
||||
SenderAdress = pEnvelope.User.Email
|
||||
SenderName = pEnvelope.User.FullName
|
||||
SenderName = pEnvelope.User.GetFullName()
|
||||
EnvelopeTitle = pEnvelope.Title
|
||||
End Sub
|
||||
|
||||
|
||||
@ -26,5 +26,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
DeletedWho = user.DeletedWho
|
||||
};
|
||||
}
|
||||
|
||||
public static string GetFullName(this User user) => $"{user.Prename} {user.Name}";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user