Beispiel #1
0
        /// <summary>
        /// Save password
        /// </summary>
        /// <returns></returns>
        public static ResponseStatus SavePassword(UserAccess inUser)
        {
            ResponseStatus response = new ResponseStatus();

            UserAccess user = new UserAccess();

            user.UserID   = inUser.UserID;
            user.Salt     = inUser.Salt;
            user.Password = inUser.Password;

            // Check if user exists
            // We need to create a second occurrence.

            UserAccess userRead = new UserAccess();

            var readuser = userRead.Read(inUser.UserID);

            if (readuser.ReturnCode == 0001 && readuser.ReasonCode == 0001)
            {
                response = user.UpdatePassword();
                return(response);
            }

            if (readuser.ReturnCode == 0001 && readuser.ReasonCode == 0002)
            {
                response.ReturnCode = -0010;
                response.ReasonCode = 0001;
                response.Message    = "User not found.";
                response.UniqueCode = ResponseStatus.MessageCode.Error.FCMERR00009999;
                return(response);
            }

            if (readuser.ReturnCode < 0000)
            {
                response = readuser;
            }

            return(response);
        }