internal bool LoadExchangeRatesConfig() { try { if (_exchangeRatesConfig == null) { _exchangeRatesConfig = new ExchangeRatesConfig(); if (File.Exists(_pathExchangeRatesConfig)) { using (StreamReader streamReader = new StreamReader(_pathExchangeRatesConfig, DefGeneral.DEFAULT_ENCODING)) _exchangeRatesConfig.ReadXml(streamReader); } _exchangeRatesConfig.AcceptChanges(); } return(true); } catch (Exception exception) { UserInfoHandler.ShowException(exception); return(false); } }
internal static ExchangeRatesConfig.ExchangeRatesRow CopyExchangeRatesFromAnotherConfig(ExchangeRatesConfig exchangeRatesConfig, ExchangeRatesConfig.ExchangeRatesRow originalExchangeRates) { ExchangeRatesConfig.ExchangeRatesRow exchangeRatesRow = exchangeRatesConfig.ExchangeRates.AddExchangeRatesRow( originalExchangeRates.Country, originalExchangeRates.June30, originalExchangeRates.YearAverage, originalExchangeRates.FirstSemester, originalExchangeRates.SecondSemester, originalExchangeRates.Default, originalExchangeRates.ValidFor); return(exchangeRatesRow); }