Ejemplo n.º 1
0
        /// <summary>
        /// Logs the given message
        /// </summary>
        /// <param name="log"></param>
        /// <param name="type"></param>
        public int Log(string message, SystemLogTypes type)
        {
            var log = new SystemLog()
            {
                Message         = message,
                SystemLogTypeID = (int)type,
            };

            return(this.Log(log));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns log messages matching the given filter
        /// </summary>
        /// <param name="type"></param>
        /// <param name="fromDate"></param>
        /// <param name="?"></param>
        /// <param name="?"></param>
        /// <param name="toDate"></param>
        /// <returns></returns>
        public List <SystemLog> GetLog(SystemLogTypes type, DateTime fromDate, DateTime toDate)
        {
            int systemLogTypeID = (int)type;

            using (var cxt = DataStore.GetDataStore())
            {
                var data = (
                    from log in cxt.SystemLog
                    where (log.SystemLogTypeID == systemLogTypeID || systemLogTypeID == 0) &&
                    log.WhenOccurred >= fromDate &&
                    log.WhenOccurred <= toDate
                    orderby log.WhenOccurred descending
                    select log
                    );
                return(data.ToList());
            }
        }
Ejemplo n.º 3
0
 public List <SystemLog> GetLog(SystemLogTypes type, DateTime fromDate, DateTime toDate)
 {
     return(new List <SystemLog>());
 }
Ejemplo n.º 4
0
 public int Log(string message, SystemLogTypes type)
 {
     return(0);
 }