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 AttachSelectedFiles(string[] selectedFiles) { foreach (string path in selectedFiles) { Controllers.EmailAttachment file = new Controllers.EmailAttachment() { Path = path, FileName = System.IO.Path.GetFileName(path), FileSize = new System.IO.FileInfo(path).Length }; EmailContactControl emailControl = new EmailContactControl(file); emailControl.Margin = new Thickness(5, 0, 0, 0); emailControl.OnRemove += emailControl_OnRemoveAttachFile; spAttachedFiles.Children.Add(emailControl); } UpdateFileSizeStatus(); }
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); } }