コード例 #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (!ValidateControls())
     {
         string userName = Program.userName;
         if (balUser.CheckPassword(userName) && balUser.ChangePassword(userName, txtPasswordNew.Text))
         {
             MessageBox.Show("Password Changed Successfully", "Password Changed", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             MessageBox.Show("Please Check Current Password And Try Again", "Password Change Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtPasswordNew.Focus();
         }
     }
 }