示例#1
0
 /// <summary>
 /// 更新配置信息
 /// </summary>
 /// <param name="model">The model.</param>
 /// <returns>true if XXXX, false otherwise.</returns>
 public static bool UpdateValue(ConfigModel model)
 {
     using (var dal = FactoryDispatcher.ConfigFactory())
     {
         return(dal.UpdateValue(model));
     }
 }
示例#2
0
        /// <summary>
        /// 更新配置信息
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        public static bool UpdateValue(ConfigModel model)
        {
            using (var dal = FactoryDispatcher.ConfigFactory())
            {
                bool flag = dal.UpdateValue(model);

                if (flag)
                {
                    WebCacheHelper.DeleteDepFile(cacheKey);
                }

                return(flag);
            }
        }
示例#3
0
        /// <summary>
        /// 获取配置数据
        /// </summary>
        /// <returns>List&lt;ConfigModel&gt;.</returns>
        public static List <ConfigModel> GetConfigList()
        {
            List <ConfigModel> lst = WebCacheHelper <List <ConfigModel> > .Get(cacheKey);

            if (lst == null)
            {
                using (var dal = FactoryDispatcher.ConfigFactory())
                {
                    lst = dal.List();
                    WebCacheHelper.Insert(cacheKey, lst, new System.Web.Caching.CacheDependency(WebCacheHelper.GetDepFile(cacheKey)));
                }
            }
            return(lst);
        }
示例#4
0
 /// <summary>
 /// 更新配置信息
 /// </summary>
 /// <param name="lst">The LST.</param>
 /// <returns>true if XXXX, false otherwise.</returns>
 public static bool UpdateValue(List <ConfigModel> lst)
 {
     using (var dal = FactoryDispatcher.ConfigFactory())
     {
         foreach (var item in lst)
         {
             dal.UpdateValue(new ConfigModel()
             {
                 Code   = item.Code,
                 Value  = item.Value,
                 Remark = item.Remark
             });
         }
         return(true);
     }
 }