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 + "'"); } }
private void button1_Click(object sender, EventArgs e) { if (tmp[2] == textBox1.Text) { Human_Resources HR = new Human_Resources(); New_password NP = new New_password(); NP.ShowDialog(); MessageBox.Show(NP.getPass); string updateQueiry = "UPDATE Login SET Password = '******' WHERE Id = '" + int.Parse(tmp[0]) + "'"; HR.updatedata(updateQueiry); MessageBox.Show("New Password Created"); this.Close(); } else { errorProvider1.SetError(textBox1, "Wrong answer!"); } }