Ejemplo n.º 1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, ImageDescriptionModel imaModel, long SN)
        {
            string key = "Cache_ImageDescription_Model_" + SN;

            CacheHelper.RemoveCache(key);
            return(imaDAL.UpdateInfo(trans, imaModel, SN));
        }
Ejemplo n.º 2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public ImageDescriptionModel GetCacheInfo(SqlTransaction trans, long SN)
        {
            string key   = "Cache_ImageDescription_Model_" + SN;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((ImageDescriptionModel)value);
            }
            else
            {
                ImageDescriptionModel imaModel = imaDAL.GetInfo(trans, SN);
                CacheHelper.AddCache(key, imaModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(imaModel);
            }
        }
Ejemplo n.º 3
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, ImageDescriptionModel imaModel)
        {
            return(imaDAL.InsertInfo(trans, imaModel));
        }