private void VisitsList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { //MessageBoxes.ShowNotImplemented(); if (VisitsList.SelectedItem == null) { return; } Visit v = VisitsList.SelectedItem as Visit; if (v.Patient.PESELNumber == CurrentPatient.PESELNumber) { try { if (AppLogic.DeleteVisit(v.DT, v.Doctor, v.Patient)) { MessageBoxes.ShowSuccess(); //v.Patient = null; list.Remove(v); } else { MessageBoxes.ShowFail(); } } catch (Exception ex) { MessageBoxes.ShowUnknownError(ex); } } }
private void AddNewPatienPatientButton_Click(object sender, RoutedEventArgs e) { try { if (AppLogic.CreatePatient(CurrentPatient)) { MessageBoxes.ShowSuccess(); AppointmentsGrid.Visibility = Visibility.Visible; PatientDataStackPanel.Visibility = Visibility.Visible; NewPatientStackPanel.Visibility = Visibility.Hidden; i.Visibility = Visibility.Hidden; EnableTextBoxes(false); PeselTextBox.IsEnabled = false; } else { MessageBoxes.ShowFail(); } } catch (NotImplementedException) { MessageBoxes.ShowNotImplemented(); } catch (Exception ex) { MessageBoxes.ShowUnknownError(ex); } }
private void DeletePatientButton_Click(object sender, RoutedEventArgs e) { try { if (AppLogic.DeletePatient(CurrentPatient)) { MessageBoxes.ShowSuccess(); ReturnButton_Click(null, null); } else { MessageBoxes.ShowFail(); } } catch (Exception ex) { MessageBoxes.ShowUnknownError(ex); } }
private void UpdatePatienPatientButton_Click(object sender, RoutedEventArgs e) { try { if (AppLogic.UpdatePatient(CurrentPatient)) { MessageBoxes.ShowSuccess(); EnableTextBoxes(false); CurrentPatient.NotifyFullName(); } else { MessageBoxes.ShowFail(); } } catch (NotImplementedException) { MessageBoxes.ShowNotImplemented(); } catch (Exception ex) { MessageBoxes.ShowUnknownError(ex); } }
private void AppliementListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Visit v = VisitsListView.SelectedItem as Visit; if (v.Patient == null) { try { if (AppLogic.AddVisit(v.DT, patient, v.Doctor)) { MessageBoxes.ShowSuccess(); v.Patient = patient; } else { MessageBoxes.ShowFail(); } } catch (Exception ex) { MessageBoxes.ShowUnknownError(ex); } } }