public SuccessionController(IUserService userService, IPlanningService planningService, ISurveyService surveyService, ILogger logger) : base(userService, logger) { _planningService = planningService; _surveyService = surveyService; EnrollmentStatus = new Lazy <EnrollmentStatus>(() => _planningService.GetEnrollmentStatus(AssistedUser.UserID)); }
public ActionResult Index(int wizardId) { var wizard = _planningService.GetWizard(new WizardRequest() { PlanningWizardID = wizardId }); if (wizard == null) { throw new Exception("Invalid Wizard ID: " + wizardId); } var enrollmentStatus = _planningService.GetEnrollmentStatus(AssistedUser.UserID); var enrollmentInterest = enrollmentStatus.EnrollmentInterests.First(i => i.Name == wizard.Name); if (!enrollmentInterest.Interested) { throw new Exception("According to this user's enrollment profile, this planning tool is locked."); } return(View(wizard)); }