Beispiel #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, ProductReferenceAIPSModel proRefModel, long SN)
        {
            string key = "Cache_ProductReferenceAIPS_Model_" + SN;

            CacheHelper.RemoveCache(key);
            return(proRefDAL.UpdateInfo(trans, proRefModel, SN));
        }
Beispiel #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public ProductReferenceAIPSModel GetCacheInfo(SqlTransaction trans, long SN)
        {
            string key   = "Cache_ProductReferenceAIPS_Model_" + SN;
            object value = CacheHelper.GetCache(key);

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