Ejemplo n.º 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);
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 3
0
 public virtual void RemoveLine(MuscleGroup muscleGroup) =>
 workoutCollection.RemoveAll(l => l.MuscleGroup.muscleGroupID == muscleGroup.muscleGroupID);
Ejemplo n.º 4
0
 public override void RemoveLine(MuscleGroup muscleGroup)
 {
     base.RemoveLine(muscleGroup);
     Session.SetJson("Routine", this);
 }
Ejemplo n.º 5
0
 public override void AddExercise(MuscleGroup muscleGroup, int quantity)
 {
     base.AddExercise(muscleGroup, quantity);
     Session.SetJson("Routine", this);
 }