Beispiel #1
0
        private void DeleteExecute(object obj)
        {
            var deletionWasSuccessful = _patientDataService.DeletePatient(SelectedPatient.Model);

            if (deletionWasSuccessful)
            {
                Messenger.Default.Send(new PatientDeleteMessage(SelectedPatient));
            }
        }
        private void DeleteSelectedPatient(PatientToBeDeleted patientToBeDeleted)
        {
            //AllPatients.Remove(patientToBeDeleted.PatientToBeDeletedProperty);
            _patientDataService.DeletePatient(patientToBeDeleted.PatientToBeDeletedProperty);
            _dialogService.ClosePatientsDetailDialog();
            var allPatients       = _patientDataService.GetAllPatients();
            var patientViewModels = allPatients.Select(x => PatientViewModel.FromModel(x));

            AllPatients.Clear();
            foreach (var patient in patientViewModels)
            {
                AllPatients.Add(patient);
            }
        }