public static bool CompareExRateIfEqual(ExchangeRate ExRate, int currencyFromId, int currencyToId, int exchangeRateTypeId) { if (ExRate.CurrencyFromId == currencyFromId && ExRate.CurrencyToId == currencyToId && ExRate.ExchangeRateTypeId == exchangeRateTypeId) { return true; } else { return false; } }
public static ExchangeRate CreateExchangeRate(int currencyFromId, int currencyToId, decimal rate, DateTime date, int exchangeRateTypeId) { ExchangeRate newExchangeRate = new ExchangeRate(); newExchangeRate.CurrencyFromId = currencyFromId; newExchangeRate.CurrencyToId = currencyToId; newExchangeRate.Rate = rate; newExchangeRate.IsActive = true; newExchangeRate.Date = date.Date; newExchangeRate.ExchangeRateTypeId = exchangeRateTypeId; ObjectContext.ExchangeRates.AddObject(newExchangeRate); return newExchangeRate; }