コード例 #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, ProductTemplateLibraryModel proModel, long SN)
        {
            string key = "Cache_ProductTemplateLibrary_Model_" + SN;

            CacheHelper.RemoveCache(key);
            return(proDAL.UpdateInfo(trans, proModel, SN));
        }
コード例 #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public ProductTemplateLibraryModel GetCacheInfo(SqlTransaction trans, long SN)
        {
            string key   = "Cache_ProductTemplateLibrary_Model_" + SN;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((ProductTemplateLibraryModel)value);
            }
            else
            {
                ProductTemplateLibraryModel proModel = proDAL.GetInfo(trans, SN);
                CacheHelper.AddCache(key, proModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(proModel);
            }
        }
コード例 #3
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, ProductTemplateLibraryModel proModel)
        {
            return(proDAL.InsertInfo(trans, proModel));
        }