Replace User class with EGUser across the codebase
This commit introduces the new `EGUser` class, which replaces the existing `User` class in multiple files, including `EnvelopeModel.vb`, `State.vb`, and `UserModel.vb`. The `EGUser` class extends `User`, adding new properties while maintaining existing functionality. Key changes include: - Updated property types from `User` to `EGUser` in relevant models. - Method signatures in `UserModel.vb` modified to accept and return `EGUser`. - Domain entities in `Envelope.cs` and `EnvelopeHistory.cs` now reference `EGUser`. - Complete removal of the `User.cs` file. - Added a new package reference for `UserManager.Domain` in the project file. - Updated `MYUSER` variable in `ModuleSettings.vb` to use `EGUser`. These changes enhance the user model to better meet application requirements.
This commit is contained in:
50
EnvelopeGenerator.Domain/Entities/EGUser.cs
Normal file
50
EnvelopeGenerator.Domain/Entities/EGUser.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
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
|
||||
{
|
||||
[Required]
|
||||
[Column("GENERAL_VIEWER")]
|
||||
[StringLength(30)]
|
||||
[DefaultValue("NONE")]
|
||||
public string GeneralViewer { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("WAN_ENVIRONMENT")]
|
||||
public bool WanEnvironment { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("USERID_FK_INT_ECM")]
|
||||
public int UseridFkIntEcm { get; set; }
|
||||
|
||||
[Column("DELETED_WHEN")]
|
||||
public DateTime DeletedWhen { get; set; }
|
||||
|
||||
[Column("DELETED_WHO")]
|
||||
[StringLength(50)]
|
||||
public string DeletedWho { get; set; }
|
||||
|
||||
#region FORM_APP
|
||||
[NotMapped]
|
||||
public bool HasAccess { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool IsAdmin { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool GhostModeActive { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string FullName => $"{Prename} {Name}";
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
// TODO: * Check the Form App and remove the default value
|
||||
[ForeignKey("UserId")]
|
||||
public User User { get; set; } = new User();
|
||||
public EGUser User { get; set; } = new EGUser();
|
||||
|
||||
[ForeignKey("EnvelopeTypeId")]
|
||||
public EnvelopeType EnvelopeType { get; set; }
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public string Comment { get; set; }
|
||||
|
||||
[ForeignKey("UserReference")]
|
||||
public virtual User Sender { get; set; }
|
||||
public virtual EGUser Sender { get; set; }
|
||||
|
||||
[ForeignKey("UserReference")]
|
||||
public virtual Receiver Receiver { get; set; }
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBDD_USER", Schema = "dbo")]
|
||||
public class User
|
||||
{
|
||||
[Column("GUID")]
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; } = 0;
|
||||
|
||||
[StringLength(50)]
|
||||
[Column("ADDED_WHO")]
|
||||
public string AddedWho { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
[Column("CHANGED_WHO")]
|
||||
public string ChangedWho { get; set; }
|
||||
|
||||
//TODO: assign it to default value in create dto, not here!
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
[DefaultValue("GETDATE()")]
|
||||
public DateTime AddedWhen { get; set; } = DateTime.Now;
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
|
||||
[Column("PRENAME")]
|
||||
[StringLength(50)]
|
||||
public string Prename { get; set; }
|
||||
|
||||
[Column("NAME")]
|
||||
[StringLength(50)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("USERNAME")]
|
||||
[StringLength(50)]
|
||||
public string Username { get; set; }
|
||||
|
||||
[Column("SHORTNAME")]
|
||||
[StringLength(30)]
|
||||
public string Shortname { get; set; }
|
||||
|
||||
[Column("EMAIL")]
|
||||
[StringLength(100)]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("LANGUAGE")]
|
||||
[StringLength(5)]
|
||||
[DefaultValue("de-DE")]
|
||||
public string Language { get; set; }
|
||||
|
||||
[Column("COMMENT")]
|
||||
[StringLength(500)]
|
||||
public string Comment { get; set; }
|
||||
|
||||
[Column("DELETED")]
|
||||
public bool Deleted { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("DATE_FORMAT")]
|
||||
[StringLength(10)]
|
||||
[DefaultValue("dd.MM.yyyy")]
|
||||
public string DateFormat { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ACTIVE")]
|
||||
public bool Active { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("GENERAL_VIEWER")]
|
||||
[StringLength(30)]
|
||||
[DefaultValue("NONE")]
|
||||
public string GeneralViewer { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("WAN_ENVIRONMENT")]
|
||||
public bool WanEnvironment { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("USERID_FK_INT_ECM")]
|
||||
public int UseridFkIntEcm { get; set; }
|
||||
|
||||
[Column("DELETED_WHEN")]
|
||||
public DateTime DeletedWhen { get; set; }
|
||||
|
||||
[Column("DELETED_WHO")]
|
||||
[StringLength(50)]
|
||||
public string DeletedWho { get; set; }
|
||||
|
||||
#region FORM_APP
|
||||
[NotMapped]
|
||||
public bool HasAccess { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool IsAdmin { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool GhostModeActive { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string FullName => $"{Prename} {Name}";
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction.Attributes" Version="1.0.0" />
|
||||
<PackageReference Include="UserManager.Domain" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user