Ejemplo n.º 1
0
        public IActionResult EnrolDelegateSupervisorRole(int supervisorDelegateId)
        {
            var sessionEnrolOnRoleProfile = multiPageFormService.GetMultiPageFormData <SessionEnrolOnRoleProfile>(
                MultiPageFormDataFeature.EnrolDelegateOnProfileAssessment,
                TempData
                );

            multiPageFormService.SetMultiPageFormData(
                sessionEnrolOnRoleProfile,
                MultiPageFormDataFeature.EnrolDelegateOnProfileAssessment,
                TempData
                );
            var supervisorDelegate = supervisorService.GetSupervisorDelegateDetailsById(supervisorDelegateId, GetAdminID(), 0);
            var roleProfile        = supervisorService.GetRoleProfileById((int)sessionEnrolOnRoleProfile.SelfAssessmentID);
            var supervisorRoles    = supervisorService.GetSupervisorRolesForSelfAssessment(sessionEnrolOnRoleProfile.SelfAssessmentID.Value);
            var model = new EnrolDelegateSupervisorRoleViewModel()
            {
                SupervisorDelegateDetail = supervisorDelegate,
                RoleProfile = roleProfile,
                SelfAssessmentSupervisorRoleId = sessionEnrolOnRoleProfile.SelfAssessmentSupervisorRoleId,
                SelfAssessmentSupervisorRoles  = supervisorRoles
            };

            return(View("EnrolDelegateSupervisorRole", model));
        }
Ejemplo n.º 2
0
        public IActionResult EnrolDelegateSupervisorRole(int supervisorDelegateId)
        {
            SessionEnrolOnRoleProfile sessionEnrolOnRoleProfile = TempData.Peek <SessionEnrolOnRoleProfile>();

            TempData.Set(sessionEnrolOnRoleProfile);
            var supervisorDelegate = supervisorService.GetSupervisorDelegateDetailsById(supervisorDelegateId, GetAdminID(), 0);
            var roleProfile        = supervisorService.GetRoleProfileById((int)sessionEnrolOnRoleProfile.SelfAssessmentID);
            var supervisorRoles    = supervisorService.GetSupervisorRolesForSelfAssessment(sessionEnrolOnRoleProfile.SelfAssessmentID.Value);
            var model = new EnrolDelegateSupervisorRoleViewModel()
            {
                SupervisorDelegateDetail = supervisorDelegate,
                RoleProfile = roleProfile,
                SelfAssessmentSupervisorRoleId = sessionEnrolOnRoleProfile.SelfAssessmentSupervisorRoleId,
                SelfAssessmentSupervisorRoles  = supervisorRoles
            };

            return(View("EnrolDelegateSupervisorRole", model));
        }
Ejemplo n.º 3
0
        public IActionResult EnrolDelegateSetSupervisorRole(
            EnrolDelegateSupervisorRoleViewModel model,
            int supervisorDelegateId,
            int selfAssessmentSupervisorRoleId
            )
        {
            var sessionEnrolOnRoleProfile = multiPageFormService.GetMultiPageFormData <SessionEnrolOnRoleProfile>(
                MultiPageFormDataFeature.EnrolDelegateOnProfileAssessment,
                TempData
                );

            if (!ModelState.IsValid)
            {
                ModelState.ClearErrorsForAllFieldsExcept("SelfAssessmentSupervisorRoleId");
                var supervisorDelegate =
                    supervisorService.GetSupervisorDelegateDetailsById(supervisorDelegateId, GetAdminID(), 0);
                var roleProfile     = supervisorService.GetRoleProfileById((int)sessionEnrolOnRoleProfile.SelfAssessmentID);
                var supervisorRoles =
                    supervisorService.GetSupervisorRolesForSelfAssessment(sessionEnrolOnRoleProfile.SelfAssessmentID.Value);
                model.SupervisorDelegateDetail = supervisorDelegate;
                model.RoleProfile = roleProfile;
                model.SelfAssessmentSupervisorRoles = supervisorRoles;
                return(View("EnrolDelegateSupervisorRole", model));
            }

            sessionEnrolOnRoleProfile.SelfAssessmentSupervisorRoleId = selfAssessmentSupervisorRoleId;
            multiPageFormService.SetMultiPageFormData(
                sessionEnrolOnRoleProfile,
                MultiPageFormDataFeature.EnrolDelegateOnProfileAssessment,
                TempData
                );
            return(RedirectToAction(
                       "EnrolDelegateSummary",
                       "Supervisor",
                       new { supervisorDelegateId = supervisorDelegateId }
                       ));
        }