private void btnFindEmail_Click(object sender, System.Windows.RoutedEventArgs e) { List<Model.Patient> selectedPatients = new List<Model.Patient>(); new FindPatientEmailModal(selectedPatients).ShowDialog(); foreach (Model.Patient patient in selectedPatients) { if (string.IsNullOrEmpty(patient.Email) == false) { Controllers.EmailContact emailToAdd = new Controllers.EmailContact() { IsValid = true, IsPatient = true, Email = patient.Email, FullName = patient.FirstName + " " + patient.LastName }; EmailContactControl emailControl = new EmailContactControl(emailToAdd); emailControl.Margin = new Thickness(5, 0, 0, 0); emailControl.OnRemove += emailControl_OnRemoveEmail; spEmailTo.Children.Add(emailControl); } } }
private void btnAddEmail_Click(object sender, System.Windows.RoutedEventArgs e) { Controllers.EmailContact emailToAdd = new Controllers.EmailContact(); new AddEmailModal(emailToAdd).ShowDialog(); if (emailToAdd.IsValid) { EmailContactControl emailControl = new EmailContactControl(emailToAdd); emailControl.Margin = new Thickness(5, 0, 0, 0); emailControl.OnRemove += emailControl_OnRemoveEmail; spEmailTo.Children.Add(emailControl); } }