void AddExchangeRates(string idColumnNameID1, string idColumnNameID2, bool local) { foreach (string ID in GetRelevantIDs(_mcExchangeRatesConfig, local, true)) { string country = ID.Substring(0, ID.IndexOf("_")); string validFor = ID.Substring(ID.IndexOf("_") + 1); string whereClause = idColumnNameID1 + " = '" + country + "' AND " + idColumnNameID2 + " = '" + validFor + "'"; ExchangeRatesConfig.ExchangeRatesRow dataRow = (ExchangeRatesConfig.ExchangeRatesRow)_vcRemote.ExchangeRates.Select(whereClause).First(); ExchangeRatesConfigFacade.CopyExchangeRatesFromAnotherConfig(_vcLocal, dataRow); } }
internal static double DefaultRate(ExchangeRatesConfig.ExchangeRatesRow row) { switch (row.Default) { case FIRSTSEMESTER: return(row.FirstSemester); case SECONDSEMESTER: return(row.SecondSemester); case JUNE30: return(row.June30); case YEARAVERAGE: return(row.YearAverage); default: return(-1); } }
internal ExchangeRate(ExchangeRatesConfig.ExchangeRatesRow rate) { Country = rate.Country; Default = rate.Default; ValidFor = rate.ValidFor; June30 = rate.June30; YearAverage = rate.YearAverage; FirstSemester = rate.FirstSemester; SecondSemester = rate.SecondSemester; }