public virtual bool HasUserActioned(string username, AuditRecord.AuditAction action)
        {
            BusiBlocks.ConnectionParameters parameters = BusiBlocks.ConnectionParameters.Create("DefaultDB");

            using (BusiBlocks.TransactionScope transaction = new BusiBlocks.TransactionScope(parameters))
            {
                AuditDataStore store = new AuditDataStore(transaction);
                return(store.AuditRecordExist(username, Id, action.ToString()));
            }
        }
Exemple #2
0
        public static IList <AuditRecord> GetAuditItems(string data, AuditRecord.AuditAction action)
        {
            ConnectionParameters parameters = ConnectionParameters.Create("DefaultDB");

            IList <AuditRecord> records;

            using (var transaction = new TransactionScope(parameters))
            {
                var store = new AuditDataStore(transaction);
                records = store.Find(data, action.ToString());
            }

            return(records);
        }
Exemple #3
0
        public static void Audit(string userName, string data, AuditRecord.AuditAction action)
        {
            var auditRecord = new AuditRecord();

            auditRecord.Action    = action.ToString();
            auditRecord.UserName  = userName;
            auditRecord.Data      = data;
            auditRecord.TimeStamp = DateTime.Now;

            ConnectionParameters parameters = ConnectionParameters.Create("DefaultDB");

            using (var transaction = new TransactionScope(parameters))
            {
                var store = new AuditDataStore(transaction);
                //if (!store.AuditRecordExist(username, data, action.ToString()))
                //{
                store.Insert(auditRecord);
                transaction.Commit();
                //}
            }
        }
Exemple #4
0
    private List <User> GetViewUsers(AuditRecord.AuditAction auditType, IList <User> totalUsers, List <string> publishedIds)
    {
        List <User> viewUsers = new List <BusiBlocks.Membership.User>();

        foreach (string publishedId in publishedIds)
        {
            List <AuditRecord> records = (List <AuditRecord>)AuditManager.GetAuditItems(publishedId, auditType);

            foreach (User user in totalUsers)
            {
                AuditRecord record = records.Find(x => x.UserName.Equals(user.Name));
                if (record != null)
                {
                    //add unique record only
                    if (viewUsers.Exists(x => x.Name.Equals(user.Name)) == false)
                    {
                        viewUsers.Add(user);
                    }
                }
            }
        }
        return(viewUsers);
    }