Beispiel #1
0
        public override void SaveAuditedEntity(AuditedEntity auditedEntity)
        {
            var audit = new AuditRecord
            {
                Action      = (byte)auditedEntity.Action,
                AuditDate   = DateTime.Now,
                ParentTable = auditedEntity.ParentEntityType.Name,
                ParentKey   = auditedEntity.ParentKey,
                Table       = auditedEntity.EntityType.Name,
                TableKey    = auditedEntity.EntityKey,
                UserName    = "******",
            };

            foreach (var modifiedProperty in auditedEntity.ModifiedProperties)
            {
                audit.AuditRecordProperties.Add(
                    new AuditRecordProperty
                {
                    PropertyName = modifiedProperty.DisplayName,
                    OldValue     = modifiedProperty.OldValue,
                    NewValue     = modifiedProperty.NewValue
                });
            }

            if (audit.AuditRecordProperties.Count > 0)
            {
                AuditRecords.InsertOnSubmit(audit);
            }
        }
Beispiel #2
0
 partial void DeleteAuditRecord(AuditRecord instance);
Beispiel #3
0
 partial void UpdateAuditRecord(AuditRecord instance);
Beispiel #4
0
 partial void InsertAuditRecord(AuditRecord instance);