using System.Collections.Generic;
using System.Linq;
using Neo.Afx.ComponentModel;
namespace Neo.Afx.Admin.Report
{
///
/// Afx admin database
///
public class AfxAdminReportDatabase : Database
{
///
/// Constructor
///
public AfxAdminReportDatabase()
: base(new AfxAdminReportContext())
{
}
#region GetReportDefinitions
///
/// Get all data from table.
///
/// List of objects
public IEnumerable GetReportDefinitions()
{
return (from item in Context.ReportDefinitions where item.IsCancelled == false orderby item.Description ascending select item).ToList();
}
///
/// Get data from table based on count.
///
/// Restricts amount returned items in the collection.
/// List of objects.
public IEnumerable GetReportDefinitions(int count)
{
return (from item in Context.ReportDefinitions where item.IsCancelled == false orderby item.Description ascending select item).Take(count).ToList();
}
#endregion
#region GetReportSevers
///
/// Get all data from table.
///
/// List of objects
public IEnumerable GetReportSevers()
{
return (from item in Context.ReportServers where item.IsCancelled == false orderby item.Title ascending select item).ToList();
}
///
/// Get data from table based on count.
///
/// Restricts amount returned items in the collection.
/// List of objects.
public IEnumerable GetReportSevers(int count)
{
return (from item in Context.ReportServers where item.IsCancelled == false orderby item.Title ascending select item).Take(count).ToList();
}
#endregion
#region GetReportGroups
///
/// Get Report Servers based on count.
///
/// Restricts amount returned items in the collection.
/// List of Report Servers.
public IEnumerable GetReportGroups(int count)
{
return (from item in Context.ReportGroups where item.IsCancelled == false orderby item.Description ascending select item).Take(count).ToList();
}
///
/// Get all Report Servers.
///
/// List of Report Servers.
public IEnumerable GetReportGroups()
{
return (from item in Context.ReportGroups where item.IsCancelled == false orderby item.Description ascending select item).ToList();
}
#endregion
}
}