Esempio n. 1
0
 public static void WriteToLog(string message, string module, ActivityLogTypes logType, string logFileName)
 {
     ReadWriteLock.EnterWriteLock();
     try
     {
         if (logFileName != null)
         {
             var item = new ActivityItem
             {
                 Club         = ConfigurationManager.AppSettings["OrganisationName"],
                 Datum        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                 Ip           = ConfigurationManager.AppSettings["Ip"],
                 Source       = "Photomanager.UI",
                 Type         = logType.ToString(),
                 Lokatie      = module,
                 Omschrijving = message
             };
             XmlFactory.AddToXml(FolderFactory.LogFolder, logFileName, item);
         }
     }
     finally
     {
         ReadWriteLock.ExitWriteLock();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Get a label CSS class name.
        /// </summary>
        /// <param name="type">Activity log type.</param>
        /// <param name="typeLabels">
        /// Dictionary returned by
        /// <see cref="Belletrix.Domain.ActivityService.GetActivityTypeLabels"/>.
        /// </param>
        /// <returns>Suitable label name.</returns>
        public static string ActivityLogLabel(ActivityLogTypes type, IDictionary <int, string> typeLabels)
        {
            int i = (int)type % typeLabels.Count;

            return(typeLabels.ContainsKey(i) ? typeLabels[i] : typeLabels[1]);
        }