Exemple #1
0
        /// <summary>
        /// Saves the specified named connection element.
        /// </summary>
        /// <param name="namedConnectionElement">The named connection element.</param>
        public void Save(NamedConnectionElement namedConnectionElement)
        {
            var current = _monahrqConfigurationSettings.NamedConnections.OfType <NamedConnectionElement>().FirstOrDefault(elem => elem.Name == namedConnectionElement.Name);

            if (current != null)
            {
                _monahrqConfigurationSettings.NamedConnections.Remove(current);
            }
            _monahrqConfigurationSettings.NamedConnections.Add(namedConnectionElement);
            MonahrqConfiguration.Save(_monahrqConfigurationSettings);
        }
Exemple #2
0
        /// <summary>
        /// Synchronizes the default states from configuration.
        /// </summary>
        private void SyncDefaultStatesFromConfig()
        {
            _defaultStates = new StringCollection();
            foreach (var stateProxy in DefaultStatesProxy.OfType <StateElement>().ToList())
            {
                _defaultStates.Add(stateProxy.StateName);
            }
            //InitLazySelectedStates();

            MonahrqConfiguration.ConfigDebugLog("HospitalRegion.SyncDefaultStatesFromConfig", String.Format("States: {0}", DefaultStateCount));
        }
Exemple #3
0
        /// <summary>
        /// Synchronizes the default states to configuration.
        /// </summary>
        internal void SyncDefaultStatesToConfig()
        {
            MonahrqConfiguration.ConfigDebugLog("HospitalRegion.SyncDefaultStatesToConfig", String.Format("States: {0}", DefaultStateCount));

            if (_defaultStates == null)
            {
                return;
            }

            DefaultStatesProxy = new StatesCollectionElement();
            foreach (var state in _defaultStates)
            {
                DefaultStatesProxy.Add(new StateElement {
                    StateName = state
                });
            }
        }
Exemple #4
0
 /// <summary>
 /// Saves the specified monahrq settings instance.
 /// </summary>
 /// <param name="settings">The settings.</param>
 public void Save(IMonahrqSettings settings)
 {
     MonahrqConfiguration.Save(settings);
     ForceRefresh();
 }