Beispiel #1
0
        public UserResponse ChangePw(int id, UserPassword u)
        {
            string pwDecrypt = _encrypt.Decrypt(Convert.FromBase64String(u.Password));

            u.Password    = pwDecrypt;
            pwDecrypt     = _encrypt.Decrypt(Convert.FromBase64String(u.OldPassword));
            u.OldPassword = pwDecrypt;

            int state = _userService.UpdatePassword(id, u.toDALPW());;

            if (state == 1)
            {
                return new UserResponse {
                           ErrorCode = 3
                }
            }
            ;
            else
            {
                return(new UserResponse());
            }
        }