private void moldRiskButton_Click(object sender, RoutedEventArgs e)
        {
            bool indoorTable = indoorRadioButton.IsChecked.Value;

            if (indoorTable)
            {
                dataGrid.ItemsSource = SearchDatabase.ChanceOfMold <Indoor>();
            }
            else
            {
                dataGrid.ItemsSource = SearchDatabase.ChanceOfMold <Outdoor>();
            }
        }
        private void medianTemperature_Click(object sender, RoutedEventArgs e)
        {
            bool indoorTable = indoorRadioButton.IsChecked.Value;

            if (indoorTable)
            {
                dataGrid.ItemsSource = SearchDatabase.GetAverageTemperatures <Indoor>();
            }
            else
            {
                dataGrid.ItemsSource = SearchDatabase.GetAverageTemperatures <Outdoor>();
            }
        }
        private void winterStartButton_Click(object sender, RoutedEventArgs e)
        {
            DateTime?winterStartDate = SearchDatabase.FindWinterStart();

            if (!winterStartDate.HasValue)
            {
                MessageBox.Show("Could not find the start of Winter");
            }
            else
            {
                string winterStart = winterStartDate.Value.ToString("d");
                MessageBox.Show($"Winter started at: {winterStart}");
            }
        }
        private void autumnStart_Click(object sender, RoutedEventArgs e)
        {
            DateTime?autumnStartDate = SearchDatabase.FindAutumnStart();

            if (!autumnStartDate.HasValue)
            {
                MessageBox.Show("Could not find the start of Autumn");
            }
            else
            {
                string autumnStart = autumnStartDate.Value.ToString("d");
                MessageBox.Show($"Autumn started at: {autumnStart}");
            }
        }
 private void medianHumidity_Click(object sender, RoutedEventArgs e)
 {
     using (var context = new TemperatureDBContext())
     {
         bool indoorTable = indoorRadioButton.IsChecked.Value;
         if (indoorTable)
         {
             dataGrid.ItemsSource = SearchDatabase.GetAverageHumidities <Indoor>();
         }
         else
         {
             dataGrid.ItemsSource = SearchDatabase.GetAverageHumidities <Outdoor>();
         }
     }
 }
        private void datePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            DateTime selectedDate = datePicker.SelectedDate.Value;
            bool     indoorTable  = indoorRadioButton.IsChecked.Value;
            double   temperatureForSelectedDate;
            string   location           = "";
            string   selectedDateString = selectedDate.Date.ToString("d");


            switch (indoorTable)
            {
            case true:
                temperatureForSelectedDate = SearchDatabase.AverageTemperatureSpecifiedDate <Indoor>(selectedDate);
                location = "indoors";
                break;

            case false:
                temperatureForSelectedDate = SearchDatabase.AverageTemperatureSpecifiedDate <Outdoor>(selectedDate);
                location = "outdoors";
                break;
            }
            MessageBox.Show($"At {selectedDateString} it was an average temperature of {temperatureForSelectedDate} {location}.");
        }