Beispiel #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, PatternComponentModel patModel, long ID)
        {
            string key = "Cache_PatternComponent_Model_" + ID;

            CacheHelper.RemoveCache(key);
            return(patDAL.UpdateInfo(trans, patModel, ID));
        }
Beispiel #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public PatternComponentModel GetCacheInfo(SqlTransaction trans, long ID)
        {
            string key   = "Cache_PatternComponent_Model_" + ID;
            object value = CacheHelper.GetCache(key);

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