internal void DeleteTrainingDay(TrainingDayKey key) { var trainingDayScenario = new TrainingDayScenario() { ManageExercise = true }; var trainingDay = GetTrainingDay(key, trainingDayScenario); if (trainingDay != null) { _trainingDayModule.Delete(trainingDay); if (trainingDay.TrainingExercises != null) { var trainingExerciseService = new TrainingExerciseService(DbContext); foreach (var trainingExercise in trainingDay.TrainingExercises) { trainingExerciseService.DeleteTrainingExercise(trainingExercise); } } } }
public void DeleteTrainingDay(TrainingDayKey key) { var trainingDayScenario = new TrainingDayScenario() { ManageExercise = true }; var trainingDay = GetTrainingDay(key, trainingDayScenario); if (trainingDay != null) { _trainingDayModule.Delete(trainingDay); SynchroManager.TrainingDayChange(DbContext, trainingDay, true); if (trainingDay.TrainingExercises != null) { foreach (var trainingExercise in trainingDay.TrainingExercises) { _trainingExercisesService.DeleteTrainingExercise(trainingExercise); } } } }