コード例 #1
0
    }//end NextButtonClick

    /// <summary>
    /// 3. Get Data from userControls entered by the web-User and save it to session
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void CreateUserWizard1_OnActiveStepChanged(object sender, EventArgs e) {
        try {

            //step1 - Personal Details
            if (CreateUserWizard1.ActiveStepIndex == CreateUserWizard1.WizardSteps.IndexOf(this.WizardStep2))
                //get personal details
                personalDetails = PersonalDetailsUserControl1.GetPersonalDetails();
            //step2
            if (CreateUserWizard1.ActiveStepIndex == CreateUserWizard1.WizardSteps.IndexOf(this.WizardStep3))
                //get company details
                businessDetails = IndAndNatBusUserControl1.GetBusinessDetails();
            //step3
            if (CreateUserWizard1.ActiveStepIndex == CreateUserWizard1.WizardSteps.IndexOf(this.WizardStep4)) {
                //get business hours
                openHrs = OpeningHrsWeek1.GetOpeningHourInt();
                closeHrs = OpeningHrsWeek1.GetClosingHourInt();
                openDays = OpeningHrsWeek1.GetOpeningDays();
            }
            //step4
            if (CreateUserWizard1.ActiveStepIndex == CreateUserWizard1.WizardSteps.IndexOf(this.WizardStep5)) {
                //get Employees added
                staffTitles = AddStaffUserControl1.GetStaffDetails(isTitles: true);//title,
                staff1stName = AddStaffUserControl1.GetStaffDetails();//firstName, 
                staffLastName = AddStaffUserControl1.GetStaffDetails(isLastNames: true);//lastName,
                staffEmail = AddStaffUserControl1.GetStaffDetails(isEmails: true);//emails
                //populate next slide staff dropdown
                AddServicesUserControl1.PopulateStaff(staff1stName);
            }
            //step5 
            if (CreateUserWizard1.ActiveStepIndex == CreateUserWizard1.WizardSteps.IndexOf(CompleteWizardStep1)) {
                //get services added
                serviceName = AddServicesUserControl1.GetServiceDetails();
                serviceDuration = AddServicesUserControl1.GetServiceDetails(isServDuration: true);
                servicePrice = AddServicesUserControl1.GetServiceDetails(isServPrice: true);
                serviceStaff = AddServicesUserControl1.GetServiceDetails(isServStaff: true);
            }

            //updated session installation
            PolulateInstallation(CreateUserWizard1.ActiveStepIndex - 1);


        }
        catch (Exception ex) {
            System.Diagnostics.Debug.Print("<h2>Register.aspx, OnActiveStepChanged()</h2>\n" + ex.ToString() + "\n" + ex.InnerException + "\n" + ex.Message);
            // Log the exception and notify system operators
            ExceptionUtility.LogException(ex, "Register.aspx, OnActiveStepChanged()");
            ExceptionUtility.NotifySystemOps(ex);
        }//endtry-catch
    }//end OnActiveStepChanged
コード例 #2
0
    private void ShowWarning(bool isUserControlValid, int curStepIndex, WizardNavigationEventArgs e) {
        try {
            int itemAdded = 0;
            Label warning = new Label();

            //get userControl validation
            switch (curStepIndex) {
                case 4://check staff
                    itemAdded = AddStaffUserControl1.GetStaffDetails().Count();
                    break;
                case 5://check service
                    itemAdded = AddServicesUserControl1.GetServiceDetails().Count();
                    break;
                default:
                    System.Diagnostics.Debug.Print("ShowWarning, ActiveStepIndex: " + CreateUserWizard1.ActiveStepIndex.ToString() + "\t Unknown wizard step!");
                    break;
            }
            //check service or staff has been added
            if (isUserControlValid && itemAdded == 0) {
                switch (curStepIndex) {
                    case 4://staff warning msg
                        //find warning label
                        warning = (Label)CreateUserWizard1.FindControl("lblWarningStaff");
                        warning.Text = "Please click on add to include at least one member of staff.";
                        break;
                    case 5://service warning msg 
                        //find warning label
                        warning = (Label)CreateUserWizard1.FindControl("lblWarningService");
                        warning.Text = "Please click on add to include at least one service.";
                        break;
                    default:
                        System.Diagnostics.Debug.Print("ShowWarning, ActiveStepIndex: " + CreateUserWizard1.ActiveStepIndex.ToString() + "\t Unknown wizard step!");
                        break;
                }//inner switch
                //dont allow wizard to move to next slide
                e.Cancel = true;

            }//endif           
        }
        catch (Exception ex) {
            System.Diagnostics.Debug.Print("<h2>Register.aspx, PolulateInstallation()</h2>\n" + ex.ToString() + "\n" + ex.InnerException + "\n" + ex.Message);
            // Log the exception and notify system operators
            ExceptionUtility.LogException(ex, "Register.aspx, PolulateInstallation()");
            ExceptionUtility.NotifySystemOps(ex);
        }
    }