Exemplo n.º 1
0
        public ActionResult Eligibility(int id)
        {
            var licenceId = session.GetCurrentLicenceId();

            var model = licenceApplicationViewModelBuilder.Build <EligibilityViewModel>(licenceId);

            return(GetNextView(id, FormSection.Eligibility, model));
        }
        public ActionResult Index()
        {
            var licenceId = session.GetCurrentLicenceId();

            var model = licenceApplicationViewModel.Build <DeclarationViewModel>(licenceId);

            return(View("Index", model));
        }
        protected IActionResult CheckParentValidityAndRedirect(FormSection section, int submittedPageId)
        {
            var licenceId     = Session.GetCurrentLicenceId();
            var sectionLength = FormDefinition.GetSectionLength(section);
            var nextPageId    = submittedPageId + 1;

            if (Session.GetCurrentUserIsAdmin())
            {
                return(RedirectToAction("Licence", "Admin", new { id = licenceId }));
            }

            if (nextPageId != sectionLength)
            {
                var parent = FindParentSection(section, licenceId);

                return(parent == null
                    ? RedirectToAction("TaskList", "Licence")
                    : ValidateParentAndRedirect(parent, section, nextPageId));
            }

            return(RedirectToLastAction(section));
        }