public ScheduledWorkoutsController(ScheduledWorkoutRepository scheduledWorkoutRepository, WorkoutRepository workoutRepository, UserRepository userRepository, IMapper mapper)
 {
     this.scheduledWorkoutRepository = scheduledWorkoutRepository;
     this.workoutRepository          = workoutRepository;
     this.userRepository             = userRepository;
     this.mapper = mapper;
 }
Пример #2
0
 public PostgreSQLRepositoryTests()
 {
     _appConfiguration  = new AppConfiguration();
     _context           = new MyContext(_appConfiguration.PostgreSQL);
     _repository        = new DbRepository(_context);
     _secRepository     = new UsersMealsRepository(_context);
     _workoutRepository = new WorkoutRepository(_context);
     _context.Database.EnsureCreated();
 }
Пример #3
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context     = context;
     Workouts     = new WorkoutRepository(context);
     Exercises    = new ExerciseRepository(context);
     Cardios      = new CardioRepository(context);
     Achievements = new AchievementsRepository(context);
     Users        = new ApplicationUserRepository(context);
     DailyMenus   = new DailyMenuRepository(context);
     Foods        = new FoodsRepository(context);
     Measurements = new MeasurementsRepository(context);
 }
Пример #4
0
        public DayViewModel()
        {
            DayAdd      = new Day();
            DayAdd.Date = DateTime.Now;
            DayList     = new ObservableCollection <Day>(new DayRepository().GetAll().OrderByDescending(o => o.Date));
            WorkoutList = new WorkoutRepository().GetAll().OrderByDescending(o => o.ExpirationDate).ToList();
            WorkoutAdd  = WorkoutList.FirstOrDefault();

            SaveCommand   = new Command(SaveDay);
            LoadCommand   = new Command <Day>(LoadDay);
            DeleteCommand = new Command <Day>(DeleteDay);
        }
Пример #5
0
        public ExerciseDayViewModel(Day day)
        {
            DayAdd          = day;
            ExerciseDayAdd  = new ExerciseDay();
            ExerciseDayList = new ObservableCollection <ExerciseDay>(new ExerciseDayRepository().GetAll().Where(p => p.DayId == day.Id));
            ExerciseList    = new WorkoutRepository().GetAll().FirstOrDefault(p => p.Id == day.WorkoutId).ExerciseList;
            ExerciseAdd     = ExerciseList.FirstOrDefault();

            SaveCommand   = new Command(SaveExerciseDay);
            LoadCommand   = new Command <ExerciseDay>(LoadExerciseDay);
            DeleteCommand = new Command <ExerciseDay>(DeleteExerciseDay);
        }
Пример #6
0
        public WorkoutRepositoryTests()
        {
            System.Reflection.FieldInfo fiw = typeof(WorkoutRepository).GetField("_instance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
            Assert.NotNull(fiw);
            fiw.SetValue(null, null);
            _workoutRepository = WorkoutRepository.getInstance();

            System.Reflection.FieldInfo fie = typeof(ExerciseRepository).GetField("_instance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
            Assert.NotNull(fie);
            fie.SetValue(null, null);
            _exerciseRepository = ExerciseRepository.getInstance();

            PrepareData();
        }
Пример #7
0
        public static List <WorkoutItem> GetAllWorkouts()
        {
            List <WorkoutItem> result = new List <WorkoutItem>();

            List <WorkoutModel> dbWorkouts = WorkoutRepository.GetAllWorkouts();

            foreach (WorkoutModel dbWorkout in dbWorkouts)
            {
                result.Add(new WorkoutItem()
                {
                    WorkoutName = dbWorkout.workoutName
                });
            }

            return(result);
        }
Пример #8
0
 public WorkoutService()
 {
     _workoutRepository = new WorkoutRepository();
     _userRepository = new UserRepository();
 }
Пример #9
0
 public WorkoutService(WorkoutRepository repo)
 {
     _repo = repo;
 }
Пример #10
0
 public StartController()
 {
     workrepo  = new WorkoutRepository();
     entryrepo = new EntryRepository();
 }
Пример #11
0
        static void Main()
        {
            WindowFormsFactory _formsFactory  = new WindowFormsFactory();
            MainController     mainController = new MainController(_formsFactory, ExerciseRepository.getInstance(), WorkoutRepository.getInstance(), WeightMeasureRepository.getInstance());

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain(mainController));
        }
Пример #12
0
 public WorkoutsController()
 {
     _repo = new WorkoutRepository();
 }