/// <summary> /// 更新信息 /// </summary> public int UpdateInfo(SqlTransaction trans, DeliverModel delModel, int DeliverId) { string key = "Cache_Deliver_Model_" + DeliverId; CacheHelper.RemoveCache(key); return(delDAL.UpdateInfo(trans, delModel, DeliverId)); }
/// <summary> /// 从缓存读取信息 /// </summary> public DeliverModel GetCacheInfo(SqlTransaction trans, int DeliverId) { string key = "Cache_Deliver_Model_" + DeliverId; object value = CacheHelper.GetCache(key); if (value != null) { return((DeliverModel)value); } else { DeliverModel delModel = delDAL.GetInfo(trans, DeliverId); CacheHelper.AddCache(key, delModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null); return(delModel); } }
/// <summary> /// 插入信息 /// </summary> public int InsertInfo(SqlTransaction trans, DeliverModel delModel) { return(delDAL.InsertInfo(trans, delModel)); }