private void DeleteClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var id = int.Parse(((Button)sender).CommandParameter.ToString());
                var medicationDataRepository = new MedicationDataRepository(EHealthCareDesktopApp.Properties.Settings.Default.UniqueIdentifier);
                medicationDataRepository.DeleteMedication(EHealthCareDesktopApp.Properties.Settings.Default.PatientID, id);

                LoadMedications();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 public List<MedicationViewModel> GetViewModel()
 {
     var medicationDataRepository = new MedicationDataRepository(Guid.Parse(uniqueGuid));
     var medications = medicationDataRepository.GetAllMedicationData(this.patientId);
     foreach (var medication in medications)
     {
         medicationViewModelList.Add(new MedicationViewModel
         {
             MedicationName = medication.MedicationName,
             StartDate = medication.StartDate.ToShortDateString(),
             EndDate = medication.EndDate == null ? "" : medication.EndDate.ToString(),
             HowTaken = medication.HowTaken,
             Dose = medication.DoseText + " " + medication.DoseUnit,
             Strength = medication.StrengthText + " " + medication.StrengthUnit,
             ReasonForTaking = medication.ReasonForTaking
         });
     }
     return medicationViewModelList;
 }