public static void SetUserStatus(StatusUpdateData data) { CandidateUser user = GetUser <CandidateUser>(data.CandidateId); if (user == null) { throw new InterviewException.CandidateDoesntExistsException(data.CandidateId); } switch (data.Status) { case AdmissionStatus.Registered: user.Status = AdmissionStatus.Registered; break; case AdmissionStatus.PassedTests: user.Status = AdmissionStatus.PassedTests; InterviewManager.AddCandidateToInterviewQueue(data.CandidateId); break; case AdmissionStatus.Passed: user.Status = AdmissionStatus.Passed; break; case AdmissionStatus.Rejected: user.Status = AdmissionStatus.Rejected; break; } }
public static AbstractUser CreateUser(RegistrationData regData) { AbstractUser user; switch (regData.RootType) { case RootEnum.Candidate: user = new CandidateUser(++Instance.LastId); Instance._specificUserLists[typeof(CandidateUser)].Add(user); break; case RootEnum.Manager: user = new ManagerUser(++Instance.LastId); Instance._specificUserLists[typeof(ManagerUser)].Add(user); break; case RootEnum.Interviewer: user = new InterviewerUser(++Instance.LastId); Instance._specificUserLists[typeof(InterviewerUser)].Add(user); break; case RootEnum.Admin: user = new AdminUser(++Instance.LastId); Instance._specificUserLists[typeof(AdminUser)].Add(user); break; default: throw new ArgumentOutOfRangeException(nameof(regData.RootType), regData.RootType, null); } user.Profile = regData.Profile; return(user); }