/// <summary> /// Handles the Click event of the lbAccountRegisterSave 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 lbAccountRegisterSave_Click(object sender, EventArgs e) { var email = tbAccountEmail.Text; if (!cbTOSAgree.Checked) { divTOS.Attributes["class"] = "alert alert-danger"; return; } var account = AcmeHelper.LoadAccountData(); account.Email = email; account.TestMode = cbTestMode.Checked; var acme = new AcmeService(account.TestMode); acme.Register(email, hlTOS.NavigateUrl); account.Key = Convert.ToBase64String(acme.RSA); AcmeHelper.SaveAccountData(account); ltAccountEmail.Text = email; pnlAccountRegister.Visible = false; pnlAccountDetail.Visible = true; HideSecondaryBlocks(false); ShowDetails(); }
/// <summary> /// Handles the Click event of the lbAccountEditSave 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 lbAccountEditSave_Click(object sender, EventArgs e) { var account = AcmeHelper.LoadAccountData(); account.OfflineMode = cbOfflineMode.Checked; AcmeHelper.SaveAccountData(account); pnlAccountEdit.Visible = false; pnlAccountDetail.Visible = true; HideSecondaryBlocks(false); ShowDetails(); }