private void UpdateConfiguration(ConfigurationKeyEnum pEnmKey, string pStrValue) { if (ExistsConfiguration(pEnmKey)) { if (HasChanges(pEnmKey, pStrValue)) { SystemFactory .GetConfigurationService() .SaveOrUpdate(SystemFactory.GetConfigurationService() .GetList() .Where(x => x.Key == pEnmKey) .AsEnumerable() .Select(y => { y.Value = pStrValue; return y; }) .FirstOrDefault()); } } else { SystemFactory.GetConfigurationService().SaveOrUpdate(new Configuration() { Key = pEnmKey, Value = pStrValue }); } }
public string GetByKey(ConfigurationKeyEnum pEnmKey) { return(mObjConfigurationDAO.GetEntitiesList().Where(x => x.Key == pEnmKey).Count() > 0 ? mObjConfigurationDAO.GetEntitiesList().FirstOrDefault(x => x.Key == pEnmKey).Value : string.Empty); }
private bool ExistsConfiguration(ConfigurationKeyEnum pEnmKey) { return SystemFactory.GetConfigurationService().GetList().Where(x => x.Key == pEnmKey).Count() > 0; }
private bool HasChanges(ConfigurationKeyEnum pEnmKey, string pStrValue) { return SystemFactory.GetConfigurationService().GetList().AsEnumerable().Where(x => x.Key == pEnmKey && !x.Value.Equals(pStrValue)).Count() > 0; }
private string GetConfiguration(ConfigurationKeyEnum pEnmKey) { return(mObjSystemFactory.GetConfigurationService().GetByKey(pEnmKey)); }