public static void PobierzKursyNBP(string tabela = "C") { var endDate = DateTime.Now; var startDate = endDate.AddDays(-10); IRestResponse response = PobierzKursyNBP(startDate, endDate, tabela); Console.WriteLine(response.Content); if (response.StatusCode == System.Net.HttpStatusCode.OK) { var res = JsonConvert.DeserializeObject <List <Notowanie> >(response.Content); WalutyHelper.WczytajKursy(res); } }
public static void PobierzKursyNBP(int rok, string tabela = "C") { for (int i = 1; i < 13; i++) { var startDate = new DateTime(rok, i, 1); var endDate = startDate.GetLastDayOfMonth(); IRestResponse response = PobierzKursyNBP(startDate, endDate, tabela); Console.WriteLine(response.Content); if (response.StatusCode == System.Net.HttpStatusCode.OK) { var res = JsonConvert.DeserializeObject <List <Notowanie> >(response.Content); WalutyHelper.WczytajKursy(res); } } }