Exemplo n.º 1
0
        public ActionResult SetAsInactive(int userId, UserRoleCode userRole)
        {
            var currentUser = UserHelper.GetCurrentUserInfo();

            if (currentUser.IsInRole(UserRoleCode.Career))
            {
                if (userRole == UserRoleCode.Mentor)
                {
                    var mentor = _mentorService.GetByUserId(userId);
                    mentor.Status = MentorStatus.Inactive;
                    _mentorService.UpdateMentor(mentor);
                }

                if (userRole == UserRoleCode.Mentee)
                {
                    var mentee = _menteeService.GetByUserId(userId);
                    mentee.Status = MenteeStatus.Inactive;
                    _menteeService.UpdateMentee(mentee);
                }
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult <Mentee> UpdateMentee(string id, [FromBody] Mentee mentee)
 {
     _service.UpdateMentee(id, mentee);
     return(mentee);
 }