Exemple #1
0
        /// <summary>
        /// change passord
        /// </summary>
        /// <param name="password"></param>
        /// <param name="rePassword"></param>
        /// <param name="email"></param>
        public void ChangePassword(string password, string rePassword, string email)
        {
            //if password is equal to the other
            if (rePassword == password && IsValidPassword(password))
            {
                //get the user that needs to be edited
                UserModel user = UserRepository.GetUserPasswordByEmail(email);
                user.Password = password;
                UserService.ChangePassword(user);

                MessageBox.Show("your password has been changed.");

                //delete the used key
                keyService.DeleteKey(Key);
                UC.HidePanels("pCheckKey");
                UC.GoToLogin();
            }
            else
            {
                MessageBox.Show("password dit not have at least a number, uppercase and a minumum of 8 characters");
            }
        }