Beispiel #1
0
 public static bool StoreLogEvent(long storeId, string source, string message, EventLogSeverity severity)
 {
     bool ret = false;
     Metrics.EventLogEntry e = new Metrics.EventLogEntry(source, message, severity, storeId);
     e.StoreId = storeId;
     try
     {
         RequestContext context = new RequestContext();
         context.CurrentStore = new Accounts.Store() { Id = storeId };
         Metrics.EventLogRepository repository = new Metrics.EventLogRepository(context);
         ret = repository.Create(e);
         repository.Roll();
     }
     catch(Exception ex)
     {
         LogEvent(ex);
         return false;
     }
     return true;
 }
Beispiel #2
0
        public static bool StoreLogEvent(long storeId, string source, string message, EventLogSeverity severity)
        {
            bool ret = false;

            Metrics.EventLogEntry e = new Metrics.EventLogEntry(source, message, severity, storeId);
            e.StoreId = storeId;
            try
            {
                RequestContext context = new RequestContext();
                context.CurrentStore = new Accounts.Store()
                {
                    Id = storeId
                };
                Metrics.EventLogRepository repository = new Metrics.EventLogRepository(context);
                ret = repository.Create(e);
                repository.Roll();
            }
            catch (Exception ex)
            {
                LogEvent(ex);
                return(false);
            }
            return(true);
        }