예제 #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, DistributorServiceSettingModel disModel, long SN)
        {
            string key = "Cache_DistributorServiceSetting_Model_" + SN;

            CacheHelper.RemoveCache(key);
            return(disDAL.UpdateInfo(trans, disModel, SN));
        }
예제 #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public DistributorServiceSettingModel GetCacheInfo(SqlTransaction trans, long SN)
        {
            string key   = "Cache_DistributorServiceSetting_Model_" + SN;
            object value = CacheHelper.GetCache(key);

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