private void Quiz_Load(object sender, EventArgs e) { Forgot_Password FP = new Forgot_Password(); FP.ShowDialog(); if (searchUser(FP.getNM)) { lblQuestion.Text = tmp[1]; } else { MessageBox.Show("Username was not found."); } }
private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e) { Forgot_Password FP = new Forgot_Password(); FP.ShowDialog(); string name = FP.getNM; int id = FP.searchByUsername("SELECT * FROM Login", name); if (id != -1) { New_password NP = new New_password(); NP.ShowDialog(); string newPass = NP.getPass; (new Human_Resources()).updatedata("UPDATE Login SET Password = '******' WHERE Id = '" + id + "'"); } }