/// <summary> /// Handles the Click event of the FinishButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void FinishButton_Click(object sender, EventArgs e) { if (Page.IsValid && !PageBase.StopProcessing) { FreeTrialOption freeTrialOption = FreeTrialOption.None; if (rbtnExpectingInvitation.Checked) { freeTrialOption = FreeTrialOption.ExpectingInvitation; } else if (rbtnCreateNewProject.Checked) { this.GetBL <ProjectBL>().CreateFirstCompanyAndFirstProject(txtCompanyName.Text.Trim(), txtProjectName.Text.Trim(), ucCountryList.CountryID, UserID); popupFirstTimeLoginDirect.HidePopup(); freeTrialOption = FreeTrialOption.CreateNewProject; } else if (rbtnCreateInventory.Checked) { this.GetBL <ProjectBL>().CreateFirstCompanyAndInventory(txtCompanyName.Text.Trim(), ucCountryList.CountryID, UserID); popupFirstTimeLoginDirect.HidePopup(); freeTrialOption = FreeTrialOption.CreateInventory; } else if (rbtnCreateProjectAndInventory.Checked) { this.GetBL <ProjectBL>().CreateFirstCompanyAndFirstProject(txtCompanyName.Text.Trim(), txtProjectName.Text.Trim(), ucCountryList.CountryID, UserID); popupFirstTimeLoginDirect.HidePopup(); freeTrialOption = FreeTrialOption.CreateProjectAndInventory; } SaveFreeTrialOptionToSession(freeTrialOption); Response.Redirect("~/Default.aspx"); } }
/// <summary> /// Saves the free trial option to session. /// </summary> /// <param name="freeTrialOption">The free trial option.</param> private void SaveFreeTrialOptionToSession(FreeTrialOption freeTrialOption) { Session[FreeTrialOptionSessionKey] = freeTrialOption; }