コード例 #1
0
        public ActionResult DeleteWorkout(WorkoutRoutine workout, int intDayID, int intUserID)
        {
            WorkoutHomeVM model = new WorkoutHomeVM()
            {
                LstWorkoutRoutines = WorkoutRoutineDAL.GetWorkoutsByDayAndUser(intDayID, intUserID).Where(w => w != workout)
            };

            return(View("WorkoutHome", model));
        }
コード例 #2
0
        public ActionResult WorkoutHome()
        {
            if (HomeController.USER_NUMBER == -1)
            {
                return(RedirectToAction("NewUser", "Home"));
            }
            else
            {
                User user = UserDAL.GetUser(HomeController.USER_NUMBER);
                Day  day  = DayDAL.GetDayByUserAndDay(user.intUserID);

                WorkoutHomeVM model = new WorkoutHomeVM()
                {
                    user = user,
                    LstWorkoutRoutines = WorkoutRoutineDAL.GetWorkoutsByDayAndUser(day.intDayID, user.intUserID)
                };
                return(View(model));
            }
        }