private void initTos() { Database db = Global.GetDbConnection(); LegalNoticeVersion tos = db.GetLatestLegalNoticeVersion(GlobalSettings.SignUpTermsOfService); Tos.Text = tos.Notice.Replace("\n", "<br />").Replace(" ", " "); }
private void initTos() { Database db = Global.GetDbConnection(); LegalNoticeVersion termsOfService = db.GetLatestLegalNoticeVersion(GlobalSettings.SignUpTermsOfService); TermsOfService.Text = termsOfService.Notice; }
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) { Database db = Global.GetDbConnection(); // Set user's approval to false so that it is "pending" MembershipUser membershipUser = Membership.GetUser(CreateUserWizard1.UserName); membershipUser.IsApproved = false; Membership.UpdateUser(membershipUser); // Save user's extended information to the database var userInformation = new UserInformation(); userInformation.UserId = membershipUser.ProviderUserKey; userInformation.FirstName = ((TextBox)CreateUserWizardStep3.ContentTemplateContainer.FindControl("FirstName")).Text; userInformation.LastName = ((TextBox)CreateUserWizardStep3.ContentTemplateContainer.FindControl("LastName")).Text; userInformation.LeadKey = getLeadKey(); db.ORManager.Save(userInformation); // Save user's agreement to the TOS LegalNoticeVersion termsOfService = db.GetLatestLegalNoticeVersion(GlobalSettings.SignUpTermsOfService); var tosAgreement = new LegalNoticeAgreement(termsOfService, membershipUser, true); db.SaveLegalNoticeAgreement(tosAgreement); // Update the user for the promotion participant if the user participated in a promotion int?signupPromoParticipantId = getSignupPromotionParticipantId(); if (signupPromoParticipantId != null) { var promoParticipant = db.ORManager.Get <PromotionParticipant>(signupPromoParticipantId); // Make sure that the promotion participant isn't already assigned to another user if (promoParticipant.UserId == null) { promoParticipant.UserId = (Guid?)membershipUser.ProviderUserKey; db.ORManager.SaveOrUpdate(promoParticipant); } // Delete the promotion cookie HttpCookie cookie = Request.Cookies[COOKIE_PROMO_PARTICIPANT]; if (cookie != null) { cookie.Expires = DateTime.Now.AddYears(-1); Response.SetCookie(cookie); } } // Save Verify User Email to email queue EmailTemplate emailTemplate = db.GetEmailTemplate(GlobalSettings.VerifyUserEmail); var emailMessage = new EmailMessage(emailTemplate); emailMessage.From = GlobalSettings.AdministrativeEmail; emailMessage.ApplyToUser(membershipUser, userInformation); db.SaveEmail(emailMessage); ThreadPool.QueueUserWorkItem(forceEmailEngineRun, membershipUser); Response.Redirect("Sign-Up-Complete.aspx"); }
private void setAgreement(bool agree) { Database db = Global.GetDbConnection(); LegalNoticeVersion legalNotice = db.GetLatestLegalNoticeVersion((int)GlobalSettings.TrayApplicationLicenseAgreement); var agreement = new LegalNoticeAgreement(legalNotice, Membership.GetUser(), agree); db.SaveLegalNoticeAgreement(agreement); }
public void SaveLegalNoticeVersion(LegalNoticeVersion legalNoticeVersion) { SqlCommand cmd; cmd = _dbConn.GetStoredProcedureCommand("Legal_SaveNoticeVersion"); cmd.Parameters.AddWithValue("@NoticeId", legalNoticeVersion.LegalNoticeId); cmd.Parameters.AddWithValue("@Notice", legalNoticeVersion.Notice); _dbConn.ExecuteNonQuery(cmd); }
private void checkTosAgreement(MembershipUser user) { Database db = Global.GetDbConnection(); LegalNoticeVersion tosVersion = db.GetLatestLegalNoticeVersion(GlobalSettings.SignUpTermsOfService); if (!db.HasAgreedToNotice((int)tosVersion.Id, user.ProviderUserKey)) { Response.Redirect("~/Members/TermsOfService/default.aspx"); } }
private void saveTosAgreement() { Database db = Global.GetDbConnection(); MembershipUser membershipUser = Membership.GetUser(); // Save user's agreement to the TOS LegalNoticeVersion termsOfService = db.GetLatestLegalNoticeVersion(GlobalSettings.SignUpTermsOfService); var tosAgreement = new LegalNoticeAgreement(termsOfService, membershipUser, true); db.SaveLegalNoticeAgreement(tosAgreement); }
protected void Page_Load(object sender, EventArgs e) { Database db = Global.GetDbConnection(); if (!Page.IsPostBack) { // Wizard Step 1 - TOS LegalNoticeVersion termsOfService = db.GetLatestLegalNoticeVersion(GlobalSettings.SignUpTermsOfService); TermsOfService.Text = termsOfService.Notice; } }
private void save() { Database db = Global.GetDbConnection(); int? id = LegalNoticeIdParameter; var legalNoticeVersion = new LegalNoticeVersion(); legalNoticeVersion.LegalNoticeId = (int)id; legalNoticeVersion.Notice = Notice.Text; db.SaveLegalNoticeVersion(legalNoticeVersion); }
private void initLegalNotice() { int?id = LegalNoticeIdParameter; if (id != null) { Database db = Global.GetDbConnection(); LegalNotice notice = db.GetLegalNotice((int)id); LegalNoticeVersion version = db.GetLatestLegalNoticeVersion((int)notice.Id); LegalNoticeId.Text = notice.Id.ToString(); Description.Text = notice.Description; Notice.Text = version == null ? string.Empty : version.Notice; } else { Response.Redirect(Administrators_LegalNotices_Default.GetLoadUrl()); } }
public LegalNoticeVersion GetLatestLegalNoticeVersion(int legalNoticeId) { SqlCommand cmd; DataSet ds; LegalNoticeVersion version; cmd = this._dbConn.GetStoredProcedureCommand("Legal_GetNoticeVersion"); cmd.Parameters.AddWithValue("@NoticeId", legalNoticeId); ds = _dbConn.GetDataSet(cmd); if (ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { return(null); } version = new LegalNoticeVersion(); DataMapper.PopulateObject(version, ds, null, null); return(version); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int?legalNoticeId = GlobalSettings.TrayApplicationLicenseAgreement; Agree.Enabled = (legalNoticeId != null); Disagree.Enabled = (legalNoticeId != null); if (legalNoticeId == null) { setForNoLegalNotice(); } else { Database db = Global.GetDbConnection(); LegalNoticeVersion legalNotice = db.GetLatestLegalNoticeVersion((int)legalNoticeId); if (legalNotice == null) { setForNoLegalNotice(); } else { bool agreed = db.HasAgreedToNotice((int)legalNotice.Id, Membership.GetUser().ProviderUserKey); LicenseAgreementPanel.Visible = !agreed; DownloadApplicationPanel.Visible = agreed; if (!agreed) { LicenseAgreement.Text = legalNotice.Notice; } else { initClientOS(); } } } } }