コード例 #1
0
        internal static void LogSaveEvent(BaseDomainObject baseDomainObject)
        {
            if (//baseDomainObject.GetType() == typeof(SearchResultItem) ||
                baseDomainObject.GetType() == typeof(BaseModule))
            {
                return;
            }
            EventLog log = new EventLog();

            log.Description = "Bewaar: " + GetObjectNameNL(baseDomainObject) + " (" + baseDomainObject.Name + ", ID=" + baseDomainObject.ID.ToString() + ")";
            if (baseDomainObject.IsNew)
            {
                log.Description += " (Nieuw)";
            }
            log.Type = "Save action";
            if (baseDomainObject.GetType() == typeof(CmsSite) && baseDomainObject.IsNew)
            {
                log.Site = null;
            }
            else
            {
                log.Site = GetSite();
            }
            log.UserName = GetUserName();
            log.Failure  = false;
            log.Save();
        }
コード例 #2
0
        private static string GetObjectNameNL(BaseDomainObject baseDomainObject)
        {
            string typeName    = baseDomainObject.GetType().Name;
            string returnValue = typeName;

            if (typeName == "CmsSite")
            {
                returnValue = "Site";
            }
            else if (typeName == "CmsPage")
            {
                returnValue = "Pagina";
            }
            else if (typeName == "CmsTemplate")
            {
                returnValue = "Template";
            }
            return(returnValue);
        }