Example #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, WebSiteTemplateModel webModel, long SN)
        {
            string key = "Cache_WebSiteTemplate_Model_" + SN;

            CacheHelper.RemoveCache(key);
            return(webDAL.UpdateInfo(trans, webModel, SN));
        }
Example #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public WebSiteTemplateModel GetCacheInfo(SqlTransaction trans, long SN)
        {
            string key   = "Cache_WebSiteTemplate_Model_" + SN;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((WebSiteTemplateModel)value);
            }
            else
            {
                WebSiteTemplateModel webModel = webDAL.GetInfo(trans, SN);
                CacheHelper.AddCache(key, webModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(webModel);
            }
        }
Example #3
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, WebSiteTemplateModel webModel)
        {
            return(webDAL.InsertInfo(trans, webModel));
        }