Пример #1
0
        public List <LogItem> GetLogItems(int nodeId)
        {
            if (ExternalLogger != null)
            {
                return(ExternalLogger.GetLogItems(nodeId));
            }

            return(LogItem.ConvertIRecordsReader(SqlHelper.ExecuteReader(
                                                     "select userId, NodeId, DateStamp, logHeader, logComment from umbracoLog where id = @id order by dateStamp desc",
                                                     SqlHelper.CreateParameter("@id", nodeId))));
        }
Пример #2
0
        public List <LogItem> GetLogItems(User user, DateTime sinceDate)
        {
            if (ExternalLogger != null)
            {
                return(ExternalLogger.GetLogItems(user, sinceDate));
            }

            return(LogItem.ConvertIRecordsReader(SqlHelper.ExecuteReader(
                                                     "select userId, NodeId, DateStamp, logHeader, logComment from umbracoLog where UserId = @user and DateStamp >= @dateStamp order by dateStamp desc",
                                                     SqlHelper.CreateParameter("@user", user.Id),
                                                     SqlHelper.CreateParameter("@dateStamp", sinceDate))));
        }
Пример #3
0
        public List <LogItem> GetLogItems(LogTypes type, DateTime sinceDate)
        {
            if (ExternalLogger != null)
            {
                return(ExternalLogger.GetLogItems(type, sinceDate));
            }

            using (var sqlHelper = Application.SqlHelper)
                return(LogItem.ConvertIRecordsReader(sqlHelper.ExecuteReader(
                                                         "select userId, NodeId, DateStamp, logHeader, logComment from umbracoLog where logHeader = @logHeader and DateStamp >= @dateStamp order by dateStamp desc",
                                                         sqlHelper.CreateParameter("@logHeader", type.ToString()),
                                                         sqlHelper.CreateParameter("@dateStamp", sinceDate))));
        }