Beispiel #1
0
        /// <summary>Creates a new, empty AuditActionEntity object.</summary>
        /// <returns>A new, empty AuditActionEntity object.</returns>
        public override IEntity Create()
        {
            IEntity toReturn = new AuditActionEntity();

            // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAuditAction
            // __LLBLGENPRO_USER_CODE_REGION_END
            return(toReturn);
        }
Beispiel #2
0
        /// <summary>
        /// Checks if the current user needs auditing for the action specified
        /// </summary>
        /// <param name="action">Action.</param>
        /// <returns>true if the user needs auditing, otherwise false</returns>
        public static bool CheckIfNeedsAuditing(AuditActions auditActionID)
        {
            AuditActionCollection auditActions = GetAuditActions();

            if (auditActions != null && auditActions.Count > 0)
            {
                // create an ActionRight entity, and forcing the PK value, to avoid fetching it from the database.
                AuditActionEntity auditAction = new AuditActionEntity();
                auditAction.Fields[(int)AuditActionFieldIndex.AuditActionID].ForcedCurrentValueWrite((int)auditActionID);
                auditAction.IsNew = false;

                return(auditActions.Contains(auditAction));
            }

            return(false);
        }