Refactor user-related classes and properties

- Added parameterless and user-initializing constructors to `EGUser`.
- Removed unnecessary `using` directives and `#if NETFRAMEWORK` from `EGUser.cs`, `Envelope.cs`, and `EnvelopeHistory.cs`.
- Replaced `EGUser` property with `User` in `Envelope.cs` and `EnvelopeHistory.cs`.
- Retained default value for `CURRENT_WORK_APP` in `Envelope.cs`.
This commit is contained in:
tekh 2025-06-26 16:21:22 +02:00
parent 5c48afd8b0
commit 5ee9efbcd9
3 changed files with 30 additions and 10 deletions

View File

@ -1,17 +1,35 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using DigitalData.UserManager.Domain.Entities;
#if NETFRAMEWORK
using System;
#endif
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBDD_USER", Schema = "dbo")]
public class EGUser : User
{
public EGUser()
{
}
public EGUser(User user)
{
Id = user.Id;
Prename = user.Prename;
Name = user.Name;
Username = user.Username;
Shortname = user.Shortname;
Email = user.Email;
Language = user.Language;
Comment = user.Comment;
Deleted = user.Deleted;
DateFormat = user.DateFormat;
Active = user.Active;
GeneralViewer = user.GeneralViewer;
WanEnvironment = user.WanEnvironment;
UserIdFkIntEcm = user.UserIdFkIntEcm;
DeletedWhen = user.DeletedWhen;
DeletedWho = user.DeletedWho;
}
#region FORM_APP
[NotMapped]
public bool HasAccess { get; set; }

View File

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
@ -113,7 +114,7 @@ namespace EnvelopeGenerator.Domain.Entities
// TODO: * Check the Form App and remove the default value
[ForeignKey("UserId")]
public EGUser User { get; set; } = new EGUser();
public User User { get; set; }
[ForeignKey("EnvelopeTypeId")]
public EnvelopeType EnvelopeType { get; set; }

View File

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
@ -38,7 +39,7 @@ namespace EnvelopeGenerator.Domain.Entities
public string Comment { get; set; }
[ForeignKey("UserReference")]
public virtual EGUser Sender { get; set; }
public virtual User Sender { get; set; }
[ForeignKey("UserReference")]
public virtual Receiver Receiver { get; set; }