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); }
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); }
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); }