예제 #1
0
        /// <summary>
        /// Saves updated Dozent to database
        /// </summary>
        private void SaveDozentExecute()
        {
            bool DozentExists = _dozentDB.DozentExists(CurrentDozent);

            if (DozentExists)
            {
                var createDuplicate = MessageBox.Show("Dozent existiert bereits. Trotzdem speichern?", "Bestätigung", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (createDuplicate == MessageBoxResult.Yes)
                {
                    Dozent updatedDozent = _dozentDB.UpdateDozent(CurrentDozent);
                    SelectedDozent = updatedDozent;
                }
                else
                {
                    SelectedDozent.CopyTo(CurrentDozent);
                }
            }
            else
            {
                Dozent updatedDozent = _dozentDB.UpdateDozent(CurrentDozent);
                SelectedDozent = updatedDozent;
            }
        }
예제 #2
0
 /// <summary>
 /// Executes SaveDozent if true
 /// </summary>
 private void CancelDozentExecute()
 {
     SelectedDozent.CopyTo(CurrentDozent);
 }