private void timer2_Tick(object sender, EventArgs e) { this.Opacity -= 0.1; if (this.Opacity == 0) { timer2.Stop(); this.Hide(); Form_Login nextForm = new Form_Login(); nextForm.ShowDialog(); } }
private void btnBack_Click(object sender, EventArgs e) { if (btnBack.Text == "BACK") { this.Hide(); Reset(); Form_Login nextForm = new Form_Login(); nextForm.ShowDialog(); } else { DialogResult dialogResult = MessageBox.Show("Are you sure you want to cancel ?", "ATTENTION", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { this.Hide(); Reset(); Form_Login nextForm = new Form_Login(); nextForm.ShowDialog(); } } }
private void SettingANewPassword() { try { Objects.con.Open(); Objects.cmd = new OleDbCommand("UPDATE [tbl_accounts] SET [password]=@password WHERE [ID]=@ID ", Objects.con); Objects.cmd.CommandType = System.Data.CommandType.Text; Objects.cmd.Parameters.Add(new OleDbParameter("@password", BCrypt.Net.BCrypt.HashPassword(txtConfirmNewPassword.Text))); Objects.cmd.Parameters.Add(new OleDbParameter("@ID", accountID)); Objects.cmd.ExecuteNonQuery(); Objects.con.Close(); MessageBox.Show("SUCCESSFULLY UPDATED YOUR PASSWORD", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); Reset(); var nextForm = new Form_Login(); nextForm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace); } }