Exemplo n.º 1
0
        // GET: Profile
        public async Task <ActionResult> PersonalProfile()
        {
            //ViewBag.Title = "UpdateProfileView";
            string userId = Request.Cookies["userId"].Value;

            var user = await userManager.GetById(userId);

            switch (user.UserType)
            {
            case "Trainer":
                TrainerManager trainerManager = new TrainerManager();
                var            trainer        = await trainerManager.GetById(userId);

                TempData["trainerProfileData"] = trainer;
                return(RedirectToAction("PersonalTrainerProfile"));

            case "Trainee":
                TraineeManager traineeManager = new TraineeManager();
                var            trainee        = await traineeManager.GetById(userId);

                TempData["traineeProfileData"] = trainee;
                return(RedirectToAction("PersonalTraineeProfile"));

            case "Gym":
                GymManager gymManager = new GymManager();
                var        gym        = await gymManager.GetById(userId);

                TempData["gymProfileData"] = gym;
                return(RedirectToAction("PersonalGymProfile"));
            }

            return(View());
        }
Exemplo n.º 2
0
        public async Task <ActionResult> UpdateMedicalCondition(MedicalConditionContext medicalCondition)
        {
            string         userId         = Request.Cookies["userId"].Value;
            TraineeManager traineeManager = new TraineeManager();
            await traineeManager.UpdateMedicalCondition(userId, medicalCondition);

            return(RedirectToAction("PersonalProfile", "Profile"));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> MedicalCondition()
        {
            ViewBag.Title = "MedicalCondition";
            TraineeManager traineeManager = new TraineeManager();
            var            trainee        = await traineeManager.GetById(Request.Cookies["userId"].Value);

            return(View(trainee.MedicalCondition));
        }
 public TraineeViewController()
 {
     traineeManager = new TraineeManager();
     userManager = new UserManager();
 }
Exemplo n.º 5
0
 public TraineeController()
 {
     traineeManager = new TraineeManager();
 }