コード例 #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, FloorProductCategoryModel floModel, int FloorProductCategoryId)
        {
            string key = "Cache_FloorProductCategory_Model_" + FloorProductCategoryId;

            CacheHelper.RemoveCache(key);
            return(floDAL.UpdateInfo(trans, floModel, FloorProductCategoryId));
        }
コード例 #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public FloorProductCategoryModel GetCacheInfo(SqlTransaction trans, int FloorProductCategoryId)
        {
            string key   = "Cache_FloorProductCategory_Model_" + FloorProductCategoryId;
            object value = CacheHelper.GetCache(key);

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