Ejemplo n.º 1
0
        public void AddDailyFeeling(DailyFeelingVM diaryFeelingVM)
        {
            var diaryEntry = MapMVM.DiaryFeelingVMToDiaryFeeling(diaryFeelingVM);

            _uow.DiaryFeelingRepository.CreateDailyFeeling(diaryEntry);
            _uow.Save();
        }
Ejemplo n.º 2
0
        public void EditWorkout(WorkoutVM workoutVM)
        {
            var workout = MapMVM.WorkoutToWorkoutVM(workoutVM);

            _uow.WorkoutRepository.UpdateWorkout(workout);
            _uow.Save();
        }
Ejemplo n.º 3
0
        public void AddWorkout(WorkoutVM workoutVM)
        {
            var workout = MapMVM.WorkoutToWorkoutVM(workoutVM);

            _uow.WorkoutRepository.CreateWorkout(workout);
            _uow.Save();
        }
Ejemplo n.º 4
0
        public bool AddAuthToken(AuthTokenVM authTokenVM)
        {
            //todo delete old tokens/expired
            var authToken = MapMVM.AuthTokenVMToAuthToken(authTokenVM);

            _uow.SecurityRepository.AddAuthToken(authToken);
            return(true);
        }
Ejemplo n.º 5
0
        public void EditDiaryFeelingAndWorkouts(DailyFeelingVM dailyFeelingVM)
        {
            var dailyFeeling = MapMVM.DiaryFeelingVMToDiaryFeeling(dailyFeelingVM);

            _uow.DiaryFeelingRepository.UpdateDailyFeeling(dailyFeeling);
            UpdateWorkouts(dailyFeeling);
            _uow.Save();
            dailyFeelingVM = MapMVM.DiaryFeelingToDiaryFeelingVM(dailyFeeling);
        }
Ejemplo n.º 6
0
        //DailyFeelings Graph
        public void AddDailyFeelingAndWorkouts(DailyFeelingVM dailyFeelingVM)
        {
            var dailyFeeling = MapMVM.DiaryFeelingVMToDiaryFeeling(dailyFeelingVM);

            _uow.DiaryFeelingRepository.CreateDailyFeeling(dailyFeeling);
            AddWorkouts(dailyFeeling);
            _uow.Save();
            dailyFeelingVM = MapMVM.DiaryFeelingToDiaryFeelingVM(dailyFeeling);
        }
Ejemplo n.º 7
0
        //DailyFeelings
        public DailyFeelingPageVM GetDailyFeelings(int pageSize, int page)
        {
            var diaryFeelings = _uow.DiaryFeelingRepository.GetDailyFeelings(pageSize, page);

            var totalCount = _uow.DiaryFeelingRepository.CountDailyFeelings();
            var totalPages = Math.Ceiling((double)totalCount / pageSize);

            return(MapMVM.DiaryFeelingsToDiaryFeelingPageVM(diaryFeelings, totalCount, totalPages));
        }
Ejemplo n.º 8
0
        //DailyFeeling
        public static DailyFeelingPageVM DiaryFeelingsToDiaryFeelingPageVM(List <DailyFeeling> diaryFeelings, int totalCount, double totalPages)
        {
            var diaryFeelingsVM    = MapMVM.DiaryFeelingsToDiaryFeelingsVM(diaryFeelings);
            var dailyFeelingPageVM = new DailyFeelingPageVM()
            {
                DailyFeelingsVM = diaryFeelingsVM,
                TotalPages      = totalPages,
                TotalCount      = totalCount,
                NextUrl         = string.Empty,
                PrevUrl         = string.Empty
            };

            return(dailyFeelingPageVM);
        }
Ejemplo n.º 9
0
        public DailyFeelingVM GetDailyFeeling(int dailyFeelingId)
        {
            var diaryFeeling = _uow.DiaryFeelingRepository.GetDailyFeeling(dailyFeelingId);

            return(MapMVM.DiaryFeelingToDiaryFeelingVM(diaryFeeling));
        }
Ejemplo n.º 10
0
        //Workouts
        public List <WorkoutTypeVM> GetWorkoutTypes()
        {
            var workoutTypes = _uow.WorkoutRepository.GetWorkoutTypes();

            return(MapMVM.WorkoutTypeToWorkoutTypeVM(workoutTypes));
        }