private void ChangeNameInExchangeRatesConfig(CountryConfig.SystemRow systemRow, string oldSystemName)
        {
            ExchangeRatesConfigFacade excf = EM_AppContext.Instance.GetExchangeRatesConfigFacade(false); if (excf == null)
            {
                return;
            }
            bool anyChange = false;

            foreach (ExchangeRatesConfig.ExchangeRatesRow exchangeRate in
                     from er in excf.GetExchangeRates() where er.Country.ToLower() == systemRow.CountryRow.ShortName.ToLower() &&
                     ExchangeRate.ValidForToList(er.ValidFor).Contains(oldSystemName.ToLower()) select er)
            {
                if (!anyChange && UserInfoHandler.GetInfo("Do you want to update the system name in the global exchange rate table?" + Environment.NewLine + Environment.NewLine +
                                                          "Note that, if no exchange rate is found for a system name, the exchange rate is assumed to be 1.", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                exchangeRate.ValidFor = ExchangeRate.RemoveFromValidFor(exchangeRate.ValidFor, oldSystemName);
                exchangeRate.ValidFor = ExchangeRate.AddToValidFor(exchangeRate.ValidFor, systemRow.Name); anyChange = true;
            }
            if (anyChange)
            {
                excf.WriteXML();
            }
        }
 internal void RemoveSystems(string countryShortName, List <string> systemNames)
 {
     try
     {
         bool store = false; List <ExchangeRatesConfig.ExchangeRatesRow> delRates = new List <ExchangeRatesConfig.ExchangeRatesRow>();
         foreach (string systemName in systemNames)
         {
             foreach (ExchangeRatesConfig.ExchangeRatesRow exchangeRate in from er in GetExchangeRates(countryShortName)
                      where ExchangeRate.ValidForToList(er.ValidFor).Contains(systemName.ToLower())
                      select er)
             {
                 if (ExchangeRate.ValidForToList(exchangeRate.ValidFor).Count == 1)
                 {
                     delRates.Add(exchangeRate);
                 }
                 else
                 {
                     exchangeRate.ValidFor = ExchangeRate.RemoveFromValidFor(exchangeRate.ValidFor, systemName);
                 }
                 store = true; break;
             }
         }
         foreach (ExchangeRatesConfig.ExchangeRatesRow delRate in delRates)
         {
             delRate.Delete();
         }
         if (store)
         {
             WriteXML();
         }
     }
     catch (Exception exception)
     {
         UserInfoHandler.ShowException(exception, "A problem occured while adapting global exchange rates file. Please update manually if necessary.", false);
     }
 }