Ejemplo n.º 1
0
        public long AddExerciseToProgram(int programId, AddExerciseToProgramInputModel model)
        {
            try
            {
                var exercise = new ExerciseProgramExercise
                {
                    ExerciseProgram_Fk = programId,
                    Exercise_Fk        = model.ExerciseId,
                    ExerciseDay        = 0,
                    ExerciseSets       = model.Sets,
                    ExerciseRepitions  = 0,
                    StartDate          = DateTime.Now,
                    CreatedBy          = Environment.UserName,
                    CreateDate         = DateTime.Now
                };

                return(_exerciseProgramExerciseRepository.Insert(exercise));
            }
            catch (Exception e)
            {
                throw new Exception();
            }
        }
Ejemplo n.º 2
0
        public HttpStatusCode AddExerciseToProgram([FromUri] int programId, [FromBody] AddExerciseToProgramInputModel model)
        {
            _exerciseService.AddExerciseToProgram(programId, model);

            return(HttpStatusCode.Created);
        }
 public void AddExerciseToProgram(AddExerciseToProgramInputModel model)
 {
     _exerciseService.AddExerciseToProgram(model.ProgramId, model);
 }