public void Trail(TransacActionType actionType, object sourceObject, object targetObject) { if (IoC.Get <IAuditManager>().MustTrail(actionType, sourceObject, targetObject)) { TransacActionInfo action = new TransacActionInfo(); action.Type = actionType; action.SourceInstance = sourceObject; action.TargetInstance = targetObject; this.Transaction.Actions.Add(action); } }
/// <summary> /// Indicates if the action must be trailed or not. /// </summary> /// <param name="actionType">Type of the action.</param> /// <param name="source">The source.</param> /// <param name="target">The target.</param> /// <returns></returns> public override bool MustTrail(TransacActionType actionType, object source, object target) { object referenceObject = null; if (actionType == TransacActionType.Insert) { referenceObject = target; } else { referenceObject = source; } IMetamodelEntity metamodelEntity = IoC.Get<ISecurityManager>().MetamodelManager.GetEntity(referenceObject.GetType()); return ((metamodelEntity != null) && (metamodelEntity.AuditType != AuditType.None)); }
/// <summary> /// Indicates if the action must be trailed or not. /// </summary> /// <param name="actionType">Type of the action.</param> /// <param name="source">The source.</param> /// <param name="target">The target.</param> /// <returns></returns> public override bool MustTrail(TransacActionType actionType, object source, object target) { object referenceObject = null; if (actionType == TransacActionType.Insert) { referenceObject = target; } else { referenceObject = source; } IMetamodelEntity metamodelEntity = IoC.Get <ISecurityManager>().MetamodelManager.GetEntity(referenceObject.GetType()); return((metamodelEntity != null) && (metamodelEntity.AuditType != AuditType.None)); }
/// <summary> /// Indicates if the action must be trailed or not. /// </summary> /// <param name="actionType">Type of the action.</param> /// <param name="source">The source.</param> /// <param name="target">The target.</param> /// <returns></returns> public abstract bool MustTrail(TransacActionType actionType, object source, object target);
/// <summary> /// Indicates if the action must be trailed or not. /// </summary> /// <param name="actionType">Type of the action.</param> /// <param name="source">The source.</param> /// <param name="target">The target.</param> /// <returns></returns> public override bool MustTrail(TransacActionType actionType, object source, object target) { return(false); }
/// <summary> /// Indicates if the action must be trailed or not. /// </summary> /// <param name="actionType">Type of the action.</param> /// <param name="source">The source.</param> /// <param name="target">The target.</param> /// <returns></returns> public override bool MustTrail(TransacActionType actionType, object source, object target) { return false; }