private void EditPatientBtn_Click(object sender, RoutedEventArgs e)
        {
            if (PatientsListBox.SelectedItem == null)
            {
                return;
            }

            Models.Patient SelectedPatient = PatientsListBox.SelectedItem as Models.Patient;
            Models.Patient PatientCopy     = new Models.Patient();
            PatientCopy.SetTo(SelectedPatient);

            PatientDetails DetailsWindow = new PatientDetails();

            DetailsWindow.Title   = "Modifica paziente";
            DetailsWindow.Owner   = App.Current.MainWindow;
            DetailsWindow.Patient = PatientCopy;
            DetailsWindow.ShowDialog();

            if (DetailsWindow.Result == true)
            {
                PatientCopy.SSN = PatientCopy.SSN.ToUpper();
                SelectedPatient.SetTo(PatientCopy);
                Database.SaveChanges();
                RefreshPatientsList();
            }
        }
        private void NewPatientBtn_Click(object sender, RoutedEventArgs e)
        {
            PatientDetails DetailsWindow = new PatientDetails();

            DetailsWindow.Title = "Nuovo paziente";
            DetailsWindow.Owner = App.Current.MainWindow;
            Models.Patient NewPatient = new Models.Patient();
            DetailsWindow.Patient = NewPatient;
            DetailsWindow.ShowDialog();

            if (DetailsWindow.Result == true)
            {
                NewPatient.SSN = NewPatient.SSN.ToUpper();
                Database.Patients.Add(NewPatient);
                Database.SaveChanges();
                RefreshPatientsList();
            }
        }
        private void NewPatientBtn_Click(object sender, RoutedEventArgs e)
        {
            PatientDetails DetailsWindow = new PatientDetails();
            DetailsWindow.Title = "Nuovo paziente";
            DetailsWindow.Owner = App.Current.MainWindow;
            Models.Patient NewPatient = new Models.Patient();
            DetailsWindow.Patient = NewPatient;
            DetailsWindow.ShowDialog();

            if (DetailsWindow.Result == true)
            {
                NewPatient.SSN = NewPatient.SSN.ToUpper();
                Database.Patients.Add(NewPatient);
                Database.SaveChanges();
                RefreshPatientsList();
            }
        }
        private void EditPatientBtn_Click(object sender, RoutedEventArgs e)
        {
            if (PatientsListBox.SelectedItem == null)
            {
                return;
            }

            Models.Patient SelectedPatient = PatientsListBox.SelectedItem as Models.Patient;
            Models.Patient PatientCopy = new Models.Patient();
            PatientCopy.SetTo(SelectedPatient);

            PatientDetails DetailsWindow = new PatientDetails();
            DetailsWindow.Title = "Modifica paziente";
            DetailsWindow.Owner = App.Current.MainWindow;
            DetailsWindow.Patient = PatientCopy;
            DetailsWindow.ShowDialog();

            if (DetailsWindow.Result == true)
            {
                PatientCopy.SSN = PatientCopy.SSN.ToUpper();
                SelectedPatient.SetTo(PatientCopy);
                Database.SaveChanges();
                RefreshPatientsList();
            }
        }