Files
2023-03-03 16:07:50 +08:00

51 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*******************************************************************************
* Copyright © 2020 HT.Cloud.Framework 版权所有
* Author: HT.Cloud
* Description: WaterCloud快速开发平台
* Website
*********************************************************************************/
using System;
using HT.Cloud.Code;
namespace HT.Cloud.Domain
{
public class IEntity<TEntity>
{
public void Create()
{
var entity = this as ICreationAudited;
entity.F_Id = Utils.GuId();
var LoginInfo = OperatorProvider.Provider.GetCurrent();
if (LoginInfo != null)
{
entity.F_CreatorUserId = LoginInfo.UserId;
}
entity.F_CreatorTime = DateTime.Now;
}
public void Modify(string keyValue)
{
var entity = this as IModificationAudited;
entity.F_Id = keyValue;
var LoginInfo = OperatorProvider.Provider.GetCurrent();
if (LoginInfo != null)
{
entity.F_LastModifyUserId = LoginInfo.UserId;
}
entity.F_LastModifyTime = DateTime.Now;
}
public void Remove()
{
var entity = this as IDeleteAudited;
var LoginInfo = OperatorProvider.Provider.GetCurrent();
if (LoginInfo != null)
{
entity.F_DeleteUserId = LoginInfo.UserId;
}
entity.F_DeleteTime = DateTime.Now;
entity.F_DeleteMark = true;
}
}
}