Esempio n. 1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, ClassPropertyModel claModel, int ClassPropertyId)
        {
            string key = "Cache_ClassProperty_Model_" + ClassPropertyId;

            CacheHelper.RemoveCache(key);
            return(claDAL.UpdateInfo(trans, claModel, ClassPropertyId));
        }
Esempio n. 2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public ClassPropertyModel GetCacheInfo(SqlTransaction trans, int ClassPropertyId)
        {
            string key   = "Cache_ClassProperty_Model_" + ClassPropertyId;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((ClassPropertyModel)value);
            }
            else
            {
                ClassPropertyModel claModel = claDAL.GetInfo(trans, ClassPropertyId);
                CacheHelper.AddCache(key, claModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(claModel);
            }
        }
Esempio n. 3
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, ClassPropertyModel claModel)
        {
            return(claDAL.InsertInfo(trans, claModel));
        }