Example #1
0
        public bool DeleteSystemConfig(Enums.SystemSettingIdEnum settingId, Enums.SystemSettingKeyEnum settingKey)
        {
            try
            {
                var rowAmount = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), SqlConst.SP_DELETESYSTEMSETTING, (int)settingId);
                if (rowAmount > 0)
                {
                    DataCacheManager.DataCacheManager.GetCacheManagerInstance().DeleteSystemSettingsCache(settingKey.ToString());
                }

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Example #2
0
        public bool UpdateOrAddSystemConfig(T obj, Enums.SystemSettingIdEnum settingId, Enums.SystemSettingKeyEnum settingKey)
        {
            try
            {
                var configXml = SerializeUtility <T> .XmlSerialize(obj);

                var rowAmount          = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), SqlConst.SP_ADDUPDATESYSTEMSETTING, new object[] { (int)settingId, settingKey.ToString(), configXml });
                var updateCacheSuccess = false;
                if (rowAmount > 0)
                {
                    updateCacheSuccess = DataCacheManager.DataCacheManager.GetCacheManagerInstance().UpdateSystemSettingsCache(settingKey.ToString(), configXml);
                }

                return(updateCacheSuccess);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }