Exemplo n.º 1
0
        public static string GetListHtml()
        {
            var directoryPath = GetTemplatesDirectoryPath();
            var htmlPath      = FormUtils.PathCombine(directoryPath, "list.html");
            var html          = CacheUtils.Get <string>(htmlPath);

            if (html != null)
            {
                return(html);
            }

            html = FormUtils.ReadText(htmlPath);

            CacheUtils.Insert(htmlPath, html, 24);
            return(html);
        }
Exemplo n.º 2
0
            public static List <KeyValuePair <string, FieldInfo> > GetAllFieldInfoList(int formId)
            {
                var cacheKey = GetCacheKey(formId);
                var retVal   = CacheUtils.Get <List <KeyValuePair <string, FieldInfo> > >(cacheKey);

                if (retVal != null)
                {
                    return(retVal);
                }

                lock (LockObject)
                {
                    retVal = CacheUtils.Get <List <KeyValuePair <string, FieldInfo> > >(cacheKey);
                    if (retVal == null)
                    {
                        retVal = Repository.GetAllFieldInfoList(formId);

                        CacheUtils.Insert(cacheKey, retVal, 12);
                    }
                }

                return(retVal);
            }
Exemplo n.º 3
0
            public static IList <FormInfo> GetCacheFormInfoList(int siteId)
            {
                var cacheKey = GetCacheKey(siteId);
                var retVal   = CacheUtils.Get <IList <FormInfo> >(cacheKey);

                if (retVal != null)
                {
                    return(retVal);
                }

                lock (LockObject)
                {
                    retVal = CacheUtils.Get <IList <FormInfo> >(cacheKey);
                    if (retVal == null)
                    {
                        retVal = Repository.GetFormInfoList(siteId);

                        CacheUtils.Insert(cacheKey, retVal, 12);
                    }
                }

                return(retVal);
            }