Utility class for wizard related queries and operations
コード例 #1
0
        public static void RegisterCurrentStepInfo(Controller controller, int stepIndex, String stepName)
        {
            IRailsEngineContext context = controller.Context;
            String wizardName           = WizardUtils.ConstructWizardNamespace(controller);

            context.Session[wizardName + "currentstepindex"] = stepIndex;
            context.Session[wizardName + "currentstep"]      = stepName;
        }
コード例 #2
0
        public static bool HasPreviousStep(Controller controller)
        {
            IRailsEngineContext context = controller.Context;

            String wizardName = WizardUtils.ConstructWizardNamespace(controller);

            int currentIndex = (int)context.Session[wizardName + "currentstepindex"];

            return(currentIndex > 0);
        }
コード例 #3
0
        public static bool HasNextStep(Controller controller)
        {
            IRailsEngineContext context = controller.Context;

            String wizardName = WizardUtils.ConstructWizardNamespace(controller);

            IList stepList = (IList)context.UnderlyingContext.Items["wizard.step.list"];

            int currentIndex = (int)context.Session[wizardName + "currentstepindex"];

            return((currentIndex + 1) < stepList.Count);
        }
コード例 #4
0
        public static String GetNextStepName(Controller controller)
        {
            IRailsEngineContext context = controller.Context;

            String wizardName = WizardUtils.ConstructWizardNamespace(controller);

            int curIndex = (int)context.Session[wizardName + "currentstepindex"];

            IList stepList = (IList)context.UnderlyingContext.Items["wizard.step.list"];

            if ((curIndex + 1) < stepList.Count)
            {
                return((String)stepList[curIndex + 1]);
            }

            return(null);
        }