public static int GetSiteIdBySiteDir(string siteDir) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlSiteCache), nameof(GetSiteIdBySiteDir), siteDir); var retVal = StlCacheManager.GetInt(cacheKey); if (retVal != -1) { return(retVal); } lock (LockObject) { retVal = StlCacheManager.GetInt(cacheKey); if (retVal == -1) { retVal = DataProvider.SiteDao.GetIdBySiteDir( siteDir); StlCacheManager.Set(cacheKey, retVal); } } return(retVal); }
public static int GetCountOfContentAdd(string tableName, int siteId, int channelId, EScopeType scope, DateTime begin, DateTime end, string userName, ETriState checkedState) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlContentCache), nameof(GetCountOfContentAdd), siteId.ToString(), channelId.ToString(), EScopeTypeUtils.GetValue(scope), DateUtils.GetDateString(begin), DateUtils.GetDateString(end), userName, ETriStateUtils.GetValue(checkedState)); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.ContentDao.GetCountOfContentAdd(tableName, siteId, channelId, scope, begin, end, userName, checkedState); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
public static int GetPageTotalCount(string sqlString) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlDatabaseCache), nameof(GetPageTotalCount), sqlString); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.DatabaseDao.GetPageTotalCount(sqlString); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
public static int GetSequence(string tableName, int channelId, int contentId) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlContentCache), nameof(GetSequence), tableName, channelId.ToString(), contentId.ToString()); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.ContentDao.GetSequence(tableName, channelId, contentId); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
public static int GetContentId(string tableName, int channelId, int taxis, bool isNextContent) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlContentCache), nameof(GetContentId), tableName, channelId.ToString(), taxis.ToString(), isNextContent.ToString()); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.ContentDao.GetContentId(tableName, channelId, taxis, isNextContent); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
public static int GetCountCheckedImage(int siteId, int channelId) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlContentCache), nameof(GetCountCheckedImage), siteId.ToString(), channelId.ToString()); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.ContentDao.GetCountCheckedImage(siteId, channelId); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
public static int GetSiteId(int channelId) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlChannelCache), nameof(GetSiteId), channelId.ToString()); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.ChannelDao.GetSiteId(channelId); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
//public static int GetIdByIndexName(int siteId, string channelIndex) //{ // var cacheKey = StlCacheManager.GetCacheKey(nameof(StlChannelCache), nameof(GetIdByIndexName), // siteId.ToString(), channelIndex); // var retval = StlCacheManager.GetInt(cacheKey); // if (retval != -1) return retval; // lock (LockObject) // { // retval = StlCacheManager.GetInt(cacheKey); // if (retval == -1) // { // retval = DataProvider.ChannelDao.GetIdByIndexName(siteId, channelIndex); // StlCacheManager.Set(cacheKey, retval); // } // } // return retval; //} public static int GetIdByParentIdAndTaxis(int parentId, int taxis, bool isNextChannel) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlChannelCache), nameof(GetIdByParentIdAndTaxis), parentId.ToString(), taxis.ToString(), isNextChannel.ToString()); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.ChannelDao.GetIdByParentIdAndTaxis(parentId, taxis, isNextChannel); StlCacheManager.Set(cacheKey, retval); } } return(retval); }
public static int GetContentId(string tableName, int channelId, bool isCheckedOnly, string orderByString) { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlContentCache), nameof(GetContentId), tableName, channelId.ToString(), orderByString); var retVal = StlCacheManager.GetInt(cacheKey); if (retVal != -1) { return(retVal); } lock (LockObject) { retVal = StlCacheManager.GetInt(cacheKey); if (retVal == -1) { retVal = DataProvider.ContentDao.GetContentId(tableName, channelId, isCheckedOnly, orderByString); StlCacheManager.Set(cacheKey, retVal); } } return(retVal); }
public static int GetSiteIdByIsRoot() { var cacheKey = StlCacheManager.GetCacheKey(nameof(StlSiteCache), nameof(GetSiteIdByIsRoot)); var retval = StlCacheManager.GetInt(cacheKey); if (retval != -1) { return(retval); } lock (LockObject) { retval = StlCacheManager.GetInt(cacheKey); if (retval == -1) { retval = DataProvider.SiteDao.GetIdByIsRoot(); StlCacheManager.Set(cacheKey, retval); } } return(retval); }