private void SearchClick(object sender, RoutedEventArgs e) { string country = TextBoxCountry.Text; string region = TextBoxRegion.Text; string dateFrom = DatesRange.SelectedDates[0].ToString("yyyy-MM-dd"); string dateTo = DatesRange.SelectedDates[DatesRange.SelectedDates.Count - 1].ToString("yyyy-MM-dd"); var covidMyRS = Covid19.doCovidProcess(country, region, dateFrom, dateTo); var result = Covid19.buildStringTelegram(covidMyRS); TextBoxResult.Text = result; }
private void SaveClick(object sender, RoutedEventArgs e) { string country = TextBoxCountry.Text; string region = TextBoxRegion.Text; string dateFrom = DatesRange.SelectedDates[0].ToString("yyyy-MM-dd"); string dateTo = DatesRange.SelectedDates[DatesRange.SelectedDates.Count - 1].ToString("yyyy-MM-dd"); var covidMyRS = Covid19.doCovidProcess(country, region, dateFrom, dateTo); string covidCSV = Covid19.buildStringCSV(covidMyRS); File.WriteAllText("covidTable.csv", covidCSV, Encoding.UTF8); TextBoxResult.Text = "El archivo se ha guardado"; }