Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            CoronavirusData data = new CoronavirusData();

            Console.WriteLine("Confirmed: " + data.LatestConfirmed());
            Console.WriteLine("Recovered: " + data.LatestRecovered());
            Console.WriteLine("Deaths: " + data.LatestDeaths());


            // Fetches the latest data of a country code.
            string country_code = "DK";

            Console.WriteLine("Denmark Confirmed: " + data.FromCountryCodeConfirmed(country_code));
            Console.WriteLine("Denmark Recovered: " + data.FromCountryCodeRecovered(country_code));
            Console.WriteLine("Denmark Deaths: " + data.FromCountryCodeDeaths(country_code));

            // Fetches the latest data of a country Name.
            string country_name = "China";

            Console.WriteLine("China Confirmed: " + data.FromCountryNameConfirmed(country_name));
            Console.WriteLine("China Recovered: " + data.FromCountryNameRecovered(country_name));
            Console.WriteLine("China Deaths: " + data.FromCountryNameDeaths(country_name));
            Console.ReadLine();

            //Fetches the data of the Country/province associated with the ID
            Console.WriteLine("Name of the Faroe Islands: " + data.FromIDProvince("92"));
            Console.WriteLine("Name of the country of the Faroe Islands: " + data.FromIDCountry("92"));

            Console.WriteLine("Denmark Latitude: " + data.FromIDLatitude("94"));
            Console.WriteLine("Denmark Longtitude: " + data.FromIDLongitude("94"));


            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            CoronavirusData data = new CoronavirusData();

            Console.WriteLine("Confirmed: " + data.LatestConfirmed());
            Console.WriteLine("Recovered: " + data.LatestRecovered());
            Console.WriteLine("Deaths: " + data.LatestDeaths());


            Console.WriteLine("Denmark Confirmed: " + data.FromCountryConfirmed("DK"));
            Console.WriteLine("Denmark Recovered: " + data.FromCountryRecovered("DK"));
            Console.WriteLine("Denmark Deaths: " + data.FromCountryDeaths("DK"));

            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            CoronavirusData data = new CoronavirusData();

            Console.WriteLine("Confirmed: " + data.LatestConfirmed());
            Console.WriteLine("Recovered: " + data.LatestRecovered());
            Console.WriteLine("Deaths: " + data.LatestDeaths());


            // Fetches the latest data of a country code.
            string country_code = "DK";

            Console.WriteLine("Denmark Confirmed: " + data.FromCountryCodeConfirmed(country_code));
            Console.WriteLine("Denmark Recovered: " + data.FromCountryCodeRecovered(country_code));
            Console.WriteLine("Denmark Deaths: " + data.FromCountryCodeDeaths(country_code));
            Console.WriteLine("Denmark population: " + data.FromCountryCodePopulation(country_code));

            // Fetches data of a country Name.
            string country_name = "China";

            Console.WriteLine("China Confirmed: " + data.FromCountryNameConfirmed(country_name));
            Console.WriteLine("China Recovered: " + data.FromCountryNameRecovered(country_name));
            Console.WriteLine("China Deaths: " + data.FromCountryNameDeaths(country_name));
            Console.WriteLine("China population: " + data.FromCountryNamePopulation(country_name));

            //Fetches the data of the Country/province associated with the ID
            Console.WriteLine("Name of the Faroe Islands: " + data.FromIDProvince("92"));
            Console.WriteLine("Name of the country of the Faroe Islands: " + data.FromIDCountry("92"));
            Console.WriteLine("Denmark Latitude: " + data.FromIDLatitude("94"));
            Console.WriteLine("Denmark Longtitude: " + data.FromIDLongitude("94"));
            Console.WriteLine("Denmark Population: " + data.FromIDPopulation("94"));

            // Fetches lists of data, if not defined the default source will be jhu
            Console.WriteLine(data.GetCountryList());
            Console.WriteLine(data.GetPopulationList());
            Console.WriteLine(data.GetProvinceList());
            Console.WriteLine(data.GetCountyList("csbs"));  //The source is set to csbs


            Console.ReadLine();
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            CoronavirusData data = new CoronavirusData();

            txtResults.Text = "";

            txtResults.Text += DateTime.Now.ToString();
            txtResults.Text += "\r\n";
            txtResults.Text += "\r\n";

            txtResults.Text += "Global";
            txtResults.Text += "\r\n";
            txtResults.Text += "~~~~";
            txtResults.Text += "\r\n";
            txtResults.Text += "Confirmed: ";
            txtResults.Text += data.LatestConfirmed() + "\r\n";

            txtResults.Text += "Recovered: ";
            txtResults.Text += data.LatestRecovered() + "\r\n";

            txtResults.Text += "Deaths: ";
            txtResults.Text += data.LatestDeaths() + "\r\n";
            txtResults.Text += "\r\n";

            txtResults.Text += "Country - " + cbcountry.SelectedValue.ToString();
            txtResults.Text += "\r\n";
            txtResults.Text += "~~~~~~~~~";
            txtResults.Text += "\r\n";

            txtResults.Text += cbcountry.SelectedValue.ToString();
            txtResults.Text += " Confirmed: ";
            txtResults.Text += data.FromCountryConfirmed(cbcountry.SelectedValue.ToString()) + "\r\n";

            txtResults.Text += cbcountry.SelectedValue.ToString();
            txtResults.Text += " Recovered: ";
            txtResults.Text += data.FromCountryRecovered(cbcountry.SelectedValue.ToString()) + "\r\n";

            txtResults.Text += cbcountry.SelectedValue.ToString();
            txtResults.Text += " Deaths: ";
            txtResults.Text += data.FromCountryDeaths(cbcountry.SelectedValue.ToString()) + "\r\n";
        }
Ejemplo n.º 5
0
 public CovidForm()
 {
     InitializeComponent();
     covid_data = new CoronavirusData();
 }