}//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
}//end CreatedUser /// <summary> /// 2. Stops Wizard going to nextStep is usercontrol validation isnt valid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e) { try { bool isUserControlValid = true; //get userControl validation switch (CreateUserWizard1.ActiveStepIndex) { case 0://create aspUser System.Diagnostics.Debug.Print("CreateUserWizard1_NextButtonClick, ActiveStepIndex: " + CreateUserWizard1.ActiveStepIndex.ToString() + "\t Created aspUser!"); break; case 1://personal Details isUserControlValid = PersonalDetailsUserControl1.IsValidFields(); break; case 2://Business Details isUserControlValid = IndAndNatBusUserControl1.IsValidFields(); break; case 3://business working hrs and days System.Diagnostics.Debug.Print("CreateUserWizard1_NextButtonClick, ActiveStepIndex: " + CreateUserWizard1.ActiveStepIndex.ToString() + "\t Business Hrs!"); break; case 4://add staff isUserControlValid = AddStaffUserControl1.IsValidFields(); break; case 5://add service (NB: NEVER RUN AS BUTTON FINISH IS PRESSED INSTEAD) goTo finish_buttonClick isUserControlValid = AddServicesUserControl1.IsValidFields(); break; case 6: //complete (NB: NEVER RUN AS BUTTON CONTINUE IS PRESSED INSTEAD) goTo ContinueButtonClick System.Diagnostics.Debug.Print("CreateUserWizard1_NextButtonClick, ActiveStepIndex: " + CreateUserWizard1.ActiveStepIndex.ToString() + "\t Finished Registration!"); break; default: System.Diagnostics.Debug.Print("CreateUserWizard1_NextButtonClick, ActiveStepIndex: " + CreateUserWizard1.ActiveStepIndex.ToString() + "\t Unknown wizard step!"); break; } //stop CreateUserWizard1 going to nextStep is usercontrol isnt valid if (!isUserControlValid) e.Cancel = true; //check staff has been added if (CreateUserWizard1.ActiveStepIndex == 4) ShowWarning(isUserControlValid, CreateUserWizard1.ActiveStepIndex, e); } catch (Exception ex) { System.Diagnostics.Debug.Print("<h2>Register.aspx, CreateUserWizard1_NextButtonClick()</h2>\n" + ex.ToString() + "\n" + ex.InnerException + "\n" + ex.Message); // Log the exception and notify system operators ExceptionUtility.LogException(ex, "Register.aspx, CreateUserWizard1_NextButtonClick()"); ExceptionUtility.NotifySystemOps(ex); }//endtry-catch }//end NextButtonClick