using System;
using System.Collections.Generic;
using System.Linq;
using Neo.Afx.ComponentModel;
namespace Neo.Afx.Admin.Audit
{
///
/// Afx admin database
///
public class AfxAdminAuditDatabase : Database
{
///
/// Constructor
///
public AfxAdminAuditDatabase()
: base(new AfxAdminAuditContext())
{
}
#region History
///
/// Get all data from table.
///
/// List of objects
public IEnumerable SearchAuditHistory(short sourceID, short actionID, short entityID, long itemID, bool? isCritical, bool? isException, long createdByID, DateTime startDate, DateTime endDate)
{
return Context.Pr_AuditHistorySearch(sourceID, actionID, entityID, itemID, isCritical, isException, createdByID, startDate, endDate).ToList();
}
#endregion
#region SystemLog
///
/// Get all data from table.
///
/// List of objects
public IEnumerable SearchAuditSystemLog(string tableName, long? tableKey, string tableOperation, long? createdByID, DateTime? startDate, DateTime? endDate)
{
return Context.Pr_AuditSystemLogSearch(tableName, tableKey, tableOperation, createdByID, startDate, endDate).ToList();
}
#endregion
#region GetSources
///
/// Get all data from table.
///
/// List of objects
public IEnumerable GetSources()
{
return (from item in Context.Sources
where item.IsCancelled == false
orderby item.Name ascending
select item).ToList();
}
///
/// Get data from table based on count.
///
/// Restricts amount returned items in the collection.
/// List of objects.
public IEnumerable GetSources(int count)
{
return (from item in Context.Sources
where item.IsCancelled == false
orderby item.Name ascending
select item).Take(count).ToList();
}
#endregion
#region GetActions
///
/// Get all data from table.
///
/// List of objects
public IEnumerable GetActions()
{
return (from item in Context.Actions
where item.IsCancelled == false
orderby item.Name ascending
select item).ToList();
}
///
/// Get data from table based on count.
///
/// Restricts amount returned items in the collection.
/// List of objects.
public IEnumerable GetActions(int count)
{
return (from item in Context.Actions
where item.IsCancelled == false
orderby item.Name ascending
select item).Take(count).ToList();
}
#endregion
}
}