Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
 /// <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));
 }
Beispiel #3
0
        /// <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));
        }
Beispiel #4
0
 /// <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);
Beispiel #5
0
 /// <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);
 }
Beispiel #6
0
 /// <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);
Beispiel #7
0
 /// <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;
 }