Пример #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, SMSLabelModel smsModel, int SMSLabelId)
        {
            string key = "Cache_SMSLabel_Model_" + SMSLabelId;

            CacheHelper.RemoveCache(key);
            return(smsDAL.UpdateInfo(trans, smsModel, SMSLabelId));
        }
Пример #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public SMSLabelModel GetCacheInfo(SqlTransaction trans, int SMSLabelId)
        {
            string key   = "Cache_SMSLabel_Model_" + SMSLabelId;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((SMSLabelModel)value);
            }
            else
            {
                SMSLabelModel smsModel = smsDAL.GetInfo(trans, SMSLabelId);
                CacheHelper.AddCache(key, smsModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(smsModel);
            }
        }
Пример #3
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, SMSLabelModel smsModel)
        {
            return(smsDAL.InsertInfo(trans, smsModel));
        }