public static List <VisitorLog> GetLogs(SiteDb sitedb, string WeekName = null) { if (string.IsNullOrEmpty(WeekName)) { return(sitedb.VisitorLog.Take(false, 0, Kooboo.Data.AppSettings.MaxVisitorLogRead)); } else { var repo = sitedb.LogByWeek <VisitorLog>(WeekName); var list = repo.Take(false, 0, Kooboo.Data.AppSettings.MaxVisitorLogRead); repo.Close(); return(list); } }
public static List <SiteErrorLog> GetErrorLogs(SiteDb sitedb, string WeekName = null) { if (string.IsNullOrEmpty(WeekName)) { return(sitedb.ErrorLog.Take(false, 0, Kooboo.Data.AppSettings.MaxVisitorLogRead)); //return sitedb.ErrorLog.AllItemList(); } else { var store = sitedb.LogByWeek <SiteErrorLog>(WeekName); var list = store.Take(false, 0, Kooboo.Data.AppSettings.MaxVisitorLogRead); //var list = store.AllItemList(); store.Close(); return(list); } }