示例#1
0
        private RedirectResult RedirectNext(NextSection next)
        {
            if (next.Type == NextType.Complete)
            {
                return(Redirect(BsgActions.Complete()));
            }

            if (next.Type == NextType.Ineligible)
            {
                return(Redirect(BsgActions.Ineligible(next.Id)));
            }

            var action = SectionActionStrategy.For(next.Section.Value).Action(next.Id);

            return(Redirect(action));
        }
示例#2
0
        private ActionResult NavigableView <TModel>(string formId, string view, Sections section, Action <TModel, BsgDetail> mutator)
            where TModel : NavigableModel, new()
        {
            var form = !string.IsNullOrWhiteSpace(formId)
                ? FindForm(formId, section)
                : new BsgDetail();

            var model = new TModel();

            var previousSection = form.PreviousSection;

            if (previousSection.HasValue)
            {
                model.PreviousAction = SectionActionStrategy.For(previousSection.Value).Action(formId);
            }

            model.IsFinalPage = form.IsFinalSection;
            mutator(model, form);

            return(View(view, model));
        }