示例#1
0
        /// <summary>
        /// Changes the labels content according to the selection made
        /// </summary>
        private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int selectedResultId = Convert.ToInt32(((ComboBoxItem)comboBoxResults.SelectedItem).Tag.ToString());

            try
            {
                Results selectedResult = _resultsService.FindById(selectedResultId);
                dateHistoryLabel.Content       = selectedResult.ResultDate;
                symptomsHistoryLabel.Content   = selectedResult.Symptoms;
                diagnosisHistoryabel.Content   = selectedResult.Diagnosis;
                medicationHistoryLabel.Content = selectedResult.Medication;
            }
            catch (Exception ee)
            {
                MessageBox.Show("Something went wrong !\n" + ee.Data.ToString());
            }
        }