コード例 #1
0
        private ActionResult NavigableView <TModel>(string formId, string view, Sections section, Action <TModel, CocDetail> mutator)
            where TModel : NavigableModel, new()
        {
            var form = !string.IsNullOrWhiteSpace(formId)
                ? FindForm(formId, section)
                : new CocDetail();

            var model = new TModel();

            var previousSection = form.PreviousSection;

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

            model.IsFinalPage = form.IsFinalSection;

            if (mutator != null)
            {
                mutator(model, form);
            }

            return(View(view, model));
        }
コード例 #2
0
        private RedirectResult RedirectNext(NextSection next)
        {
            if (!next.Section.HasValue)
            {
                return(Redirect(CocActions.Complete()));
            }

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

            return(Redirect(action));
        }