コード例 #1
0
        public ICollection <AuditTrace> FindTraceByCriteria(AuditTraceCriteria auditTraceCriteria)
        {
            ICollection <AuditTrace> ret = new List <AuditTrace>();

            foreach (AuditTrace audit in inMemoryStore.Values)
            {
                if (!String.IsNullOrEmpty(auditTraceCriteria.Category) && auditTraceCriteria.Category.Equals(audit.Category))
                {
                    ret.Add(audit);
                    continue;
                }

                if (!String.IsNullOrEmpty(auditTraceCriteria.Username) && auditTraceCriteria.Username.Equals(audit.Username))
                {
                    ret.Add(audit);
                    continue;
                }

                if (audit.BusinessDate != null && auditTraceCriteria.StartBusinessDate != null && auditTraceCriteria.StartBusinessDate < audit.BusinessDate)
                {
                    if (auditTraceCriteria.EndBusinessDate == null)
                    {
                        ret.Add(audit);
                        continue;
                    }
                    else if (auditTraceCriteria.EndBusinessDate > audit.BusinessDate)
                    {
                        ret.Add(audit);
                        continue;
                    }
                }

                if (audit.ExecutionDate != null && auditTraceCriteria.StartExecutionDate != null && auditTraceCriteria.StartExecutionDate < audit.ExecutionDate)
                {
                    if (auditTraceCriteria.EndExecutionDate == null)
                    {
                        ret.Add(audit);
                        continue;
                    }
                    else if (auditTraceCriteria.EndExecutionDate > audit.ExecutionDate)
                    {
                        ret.Add(audit);
                        continue;
                    }
                }

                if (auditTraceCriteria.Item != null && auditTraceCriteria.Item == audit.Item)
                {
                    ret.Add(audit);
                }
            }

            return(ret);
        }
コード例 #2
0
        /// <inheritDoc cref="IAuditTraceStore.FindTraceByCriteria" />
        public ICollection <AuditTrace> FindTraceByCriteria(AuditTraceCriteria auditTraceCriteria)
        {
            var cmd = GetSqlServerCommand("FindTraceByCriteria.sql");

            cmd.Parameters.AddWithValue("AUD_BUSINESS_DATE_START", auditTraceCriteria.StartBusinessDate);
            cmd.Parameters.AddWithValue("AUD_BUSINESS_DATE_END", auditTraceCriteria.EndBusinessDate);
            cmd.Parameters.AddWithValue("AUD_EXECUTION_DATE_START", auditTraceCriteria.StartExecutionDate);
            cmd.Parameters.AddWithValue("AUD_EXECUTION_DATE_END", auditTraceCriteria.EndExecutionDate);
            cmd.Parameters.AddWithValue(AuditTrace.Cols.AUD_CATEGORY, auditTraceCriteria.Category);
            cmd.Parameters.AddWithValue(AuditTrace.Cols.AUD_ITEM, auditTraceCriteria.Item);
            cmd.Parameters.AddWithValue(AuditTrace.Cols.AUD_USERNAME, auditTraceCriteria.Username);
            return(cmd.ReadList <AuditTrace>());
        }
コード例 #3
0
ファイル: AuditManager.cs プロジェクト: JabX/kinetix
 public ICollection <AuditTrace> FindTrace(AuditTraceCriteria auditTraceCriteria)
 {
     return(_auditTraceStorePlugin.FindTraceByCriteria(auditTraceCriteria));
 }
コード例 #4
0
ファイル: AuditManager.cs プロジェクト: ElbachaPlus/kinetix
 public IList <AuditTrace> FindTrace(AuditTraceCriteria auditTraceCriteria)
 {
     return(_auditTraceStorePlugin.FindTraceByCriteria(auditTraceCriteria));
 }