private ExchangeRate GetExchangeRateAll(DateTime date) { ExchangeRate newRateList = new ExchangeRate(); XDocument rates = DovizIslemleri.TumKurlar(date); if (rates != null) { if (rates.Element("Tarih_Date") != null) { if (rates.Element("Tarih_Date").Attribute("Date") != null) { string dateValue = rates.Element("Tarih_Date").Attribute("Date").Value; try { int month = dateValue.Substring(0, 2).To <int>(); int day = dateValue.Substring(3, 2).To <int>(); int year = dateValue.Substring(6, 4).To <int>(); DateTime newDate = new DateTime(year, month, day); newRateList.LastUpdate = newDate; } catch (Exception) { } } } newRateList.ExchangeRateItems = GetRateItemsFromXml(rates.Descendants("Currency").AsEnumerable()); } return(newRateList); }
internal string GetExchangeRateValue(DateTime date, ExchangeRateCurrencyCodes code, ExchangeOperations operation) { return(DovizIslemleri.KurDegerAl(DateTime.Today, code, operation)); }