Пример #1
0
        private void SaveWorkoutExercise()
        {
            WorkoutExerciseAdd.ExerciseId = ExerciseAdd.Id;
            WorkoutExerciseAdd.WorkoutId  = WorkoutAdd.Id;
            if (WorkoutExerciseAdd.Id == 0)
            {
                new WorkoutExerciseRepository().Save(WorkoutExerciseAdd);
                WorkoutExerciseList.Add(WorkoutExerciseAdd);
            }
            else
            {
                new WorkoutExerciseRepository().Update(WorkoutExerciseAdd);
                WorkoutExerciseList = new ObservableCollection <WorkoutExercise>(new WorkoutExerciseRepository().GetAll());
                OnPropertyChanged("WorkoutExerciseList");
            }

            WorkoutExerciseAdd = new WorkoutExercise();
            OnPropertyChanged("WorkoutExerciseAdd");
        }
Пример #2
0
 private void DeleteWorkoutExercise(WorkoutExercise workoutExercise)
 {
     new WorkoutExerciseRepository().Delete(workoutExercise);
     WorkoutExerciseList.Remove(workoutExercise);
 }