Esempio n. 1
0
        public void WizardStepCollection_Add()
        {
            Wizard     w     = new Wizard();
            WizardStep step1 = new WizardStep();

            try {
                w.WizardSteps.Add(step1);
            }
            catch (Exception e) {
                Assert.Fail(e.Message);
            }
            Assert.AreEqual(1, w.WizardSteps.Count, "Add step fail");
        }
Esempio n. 2
0
        protected void NewUserWizard_ActiveStepChanged(object sender, EventArgs e)
        {
            // Have we JUST reached the Complete step?
            if (NewUserWizard.ActiveStep.Title == "Complete")
            {
                WizardStep UserSettings = NewUserWizard.FindControl("UserSettings") as WizardStep;

                // Programmatically reference the TextBox controls
                //TextBox HomeTown = UserSettings.FindControl("HomeTown") as TextBox;
                //TextBox HomepageUrl = UserSettings.FindControl("HomepageUrl") as TextBox;
                //TextBox Signature = UserSettings.FindControl("Signature") as TextBox;

                ///////////////////////////////////////////////////////////////////////////////
                TextBox FirstName = UserSettings.FindControl("FirstName") as TextBox;
                TextBox LastName  = UserSettings.FindControl("LastName") as TextBox;
                TextBox Mobile    = UserSettings.FindControl("Mobile") as TextBox;
                TextBox Country   = UserSettings.FindControl("Country") as TextBox;
                TextBox City      = UserSettings.FindControl("City") as TextBox;
                TextBox Address   = UserSettings.FindControl("Address") as TextBox;
                //TextBox picture = UserSettings.FindControl("picture") as TextBox;



                ///////////////////////////////////////////////////////////////////////////////


                // Update the UserProfiles record for this user
                // Get the UserId of the just-added user
                MembershipUser newUser   = Membership.GetUser(NewUserWizard.UserName);
                Guid           newUserId = (Guid)newUser.ProviderUserKey;

                // Insert a new record into UserProfiles
//                string connectionString = ConfigurationManager.ConnectionStrings["SecurityTutorialsConnectionString"].ConnectionString;
                string updateSql = "UPDATE custom_profile SET firstname=@firstname,lastname=@lastname,mobile=@mobile,country=@country,city=@city,address=@address,picture=@picture where userid='" + newUserId + "'";

                using (SqlConnection conn = Connection_Manger.getConnection())
                {
                    conn.Open();
                    SqlCommand myCommand = new SqlCommand(updateSql, conn);
                    myCommand.Parameters.AddWithValue("@firstname", FirstName.Text.Trim());
                    myCommand.Parameters.AddWithValue("@lastname", LastName.Text.Trim());
                    myCommand.Parameters.AddWithValue("@mobile", Mobile.Text.Trim());
                    myCommand.Parameters.AddWithValue("@country", Country.Text.Trim());
                    myCommand.Parameters.AddWithValue("@city", City.Text.Trim());
                    myCommand.Parameters.AddWithValue("@address", Address.Text.Trim());
                    myCommand.Parameters.AddWithValue("@picture", DBNull.Value);
                    myCommand.ExecuteNonQuery();
                    conn.Close();
                }
            }
        }
        public void Step_previous_navigation_cycles_and_returns_last_step_continuously()
        {
            var sut = FiveStepWizardController;

            sut.HasNextStep.Should().BeTrue();
            sut.CurrentStepNumber.Should().Be(1);
            sut.Next().Should().Be(WizardStep.Create("Step 2"));
            sut.CurrentStepNumber.Should().Be(2);
            sut.Previous().Should().Be(WizardStep.Create("Step 1"));
            sut.CurrentStepNumber.Should().Be(1);
            sut.Previous().Should().Be(WizardStep.Create("Step 1"));
            sut.CurrentStepNumber.Should().Be(1);
            sut.HasPreviousStep.Should().BeFalse();
        }
        public override void Execute(WizardController wizardController, WizardStep step, MainPageUrlBuilder url)
        {
            var navigator = CreateNavigator(step.ToForm);

            if (!ChangeUrlToDestination(wizardController.Navigator, navigator, url))
            {
                return;
            }

            url.UserControl = navigator.CurrentNavigator.TableName + "Journal";
            url.IsNew       = false;
            url.IsRead      = false;
            NextUrlBuilder  = url;
        }
Esempio n. 5
0
    protected override void OnInit(EventArgs e)
    {
        TransitSurvey ts = SessionManager.ObjectService.GetSurveyById(
            SessionManager.Ticket, RequestId);

        this.Title = surveyName.Text = Render(ts.Name);

        List <TransitAccountSurveyAnswer> answers = SessionManager.AccountService.GetAccountSurveyAnswers(
            SessionManager.Ticket, SessionManager.AccountId, RequestId, null);

        SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();

        sitemapdata.Add(new SiteMapDataAttributeNode(ts.Name, Request, string.Format("AccountSurveyView.aspx?id={0}", ts.Id)));
        sitemapdata.Add(new SiteMapDataAttributeNode("Edit Survey", Request.Url));
        StackSiteMap(sitemapdata);

        int index = 1;

        foreach (TransitAccountSurveyAnswer answer in answers)
        {
            WizardStep step = new WizardStep();
            step.Title = answer.SurveyQuestion;

            HyperLink q = new HyperLink();
            q.ID          = "question_" + index.ToString();
            q.Text        = answer.SurveyQuestion;
            q.NavigateUrl = string.Format("AccountSurveyQuestionView.aspx?id={0}", answer.SurveyQuestionId);
            q.Font.Bold   = true;
            step.Controls.Add(q);

            step.Controls.Add(new HtmlGenericControl("br"));
            step.Controls.Add(new HtmlGenericControl("br"));

            TextBox t = new TextBox();
            t.ID       = "answer_" + index.ToString();
            t.Text     = answer.Answer;
            t.TextMode = TextBoxMode.MultiLine;
            t.Rows     = 7;
            t.CssClass = "sncore_form_textbox";
            step.Controls.Add(t);

            surveyWizard.WizardSteps.Insert(surveyWizard.WizardSteps.Count - 1, step);

            mSurveyEntries.Add(new AccountSurveyEntry(answer, t));
            index++;
        }

        base.OnInit(e);
    }
Esempio n. 6
0
        private void _asyncOperation_Completed(object sender, EventArgs e)
        {
            // screen late calls to zombie detector
            if (_asyncOperation == null)
            {
                return;
            }

            if (_autoDetectionOperation.AuthenticationErrorOccurred)
            {
                HandleAuthenticationError();
                //Wizard.back();
            }
            else if (_autoDetectionOperation.FatalErrorOccurred)
            {
                HandleFatalError();
            }
            else if (_autoDetectionOperation.WasCancelled)
            {
                Wizard.back();
            }
            else
            {
                // copy the detected settings
                _autoDetectionOperation.OperationCompleted();

                // exclude steps as appropriate
                WizardStep excludeStep = _autoDetectionOperation.ExcludedStepIfCompleted;
                if (excludeStep != null)
                {
                    if (Wizard.StepExists(excludeStep))
                    {
                        Wizard.removeWizardStep(excludeStep);
                    }
                }

                // go to the next step (might be a substep or might be default)
                Wizard.next();

                // show non fatal errors
                _autoDetectionOperation.ShowNonFatalErrors(AutoDetectionPanel.FindForm());

                // remove us from the wizard
                Wizard.removeWizardStep(this);
            }

            // clear the account detector
            ExitAsyncOperation();
        }
Esempio n. 7
0
        // Step 2 = Verify Templates
        public void VerifyTemplates()
        {
            string TemplatePath = System.Windows.Forms.Application.ExecutablePath;
            int    LastSlash    = TemplatePath.LastIndexOf('\\');

            if (LastSlash != -1)
            {
                TemplatePath = TemplatePath.Substring(0, LastSlash + 1) + "Templates\\";
            }
            else
            {
                SendMessage(this, new Information("TemplatePath = " + TemplatePath));
                TemplatePath = "Error"; // Error
            }
            SendMessage(this, new Information("TemplatePath = " + TemplatePath));

            try
            {
                if (!File.Exists(UserSettings.MyDocuments + "Gradebook_Group_33_Template_Percent.xls"))
                {
                    File.Copy(TemplatePath + "Gradebook_Group_33_Template_Percent.xls", UserSettings.MyDocuments + "Gradebook_Group_33_Template_Percent.xls");
                }
                else
                {
                    SendMessage(this, new Information("Gradebook_Group_33_Template_Percent.xls - has been found"));
                }
            }
            catch
            {
                SendMessage(this, new Information("Could not find " + TemplatePath + "Gradebook_Group_33_Template_Percent.xls"));
            }

            try
            {
                if (!File.Exists(UserSettings.MyDocuments + "Gradebook_Group_36_Template_Percent.xls"))
                {
                    File.Copy(TemplatePath + "Gradebook_Group_36_Template_Percent.xls", UserSettings.MyDocuments + "Gradebook_Group_36_Template_Percent.xls");
                }
                else
                {
                    SendMessage(this, new Information("Gradebook_Group_36_Template_Percent.xls - has been found"));
                }
            }
            catch
            {
                SendMessage(this, new Information("Could not find " + TemplatePath + "Gradebook_Group_36_Template_Percent.xls"));
            }
            CurrentCompletedStep = WizardStep.VerifyTemplates;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // Reference the SpecifyRolesStep WizardStep
            WizardStep SpecifyRolesStep = RegisterUserWithRoles.FindControl("SpecifyRolesStep") as WizardStep;

            // Reference the RoleList CheckBoxList
            CheckBoxList RoleList = SpecifyRolesStep.FindControl("RoleList") as CheckBoxList;

            // Bind the set of roles to RoleList
            RoleList.DataSource = Roles.GetAllRoles();
            RoleList.DataBind();
        }
    }
Esempio n. 9
0
        private void AddStep(string id, string title, string controllerName, string action)
        {
            Utility.ThrowIfNull(id, nameof(id));
            Utility.ThrowIfNull(title, nameof(title));

            Utility.ThrowIfNull(controllerName, nameof(controllerName));
            Utility.ThrowIfNull(action, nameof(action));

            var step = new WizardStep(id, title);

            step["controllername"] = controllerName;
            step["action"]         = action;

            steps.Add(step);
        }
Esempio n. 10
0
        private void HandleNextButtonPressed(object sender, System.EventArgs e)
        {
            switch (this.wizardStep)
            {
            case WizardStep.WorldSetup:
                this.wizardStep = WizardStep.PlayerSetup;
                SwapControl(this.playerSetup);
                break;

            case WizardStep.PlayerSetup:
                Dispose();
                OnResultChosen();
                break;
            }
        }
Esempio n. 11
0
 void RemoveStep()
 {
   IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
   if(host != null)
   {
     Wizard wizard = GetWizard();
     if(wizard.CurrentStepIndex != -1)
     {
       WizardStep step = wizard.CurrentStep;
       wizard.Steps.RemoveAt(wizard.CurrentStepIndex);
       host.DestroyComponent(step);
       SelectWizard();
     }
   }
 }
Esempio n. 12
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            WizardStep vm = value as WizardStep;

            if (vm != null)
            {
                string title = vm.Title;
                if (vm.Wizard != null)
                {
                    int idx = vm.Wizard.Steps.IndexOf(vm);
                    title += " ( " + (idx + 1) + " of " + vm.Wizard.Steps.Count + " )";
                }
                return(title);
            }
            return(null);
        }
Esempio n. 13
0
        public void WizardStepCollection_Contains()
        {
            Wizard     w     = new Wizard();
            WizardStep step1 = new WizardStep();
            WizardStep step2 = new WizardStep();

            try {
                w.WizardSteps.Add(step1);
            }
            catch (Exception e) {
                Assert.Fail(e.Message);
            }
            Assert.AreEqual(1, w.WizardSteps.Count, "Step count fail");
            Assert.AreEqual(true, w.WizardSteps.Contains(step1), "Step contains fail#1");
            Assert.AreEqual(false, w.WizardSteps.Contains(step2), "Step contains fail#2");
        }
Esempio n. 14
0
        public void WizardStepCollection_AddAt()
        {
            Wizard     w     = new Wizard();
            WizardStep step1 = new WizardStep();
            WizardStep step2 = new WizardStep();

            try {
                w.WizardSteps.Add(step1);
                w.WizardSteps.AddAt(0, step2);
            }
            catch (Exception e) {
                Assert.Fail(e.Message);
            }
            Assert.AreEqual(2, w.WizardSteps.Count, "Step count fail");
            Assert.AreEqual(step2, w.WizardSteps[0], "Step index fail");
        }
Esempio n. 15
0
  public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
  {
    List<string> otherSteps = new List<string>();
    otherSteps.Add("(none)");

    WizardStep instance = context.Instance as WizardStep;
    if(instance != null && instance.Wizard != null)
    {
      foreach(WizardStep step in instance.Wizard.Steps)
      {
        if(step != instance) otherSteps.Add(step.Name);
      }
    }

    return new StandardValuesCollection(otherSteps);
  }
Esempio n. 16
0
  protected override void OnDragEnter(DragEventArgs e)
  {
    WizardStepDesigner stepDesigner = GetStepDesigner();
    WizardStep currentStep = GetWizard().CurrentStep;

    // if the user drags something over the wizard step, begin forwarding the events to the step designer
    if(stepDesigner != null && currentStep.ClientRectangle.Contains(currentStep.PointToClient(new Point(e.X, e.Y))))
    {
      forwardingDrag = true;
      stepDesigner.InternalOnDragEnter(e);
    }
    else
    {
      base.OnDragEnter(e);
    }
  }
Esempio n. 17
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //var steps = value as IEnumerable<WizardStep>;

            //if (steps != null)
            //{
            //}
            WizardStep step = value as WizardStep;

            if (!step.IsComplete && !step.IsCurrent)
            {
                return(notCompletedTextColorBrush);
            }

            return(normalTextColorBrush);
        }
Esempio n. 18
0
        private void _okButton_Click(object sender, System.EventArgs e)
        {
            switch (this.wizardStep)
            {
            case WizardStep.PlayerSetup:
                OnResultChosen();
                DialogResult = DialogResult.OK;
                break;

            case WizardStep.WorldSetup:
                this.wizardStep = WizardStep.PlayerSetup;
                SwapControl(this.playerSetup);
                this.btnBack.Enabled = true;
                break;
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Creates and returns the child page of calendar appearance page.
        /// </summary>
        public static IWizardNavigator CreateCalendarAppearanceChildPage(CalendarDesigner designer)
        {
            IWizardNavigator group = WizardStep.CreateaWizardNavigator(null, null, designer.ReportItem.Site);

            group.Steps.Add(new WizardStep(group, new CalendarMonthAppearancePage(designer),
                                           Resources.CalendarSmartPanelMonthTitleAppearancePageTitle, Resources.MonthAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarDayAppearancePage(designer),
                                           Resources.CalendarSmartPanelDayAppearancePageTitle, Resources.DayAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarDayHeadersAppearancePage(designer),
                                           Resources.CalendarSmartPanelDayHeadersAppearancePageTitle, Resources.DayHeadersAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarWeekendAppearancePage(designer),
                                           Resources.CalendarSmartPanelWeekendAppearancePageTitle, Resources.WeekendAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarFillerDayAppearancePage(designer),
                                           Resources.CalendarSmartPanelFillerDayAppearancePageTitle, Resources.FillerDayAppearance_16));
            return(group);
        }
Esempio n. 20
0
    protected override void OnInit(EventArgs e)
    {
        TransitSurvey ts = SessionManager.ObjectService.GetSurveyById(
            SessionManager.Ticket, RequestId);
        this.Title = surveyName.Text = Render(ts.Name);

        List<TransitAccountSurveyAnswer> answers = SessionManager.AccountService.GetAccountSurveyAnswers(
            SessionManager.Ticket, SessionManager.AccountId, RequestId, null);

        SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
        sitemapdata.Add(new SiteMapDataAttributeNode(ts.Name, Request, string.Format("AccountSurveyView.aspx?id={0}", ts.Id)));
        sitemapdata.Add(new SiteMapDataAttributeNode("Edit Survey", Request.Url));
        StackSiteMap(sitemapdata);

        int index = 1;
        foreach (TransitAccountSurveyAnswer answer in answers)
        {
            WizardStep step = new WizardStep();
            step.Title = answer.SurveyQuestion;

            HyperLink q = new HyperLink();
            q.ID = "question_" + index.ToString();
            q.Text = answer.SurveyQuestion;
            q.NavigateUrl = string.Format("AccountSurveyQuestionView.aspx?id={0}", answer.SurveyQuestionId);
            q.Font.Bold = true;
            step.Controls.Add(q);

            step.Controls.Add(new HtmlGenericControl("br"));
            step.Controls.Add(new HtmlGenericControl("br"));

            TextBox t = new TextBox();
            t.ID = "answer_" + index.ToString();
            t.Text = answer.Answer;
            t.TextMode = TextBoxMode.MultiLine;
            t.Rows = 7;
            t.CssClass = "sncore_form_textbox";
            step.Controls.Add(t);

            surveyWizard.WizardSteps.Insert(surveyWizard.WizardSteps.Count - 1, step);

            mSurveyEntries.Add(new AccountSurveyEntry(answer, t));
            index++;
        }

        base.OnInit(e);
    }
Esempio n. 21
0
        private void BuildWorkflow(WizardStep wizardStep)
        {
            if (ValidateSelections(wizardStep))
            {
                if (workflowDesigner.SequentialWorkflow.Activities.Count > 0)
                {
                    workflowDesigner.SequentialWorkflow.Activities.Clear();
                }

                ProcessEventSelection(this.folderTypeSelection);
                ProcessFilterSelection(this.ifConditionTypeSelection);
                ProcessActivitySelection(this.actionTypeSelection);

                generateWorkflowButton.Enabled = false;
                compileWorkflowButton.Enabled  = true;
            }
        }
Esempio n. 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // Reference the SpecifyRolesStep WizardStep
            WizardStep SpecifyRolesStep = RegisterUserWithRoles.FindControl("SpecifyRolesStep") as WizardStep;

            // Reference the RoleList CheckBoxList
            DropDownList RoleList = SpecifyRolesStep.FindControl("RoleList") as DropDownList;

            // Bind the set of roles to RoleList
            RoleList.Items.Add(new ListItem("Basic 99kr/month", "Basic"));
            RoleList.Items.Add(new ListItem("Plus 199kr/month", "Plus"));
            RoleList.Items.Add(new ListItem("Prime 499kr/month", "Prime"));
            RoleList.DataBind();
        }
    }
Esempio n. 23
0
        protected internal virtual void RemoveStep()
        {
            IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));

            if (this.WizardControl == null || service == null)
            {
                return;
            }
            if (MessageBox.Show(this.WizardControl.FindForm(), "Are you sure you want to remove the step?", "Remove Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                WizardStep step = this.WizardControl.WizardSteps[this.WizardControl.CurrentStepIndex];
                this.WizardControl.WizardSteps.Remove(step);
                service.DestroyComponent(step);
                step.Dispose();
            }
            this.SelectWizard();
        }
Esempio n. 24
0
    void Page_Load(object sender, EventArgs e)
    {
        // Programmatically create a wizard control.
        Wizard Wizard1 = new Wizard();

        // Create steps for the wizard control and insert them
        // into the WizardStepCollection collection.
        for (int i = 0; i <= 5; i++)
        {
            WizardStepBase newStep = new WizardStep();
            newStep.ID    = "Step" + (i + 1).ToString();
            newStep.Title = "Step " + (i + 1).ToString();
            Wizard1.WizardSteps.Add(newStep);
        }

        // Display the wizard control on the Web page.
        PlaceHolder1.Controls.Add(Wizard1);
    }
Esempio n. 25
0
 // Step 3 = Retrieve All Quarters
 private void GetQuarters()
 {
     try
     {
         // Listen for events
         myQuarters.MessageResults += new InformationalMessage(SendMessage);
         myQuarters.AddQuartersByDate();
         CurrentCompletedStep = WizardStep.QuartersFound;
     }
     catch
     {
         throw;
     }
     finally
     {
         myQuarters.MessageResults -= new InformationalMessage(SendMessage);
     }
 }
Esempio n. 26
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            switch (step)
            {
            case WizardStep.Enterprise:
                //Check DB config
                step = WizardStep.DB;
                rebuild();
                break;

            case WizardStep.Check:
            case WizardStep.Install:
                //Check DB config
                step = WizardStep.Enterprise;
                rebuild();
                break;
            }
        }
    /// <summary>
    /// Sets the step contorls.
    /// </summary>
    /// <param name="lblStepName">Name of the LBL step.</param>
    /// <param name="divStep">The div step.</param>
    /// <param name="step">The step.</param>
    /// <param name="visited">if set to <c>true</c> [visited].</param>
    private void SetStepControls(Label lblStepName, HtmlControl divStep, WizardStep step, bool visited)
    {
        if (lblStepName != null)
        {
            lblStepName.Text = step.Title;
            if (wzdImportLeads.ActiveStep.ID == step.ID)
            {
                lblStepName.Attributes.Add("class", "lblActive");
                lblStepName.Enabled = true;
            }
            else
            {
                if (visited)
                {
                    lblStepName.Attributes.Add("class", "lblVisited");
                    lblStepName.Enabled = true;
                }
                else
                {
                    lblStepName.Attributes.Add("class", "lblNotVisited");
                    lblStepName.Enabled = false;
                }
            }
        }

        if (divStep != null)
        {
            if (wzdImportLeads.ActiveStep.ID == step.ID)
            {
                divStep.Attributes.Add("class", "Active");
            }
            else
            {
                if (visited)
                {
                    divStep.Attributes.Add("class", "Visited");
                }
                else
                {
                    divStep.Attributes.Add("class", "NotVisited");
                }
            }
        }
    }
Esempio n. 28
0
 protected void RegisterUser_ActiveStepChanged(object sender, EventArgs e)
 {
     // Have we JUST reached the Complete step?
     if (RegisterUser.ActiveStep.Title == "Complete")
     {
         // Reference the SpecifyRolesStep WizardStep
         WizardStep SpecifyRolesStep = RegisterUser.FindControl("SpecifyRolesStep") as WizardStep;
         // Reference the RoleList CheckBoxList
         CheckBoxList RoleList = SpecifyRolesStep.FindControl("RoleList") as CheckBoxList;
         // Add the checked roles to the just-added user
         foreach (ListItem li in RoleList.Items)
         {
             if (li.Selected)
             {
                 Roles.AddUserToRole(RegisterUser.UserName, li.Text);
             }
         }
     }
 }
Esempio n. 29
0
 public void SetTestForThisControl(Test NewTest, UserControl ControlForResultOfTest, bool UserScoreCollectionNeedToBeAddedToSession)
 {
     /*if (UserScoreCollectionNeedToBeAddedToSession)
     {
         string Script = "alert('Hello i am test control inside update panel!');";
         ScriptManager..RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), Script, true);
     }*/
     if (NewTest.CurrentCollectonOfQuestions.Count() == 0)
     {
         throw new ArgumentException(Texts.ExceptionMessageForTestControl_TestIsEmpty);
     }
     try
     {
         Label LabelFoScore = (Label)ControlForResultOfTest.FindControl("ScoreLabel");
     }
     catch
     {
         throw new ArgumentException(Texts.ExceptionMessageForTestControl_LabelForScoreIsMissing);
     }
     HiddenFieldForStateOfTestWizard.Value = TestStates.InProgress;
     AccessorToSession CurrentAccessorToSession = new AccessorToSession(Session);
     foreach (Question Currentquestion in NewTest.CurrentCollectonOfQuestions)
     {
         WizardStep NewWizardStep = new WizardStep();
         NewWizardStep.Controls.Add(CreateControlForQuestion(Currentquestion));
         CurrentWizardForTest.WizardSteps.Add(NewWizardStep);
     }
     if (UserScoreCollectionNeedToBeAddedToSession)
     {
         Dictionary<uint, uint> CollectionOfUserScore = new Dictionary<uint, uint>();
         foreach (Question Currentquestion in NewTest.CurrentCollectonOfQuestions)
         {
             CollectionOfUserScore[Currentquestion.ID] = 0;
         }
         CurrentAccessorToSession.CurrentUserScoreCollection = CollectionOfUserScore;
     }
     WizardStep LastWizardStep = new WizardStep();
     LastWizardStep.Controls.Add(ControlForResultOfTest);
     CurrentWizardForTest.WizardSteps.Add(LastWizardStep);
     int IndexOfLastWizardStep = CurrentWizardForTest.WizardSteps.Count - 1;
     int IndexOfFinishStep = CurrentWizardForTest.WizardSteps.Count - 2;
     ConfigureWizardSteps(IndexOfLastWizardStep, IndexOfFinishStep);
 }
Esempio n. 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!User.IsInRole("SysAdmin"))
        //{
        //    Response.Redirect("~/AccessDenied.aspx", true);
        //}

        if (!Page.IsPostBack)
        {
            // Reference the SpecifyRolesStep WizardStep
            WizardStep SpecifyRolesStep = RegisterUser.FindControl("SpecifyRolesStep") as WizardStep;

            // Reference the RoleList CheckBoxList
            CheckBoxList RoleList = SpecifyRolesStep.FindControl("RoleList") as CheckBoxList;

            // Bind the set of roles to RoleList
            RoleList.DataSource = Roles.GetAllRoles();
            RoleList.DataBind();
        }
    }
        public void LoadStep(WizardStep step, Boolean DirectionNext)
        {
            switch (step)
            {
            case WizardStep.CommunitySelector:
                if (DirectionNext)
                {
                    LoadStepCommunitySelector();
                }
                else
                {
                    View.ShowWizardStep(WizardStep.CommunitySelector);
                }
                break;

            case WizardStep.FolderSelector:
                LoadStepFolderSelector();
                break;
            }
        }
Esempio n. 32
0
  public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
  {
    string str = value as string;

    if(str != null)
    {
      if(str.Equals("(none)", StringComparison.Ordinal)) return null;

      WizardStep instance = context.Instance as WizardStep;
      if(instance != null && instance.Wizard != null)
      {
        foreach(WizardStep step in instance.Wizard.Steps)
        {
          if(string.Equals(step.Name, str, StringComparison.Ordinal)) return step;
        }
      }
    }

    return base.ConvertFrom(context, culture, value);
  }
Esempio n. 33
0
 /// <summary>
 /// Processes the pipeline.
 /// </summary>
 protected override void ProcessRecord()
 {
     if (InputObject != null && InputObject is Wizard) {
         WizardStep step = new WizardStep(Name, Order);
         if (SearchCriteria != null && SearchCriteria.Length > 0) {
             WriteVerbose(this, "adding search criteria");
             step.SearchCriteria = SearchCriteria;
         }
         if (StepForwardAction != null && StepForwardAction.Length > 0) {
             WriteVerbose(this, "adding step forward actions");
             step.StepForwardAction = StepForwardAction;
         }
         if (StepBackwardAction != null && StepBackwardAction.Length > 0) {
             WriteVerbose(this, "adding step backward actions");
             step.StepBackwardAction = StepBackwardAction;
         }
         WriteVerbose(this, "adding the step");
         InputObject.Steps.Add(step);
         if (PassThru) {
             WriteObject(this, InputObject);
         } else {
             WriteObject(this, true);
         }
     } else {
         ErrorRecord err =
             new ErrorRecord(
                 new Exception("The wizard object you provided is not valid"),
                 "WrongWizardObject",
                 ErrorCategory.InvalidArgument,
                 InputObject);
         err.ErrorDetails =
             new ErrorDetails(
                 "The wizard object you provided is not valid");
         WriteError(this, err, true);
     }
 }
Esempio n. 34
0
 /// <summary>
 /// Sets the step.
 /// </summary>
 /// <param name="step">The step.</param>
 protected void SetStep(WizardStep step)
 {
     if (step != null)
     {
         switch (step.ID)
         {
             case "cmdSelectSource":
                 SetStepControls(lblStep1Name, divStep1, step, IsVisited(visitedStep1.Value));
                 break;
             case "cmdManageDuplicates":
                 SetStepControls(lblStep2Name, divStep2, step, IsVisited(visitedStep2.Value));
                 break;
             case "cmdReview":
                 SetStepControls(lblStep3Name, divStep3, step, IsVisited(visitedStep3.Value));
                 break;
             case "cmdProcess":
                 SetStepControls(lblStep4Name, divStep4, step, IsVisited(visitedStep4.Value));
                 break;
         }
     }
 }
 public StepCompletedEvent(bool isStepComplete, WizardStep step)
 {
     this.IsStepCompleted = isStepComplete;
     this.WizardStep = step;
 }
Esempio n. 36
0
        private void SetCurrentStep(WizardStep wizardStep)
        {
            _clientArea.SuspendLayout();

            var toRemove = Control;

            var control = (WizardStepControl)Activator.CreateInstance(_stepControls[wizardStep]);

            control.Configuration = _configuration;
            control.Dock = DockStyle.Fill;

            _clientArea.Controls.Add(control);

            _clientArea.ResumeLayout();

            _clientArea.Controls.Remove(toRemove);

            _currentStep = wizardStep;

            Text = String.Format(
                "{0} ({1} of {2})",
                _title,
                Array.IndexOf(_steps, _currentStep) + 1,
                _steps.Length
            );

            UpdateButtons();
        }
Esempio n. 37
0
        private void SetupForm(WizardStep step)
        {
            switch (step) {
                case WizardStep.Introduction:
                    Step1Panel.Visible = true;
                    break;
                case WizardStep.ChooseAssemblies:
                    Step2Panel.Visible = true;
                    break;
                case WizardStep.ViewResults:
                    NextButton.Text = "Next";

                    if (ResultsText.Text.StartsWith ("There"))
                        ResultsDetailLink.Visible = true;

                    Step3Panel.Visible = true;
                    break;
                case WizardStep.SubmitResults:
                    NextButton.Text = "Next";
                    Step4Panel.Visible = true;
                    DescriptionComboBox.Focus ();
                    break;
                case WizardStep.WhatsNext:
                    NextButton.Text = "Close";
                    Step5Panel.Visible = true;
                    break;
            }

            StepLabel.Text = String.Format ("Step {0} of 5", (int)step);
            current_step = step;
        }
Esempio n. 38
0
        private void BuildWorkflow(WizardStep wizardStep)
        {
            if (ValidateSelections(wizardStep))
            {
                if (workflowDesigner.SequentialWorkflow.Activities.Count > 0)
                    workflowDesigner.SequentialWorkflow.Activities.Clear();

                ProcessEventSelection(this.folderTypeSelection);
                ProcessFilterSelection(this.ifConditionTypeSelection);
                ProcessActivitySelection(this.actionTypeSelection);

                generateWorkflowButton.Enabled = false;
                compileWorkflowButton.Enabled = true;
            }
        }
Esempio n. 39
0
    protected void WzInspection_Init(object sender, EventArgs e)
    {
        string filename = Server.MapPath("~\\Inspection\\InspectionCheckList.xml");

        XmlDocument doc = new XmlDocument();
        doc.Load(filename);

        Wizard ctrl = (Wizard) Master.FindControl("Main").FindControl("WzInspection");

        foreach (XmlNode Node in doc.SelectNodes("DocumentElement/Page"))
        {
                WizardStep step = new WizardStep();
                Table tbl = new Table();
                tbl.Style.Add("text-align", "left");
                tbl.BorderWidth = 2;

            foreach (XmlNode PageNode in Node.SelectNodes("Items"))
            {
                //ContentPlaceHolder ctplace = new ContentPlaceHolder();
                TableRow tr = new TableRow();
                tr.ID = PageNode.Attributes["ItemId"].Value;
                TableCell tdSlNo = new TableCell();
                TableCell tdDesc = new TableCell();
                TableCell tdItem = new TableCell();

                Label lblSlNo = new Label();
                Label lblDesc = new Label();

                tdItem.ID = "itm" + PageNode.Attributes["SlNo"].Value;

                //lblDesc.ID = "lbl" + Node.Attributes["Description"].Value;
                lblSlNo.Text = PageNode.Attributes["SlNo"].Value;
                lblDesc.Text = PageNode.InnerText;

                tdSlNo.Controls.Add(lblSlNo);
                tdDesc.Controls.Add(lblDesc);

                TextBox txtRem = new TextBox();
                CheckBox chkRem = new CheckBox();

                txtRem.ID = "txt" + PageNode.Attributes["ItemId"].Value;
                chkRem.ID = "chk" + PageNode.Attributes["ItemId"].Value;

                switch (PageNode.Attributes["Type"].Value)
                {
                    case "1":
                        tdItem.Controls.Add(txtRem);
                        break;
                    case "2":
                        tdItem.Controls.Add(chkRem);
                        break;
                    case "3":
                        tdItem.Controls.Add(txtRem);
                        tdItem.Controls.Add(chkRem);
                        break;
                    default:
                        break;
                }
                tr.Cells.Add(tdSlNo);
                tr.Cells.Add(tdDesc);
                tr.Cells.Add(tdItem);

                tbl.Rows.Add(tr);
            }
            step.Controls.Add(tbl);

            WzInspection.WizardSteps.AddAt(WzInspection.WizardSteps.Count-1, step);

        }
    }
Esempio n. 40
0
 /// <summary>
 /// Sets the step.
 /// </summary>
 /// <param name="step">The step.</param>
 protected void SetStep(WizardStep step)
 {
     if (step == null) return;
     switch (step.ID)
     {
         case "cmdSelectSource":
             SetStepControls(lblStep1Name, divStep1, step, !string.IsNullOrEmpty(visitedStep1.Value));
             break;
         case "cmdManageDuplicates":
             SetStepControls(lblStep2Name, divStep2, step, !string.IsNullOrEmpty(visitedStep2.Value));
             break;
         case "cmdReview":
             SetStepControls(lblStep3Name, divStep3, step, !string.IsNullOrEmpty(visitedStep3.Value));
             break;
         case "cmdProcess":
             SetStepControls(lblStep4Name, divStep4, step, !string.IsNullOrEmpty(visitedStep4.Value));
             break;
     }
 }
Esempio n. 41
0
    /// <summary>
    /// Sets the step contorls.
    /// </summary>
    /// <param name="lblStepName">Name of the LBL step.</param>
    /// <param name="divStep">The div step.</param>
    /// <param name="step">The step.</param>
    /// <param name="visited">if set to <c>true</c> [visited].</param>
    private void SetStepControls(Label lblStepName, HtmlControl divStep, WizardStep step, bool visited)
    {
        if (lblStepName != null)
        {
            lblStepName.Text = step.Title;
            if (wzdDeDup.ActiveStep.ID == step.ID)
            {
                lblStepName.CssClass = "lblWizardActive";
                lblStepName.Enabled = true;
            }
            else
            {
                if (visited)
                {
                    lblStepName.CssClass = "lblWizardVisited";
                    lblStepName.Enabled = true;
                }
                else
                {
                    lblStepName.CssClass = "lblWizardNotVisited";
                    lblStepName.Enabled = false;
                }
            }
        }

        if (divStep != null)
        {
            if (wzdDeDup.ActiveStep.ID == step.ID)
                divStep.Attributes.Add("class", "wizardActive");
            else
            {
                divStep.Attributes.Add("class", visited ? "wizardVisited" : "wizardNotVisited");
            }
        }
    }
Esempio n. 42
0
 private bool ValidateSelections(WizardStep wizardStep)
 {
     if (this.folderTypeSelection == FolderType.None & (int)wizardStep > 0)
     {
         MessageBox.Show(this, "You need to select the Outlook folder.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
         tabControl1.SelectTab(0);
         inboxRadioButton.Checked = false;
         return false;
     }
     if (this.ifConditionTypeSelection == IfConditionType.None & (int)wizardStep > 1)
     {
         MessageBox.Show(this, "You need to select the IF condition.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
         tabControl1.SelectTab(1);
         return false;
     }
     if (this.actionTypeSelection == ActionTypes.None & (int)wizardStep > 2)
     {
         MessageBox.Show(this, "You need to select at least one action.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
         tabControl1.SelectTab(2);
         return false;
     }
     return true;
 }
Esempio n. 43
0
        private void SetStep(WizardStep newStep)
        {
            switch (newStep)
            {
                case WizardStep.SelectStore:
                    Presenter.RestartAllowed = false;
                    Presenter.BackwardAllowed = false;
                    Presenter.ForwardAllowed = true;
                    Presenter.LastStep = false;
                    break;
                case WizardStep.SelectEntities:
                    Presenter.RestartAllowed = true;
                    Presenter.BackwardAllowed = true;
                    Presenter.ForwardAllowed = true;
                    Presenter.LastStep = false;
                    break;
                case WizardStep.EditEntities:
                    Presenter.RestartAllowed = true;
                    Presenter.BackwardAllowed = true;
                    Presenter.ForwardAllowed = true;
                    Presenter.LastStep = false;
                    break;
                case WizardStep.GenerateCode:
                    Presenter.RestartAllowed = true;
                    Presenter.BackwardAllowed = true;
                    Presenter.ForwardAllowed = true;
                    Presenter.LastStep = true;
                    break;
            }

            CurrentStep = newStep;
        }
 /// <summary>
 /// Sets the step.
 /// </summary>
 /// <param name="step">The step.</param>
 protected void SetStep(WizardStep step)
 {
     if (step == null) return;
     switch (step.ID)
     {
         case "cmdSelectFile":
             SetStepControls(lblStep1Name, divStep1, step, !String.IsNullOrEmpty(visitedStep1.Value));
             break;
         case "cmdDefineDelimiter":
             SetStepControls(lblStep2Name, divStep2, step, !String.IsNullOrEmpty(visitedStep2.Value));
             break;
         case "cmdMapFields":
             SetStepControls(lblStep3Name, divStep3, step, !String.IsNullOrEmpty(visitedStep3.Value));
             break;
         case "cmdManageDuplicates":
             SetStepControls(lblStep4Name, divStep4, step, !String.IsNullOrEmpty(visitedStep4.Value));
             break;
         case "cmdGroupActions":
             SetStepControls(lblStep5Name, divStep5, step, !String.IsNullOrEmpty(visitedStep5.Value));
             break;
         case "cmdReview":
             SetStepControls(lblStep6Name, divStep6, step, !String.IsNullOrEmpty(visitedStep6.Value));
             break;
     }
 }
Esempio n. 45
0
 public WizardStepAttribute(WizardStep step)
 {
     Step = step;
 }
 /// <summary>
 /// Sets the step.
 /// </summary>
 /// <param name="step">The step.</param>
 protected void SetStep(WizardStep step)
 {
     string result = string.Empty;
     if (step != null)
     {
         switch (step.ID)
         {
             case "cmdSelectFile":
                 SetStepControls(lblStep1Name, divStep1, step, IsVisited(visitedStep1.Value));
                 break;
             case "cmdDefineDelimiter":
                 SetStepControls(lblStep2Name, divStep2, step, IsVisited(visitedStep2.Value));
                 break;
             case "cmdMapFields":
                 SetStepControls(lblStep3Name, divStep3, step, IsVisited(visitedStep3.Value));
                 break;
             case "cmdManageDuplicates":
                 SetStepControls(lblStep4Name, divStep4, step, IsVisited(visitedStep4.Value));
                 break;
             case "cmdGroupActions":
                 SetStepControls(lblStep5Name, divStep5, step, IsVisited(visitedStep5.Value));
                 break;
             case "cmdReview":
                 SetStepControls(lblStep6Name, divStep6, step, IsVisited(visitedStep6.Value));
                 break;
             case "cmdProcess":
                 SetStepControls(lblStep7Name, divStep7, step, IsVisited(visitedStep7.Value));
                 break;
         }
     }
 }
Esempio n. 47
0
 internal StepMetaData(bool isRequired, WizardStep stepClass)
 {
     Required = isRequired;
     StepClass = stepClass;
 }
    /// <summary>
    /// Sets the step contorls.
    /// </summary>
    /// <param name="lblStepName">Name of the LBL step.</param>
    /// <param name="divStep">The div step.</param>
    /// <param name="step">The step.</param>
    /// <param name="visited">if set to <c>true</c> [visited].</param>
    private void SetStepControls(Label lblStepName, HtmlControl divStep, WizardStep step, bool visited)
    {
        if (lblStepName != null)
        {
            lblStepName.Text = step.Title;
            if (wzdImportLeads.ActiveStep.ID == step.ID)
            {
                lblStepName.Attributes.Add("class", "lblActive");
                lblStepName.Enabled = true;
            }
            else
            {
                if (visited)
                {
                    lblStepName.Attributes.Add("class", "lblVisited");
                    lblStepName.Enabled = true;
                }
                else
                {
                    lblStepName.Attributes.Add("class", "lblNotVisited");
                    lblStepName.Enabled = false;
                }
            }
        }

        if (divStep != null)
        {
            if (wzdImportLeads.ActiveStep.ID == step.ID)
                divStep.Attributes.Add("class", "Active");
            else
            {
                if (visited)
                    divStep.Attributes.Add("class", "Visited");
                else
                    divStep.Attributes.Add("class", "NotVisited");
            }
        }
    }