Exemplo n.º 1
0
        private static void ExitAndSave(CancelEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Data er muligvis ikke blevet gemt. \n Vil du gemme inden programmet lukkes?", "Gem og afslut", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                Filemanagement.SaveToDatabase();
                e.Cancel = false;
                Application.Current.Shutdown();
            }
            else if (result == MessageBoxResult.No)
            {
                Application.Current.Shutdown();
            }
            else if (result == MessageBoxResult.Cancel || result == MessageBoxResult.None)
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 2
0
 //Admits patient to the ward. Also places patient in a room using the AssignPatientToDRoom method
 public void AdmitPatient(Patient patient)
 {
     AssignPatientToDRoom(patient);
     this.CurrentPatients.Add(patient);
     Filemanagement.SaveToDatabase(patient);
 }