| | |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEAWCS_Core.Const; |
| | | using WIDESEAWCS_Core.DB.Models; |
| | | using WIDESEAWCS_Core.Helper; |
| | |
| | | { |
| | | public static void DataExecuting(object oldValue, DataFilterModel entityInfo) |
| | | { |
| | | if (entityInfo.EntityValue is BaseEntity baseEntity) |
| | | if (entityInfo.EntityValue is BaseEntity entity && entityInfo.EntityValue is IBaseHistoryEntity historyEntity) |
| | | { |
| | | if (entityInfo.OperationType == DataFilterType.InsertByObject && entityInfo.PropertyName == nameof(BaseEntity.CreateDate)) |
| | | { |
| | | historyEntity.InsertTime = DateTime.Now; |
| | | } |
| | | } |
| | | else if (entityInfo.EntityValue is BaseEntity baseEntity) |
| | | { |
| | | // 新增操作 |
| | | if (entityInfo.OperationType == DataFilterType.InsertByObject) |