Beispiel #1
0
        public MuscleGroup DeleteMuscle(int muscleGroupID)
        {
            MuscleGroup dbEntry = context.MuscleGroup
                                  .FirstOrDefault(p => p.muscleGroupID == muscleGroupID);

            if (dbEntry != null)
            {
                context.MuscleGroup.Remove(dbEntry);
                context.SaveChanges();
            }
            return(dbEntry);
        }
Beispiel #2
0
        public virtual void AddExercise(MuscleGroup muscleGroup, int quantity)
        {
            Regiment line = workoutCollection
                            .Where(m => m.MuscleGroup.muscleGroupID == muscleGroup.muscleGroupID)
                            .FirstOrDefault();

            if (line == null)
            {
                workoutCollection.Add(new Regiment
                {
                    MuscleGroup = muscleGroup,
                    Quantity    = quantity
                });
            }
            else
            {
                line.Quantity += quantity;
            }
        }
Beispiel #3
0
 public virtual void RemoveLine(MuscleGroup muscleGroup) =>
 workoutCollection.RemoveAll(l => l.MuscleGroup.muscleGroupID == muscleGroup.muscleGroupID);
Beispiel #4
0
 public override void RemoveLine(MuscleGroup muscleGroup)
 {
     base.RemoveLine(muscleGroup);
     Session.SetJson("Routine", this);
 }
Beispiel #5
0
 public override void AddExercise(MuscleGroup muscleGroup, int quantity)
 {
     base.AddExercise(muscleGroup, quantity);
     Session.SetJson("Routine", this);
 }