private void btApply_Click(object sender, EventArgs e) { string key = StringPassword.RandomStringGenerator(10); account.password = StringPassword.EncrytString(txForgetPw.Text, Properties.Resources.KeyCrypt); if (ac.UpdateObject(account)) { MessageBox.Show("Successfully!!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Please check password or email again!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btSend_Click(object sender, EventArgs e) { code = StringPassword.RandomStringGenerator(6); account = (ac.getObject(ac.getUserName(txSendEmail.Text))); if (String.IsNullOrEmpty(txSendEmail.Text)) { return; } if (String.IsNullOrEmpty(account.username)) { MyChecker.setErr(txSendEmail, errorEmail, "Email is not available!", Properties.Resources.ERROR); txSendEmail.Focus(); } else if (MyAction.sendEmail(txSendEmail.Text, code)) { MessageBox.Show("If you don't received code, Please try send again!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); myEmail = txSendEmail.Text; } else { MessageBox.Show("If you don't received code, Please try send again!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); txSendEmail.Focus(); } groupBox1.Visible = false; }