纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

3 years ago
  1. using NFine.Code;
  2. using System;
  3. namespace NFine.Domain
  4. {
  5. public class IEntity<TEntity>
  6. {
  7. public void Create()
  8. {
  9. var entity = this as ICreationAudited;
  10. entity.F_Id = Common.GuId();
  11. var LoginInfo = OperatorProvider.Provider.GetCurrent();
  12. if (LoginInfo != null)
  13. {
  14. entity.F_CreatorUserId = LoginInfo.UserId;
  15. }
  16. entity.F_CreatorTime = DateTime.Now;
  17. }
  18. public void Modify(string keyValue)
  19. {
  20. var entity = this as IModificationAudited;
  21. entity.F_Id = keyValue;
  22. var LoginInfo = OperatorProvider.Provider.GetCurrent();
  23. if (LoginInfo != null)
  24. {
  25. entity.F_LastModifyUserId = LoginInfo.UserId;
  26. }
  27. entity.F_LastModifyTime = DateTime.Now;
  28. }
  29. public void Remove()
  30. {
  31. var entity = this as IDeleteAudited;
  32. var LoginInfo = OperatorProvider.Provider.GetCurrent();
  33. if (LoginInfo != null)
  34. {
  35. entity.F_DeleteUserId = LoginInfo.UserId;
  36. }
  37. entity.F_DeleteTime = DateTime.Now;
  38. entity.F_DeleteMark = true;
  39. }
  40. }
  41. }