public ActionResult Complete() { WizData = null; ViewBag.Data = "You have completed the wizard!"; return(View()); }
private void btnNewSession_Click(object sender, EventArgs e) { try { if (!IsStepActive("Start")) { ActivateStep("Start"); btnNewSession.Enabled = true; } else { WizardSession wizardSession = StartWizard("AccountWizard"); _session = wizardSession.SessionID; _previousStep = "Start"; _nextStep = wizardSession.CurrentStep.StepName; WizardPage p = _wizardPages[_previousStep]; // StartData = p.CollectValues(); this old before add account step , no values to collect now //if (Regex.IsMatch(StartData["AccountSettings.BI_Scope_ID"].ToString().Trim(), @"\D") || string.IsNullOrEmpty(StartData["AccountSettings.BI_Scope_ID"].ToString())) //{ // MessageBox.Show("Scope ID IS NOT A NUMBER"); //} //else ActivateStep(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public ActionResult Test(int?Step) { if (WizData == null) { WizData = new WizardSession(); } WizData.CurrentStep = Step ?? 1; ImportWizard.SetStep(Step ?? 1); return(ImportWizard.Process(WizData, null)); }
public WizardSessionTest() { _step1Mock = new Mock <IWizardStep>(); _step1Mock.Setup(x => x.Next(It.IsAny <Node>())).Returns(StepTransitionResult.Success()); _step2Mock = new Mock <IWizardStep>(); _step2Mock.Setup(x => x.Next(It.IsAny <Node>())).Returns(StepTransitionResult.Success()); var step3Mock = new Mock <IWizardStep>(); step3Mock.Setup(x => x.Next(It.IsAny <Node>())).Returns(StepTransitionResult.Success()); _stepsProviderMock = new Mock <IWizardStepsProvider>(); _stepsProviderMock.Setup(x => x.GetWizardSteps()) .Returns(new[] { _step1Mock.Object, _step2Mock.Object, step3Mock.Object }); _session = new WizardSession(_stepsProviderMock.Object); // Session is using static fields to keep state for purpose of this example so we need to clear it. // Production code would use different way of keeping the state like real Session, special token etc. _session.Cancel(); }