コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
        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);
                    }
                }
            }
        }