public void AddDailyFeeling(DailyFeelingVM diaryFeelingVM) { var diaryEntry = MapMVM.DiaryFeelingVMToDiaryFeeling(diaryFeelingVM); _uow.DiaryFeelingRepository.CreateDailyFeeling(diaryEntry); _uow.Save(); }
public void EditWorkout(WorkoutVM workoutVM) { var workout = MapMVM.WorkoutToWorkoutVM(workoutVM); _uow.WorkoutRepository.UpdateWorkout(workout); _uow.Save(); }
public void AddWorkout(WorkoutVM workoutVM) { var workout = MapMVM.WorkoutToWorkoutVM(workoutVM); _uow.WorkoutRepository.CreateWorkout(workout); _uow.Save(); }
public bool AddAuthToken(AuthTokenVM authTokenVM) { //todo delete old tokens/expired var authToken = MapMVM.AuthTokenVMToAuthToken(authTokenVM); _uow.SecurityRepository.AddAuthToken(authToken); return(true); }
public void EditDiaryFeelingAndWorkouts(DailyFeelingVM dailyFeelingVM) { var dailyFeeling = MapMVM.DiaryFeelingVMToDiaryFeeling(dailyFeelingVM); _uow.DiaryFeelingRepository.UpdateDailyFeeling(dailyFeeling); UpdateWorkouts(dailyFeeling); _uow.Save(); dailyFeelingVM = MapMVM.DiaryFeelingToDiaryFeelingVM(dailyFeeling); }
//DailyFeelings Graph public void AddDailyFeelingAndWorkouts(DailyFeelingVM dailyFeelingVM) { var dailyFeeling = MapMVM.DiaryFeelingVMToDiaryFeeling(dailyFeelingVM); _uow.DiaryFeelingRepository.CreateDailyFeeling(dailyFeeling); AddWorkouts(dailyFeeling); _uow.Save(); dailyFeelingVM = MapMVM.DiaryFeelingToDiaryFeelingVM(dailyFeeling); }
//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)); }
//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); }
public DailyFeelingVM GetDailyFeeling(int dailyFeelingId) { var diaryFeeling = _uow.DiaryFeelingRepository.GetDailyFeeling(dailyFeelingId); return(MapMVM.DiaryFeelingToDiaryFeelingVM(diaryFeeling)); }
//Workouts public List <WorkoutTypeVM> GetWorkoutTypes() { var workoutTypes = _uow.WorkoutRepository.GetWorkoutTypes(); return(MapMVM.WorkoutTypeToWorkoutTypeVM(workoutTypes)); }