问题修改
continuous-integration/drone/push Build is passing Details

Uat_Study^2
he 2024-05-27 15:07:46 +08:00
parent 07dcb6fe47
commit 4966a32bcb
2 changed files with 26 additions and 4 deletions

View File

@ -14,7 +14,7 @@ namespace IRaCIS.Core.Domain.Models
///</summary> ///</summary>
[Table("TrialDocument")] [Table("TrialDocument")]
public class TrialDocument : Entity, IAuditUpdate, IAuditAdd public class TrialDocument : Entity, IAuditUpdate, IAuditAdd
{ {
//需要确认的项目用户 通过TrialId 关联 用中间表过滤 //需要确认的项目用户 通过TrialId 关联 用中间表过滤

View File

@ -69,18 +69,40 @@ namespace IRaCIS.Core.Infra.EFCore.Common
typeof(TrialSiteSurvey), typeof(TrialSiteSurvey),
typeof(TrialSiteUser), typeof(TrialSiteUser),
typeof(VisitStage), typeof(VisitStage),
typeof(TrialSite) typeof(TrialSite),
};
};
} }
} }
// 修改为删除
private List<Type> UpdateIsDelete
{
get
{
return new List<Type>()
{
typeof(TrialDocument)
};
}
}
public string GetEntityAuditOpt(EntityEntry entityEntry)
public string GetEntityAuditOpt(EntityEntry entityEntry)
{ {
if (entityEntry.State == EntityState.Added) if (entityEntry.State == EntityState.Added)
{ {
return AuditOpt.Add; return AuditOpt.Add;
} }
else if (
UpdateIsDelete.Contains(entityEntry.Entity.GetType())
&& entityEntry.State == EntityState.Modified
&& (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity)
)
{
return AuditOpt.Deleted;
}
else if (entityEntry.State == EntityState.Deleted || else if (entityEntry.State == EntityState.Deleted ||
(entityEntry.State == EntityState.Modified (entityEntry.State == EntityState.Modified