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")); }
public ActionResult <Mentee> UpdateMentee(string id, [FromBody] Mentee mentee) { _service.UpdateMentee(id, mentee); return(mentee); }