protected void btnDelete_Click(object sender, EventArgs e) { string usr = WebSecurity.CurrentUserName; if (!string.IsNullOrEmpty(txtPassword.Text)) { if (Membership.ValidateUser(usr, txtPassword.Text)) { CustomerDAC dac = new CustomerDAC(); Guid userID = dac.RetrieveUserGUID(usr); string err = ""; if (dac.DeactivateUser(usr, userID, out err)) { accountCancel.Visible = false; CompleteConfirm.Visible = true; } else { lblError.Visible = true; if (err == "Unable to find user") { lblError.Text = "Unknown error, please retry login"; } } } else { lblError.Visible = true; lblError.Text = "Invalid password"; } } }
private void CheckUserStatus() { CustomerDAC dac = new CustomerDAC(); Guid userID = dac.RetrieveUserGUID(WebSecurity.CurrentUserName); var drP = dac.RetrieveUserProfiles(userID); if (drP != null) { if (drP.AccountDeletion) { accountCancel.Visible = false; CompleteConfirm.Visible = true; } } else { Response.Redirect(SystemConstants.ProviderUrl + "Account"); } }