Example #1
0
        private Round ConvertRoundDTO(RoundDTO roundDTO)
        {
            List <Set> sets = new List <Set>();

            foreach (var setDTO in roundDTO.GetSets())
            {
                sets.Add(ConvertSetDTO(setDTO));
            }
            IExerciseDAL dal   = ExerciseDALFactory.GetExerciseDAL();
            Round        round = new Round(
                ConvertExerciseDTO(dal.GetExerciseDTO(roundDTO.ExerciseID.ToString())),
                sets,
                roundDTO.RoundID,
                roundDTO.TrainingID,
                roundDTO.ExerciseID
                );

            return(round);
        }
Example #2
0
        private Round ConvertRoundDTO(RoundDTO roundDTO)
        {
            List <Set> sets = new List <Set>();

            foreach (var setDTO in roundDTO.GetSets())
            {
                sets.Add(ConvertSetDTO(setDTO));
            }
            User  user  = new User();
            Round round = new Round(
                ConvertExerciseDTO(user.GetExercise(roundDTO.ExerciseID.ToString())),
                sets,
                roundDTO.RoundID,
                roundDTO.TrainingID,
                roundDTO.ExerciseID
                );

            return(round);
        }
Example #3
0
        private RoundViewModel ConvertRoundDTO(RoundDTO roundDTO)
        {
            List <SetViewModel> setViewModels = new List <SetViewModel>();

            foreach (var setDTO in roundDTO.GetSets())
            {
                setViewModels.Add(ConvertSetDTO(setDTO));
            }
            ;
            RoundViewModel roundViewModel = new RoundViewModel
            {
                Exercise   = ConvertExerciseDTOToVM(roundDTO.Exercise),
                ExerciseID = roundDTO.ExerciseID,
                RoundID    = roundDTO.RoundID,
                TrainingID = roundDTO.TrainingID,
                Sets       = setViewModels
            };

            return(roundViewModel);
        }