Beispiel #1
0
 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
         });
     }
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 private bool ExistsConfiguration(ConfigurationKeyEnum pEnmKey)
 {
     return SystemFactory.GetConfigurationService().GetList().Where(x => x.Key == pEnmKey).Count() > 0;
 }
Beispiel #4
0
 private bool HasChanges(ConfigurationKeyEnum pEnmKey, string pStrValue)
 {
     return SystemFactory.GetConfigurationService().GetList().AsEnumerable().Where(x => x.Key == pEnmKey && !x.Value.Equals(pStrValue)).Count() > 0;
 }
Beispiel #5
0
 private string GetConfiguration(ConfigurationKeyEnum pEnmKey)
 {
     return(mObjSystemFactory.GetConfigurationService().GetByKey(pEnmKey));
 }