示例#1
0
        /// <summary>
        /// Convert the responsecode struct defined in stack to adapter
        /// </summary>
        /// <param name="responseCodeStack">ResponseCode values.</param>
        /// <returns>Return the ResponseCode type defined in adapter</returns>
        private static ResponseCode ConvertFromStackForResponseCode(RESPONSE_CODE responseCodeStack)
        {
            ResponseCode responseCode;

            responseCode = (ResponseCode)responseCodeStack;

            return(responseCode);
        }
        public static string getCheckCodeResponse(string number, string code)
        {
            string checkCode = getCheckCode(number);

            if (checkCode != null && code.Length >= 6)
            {
                return(RESPONSE_CODE.Replace(CODE_PHONE, number).Replace(CODE_CHECK, checkCode).Replace(CODE_ID, getTimeSpan() + "").Replace(CODE_VALIDATE, code));
            }
            return(null);
        }
示例#3
0
        /// <summary>
        /// Create pchc response message.
        /// </summary>
        /// <param name="responseCode">
        /// The response code indicates the hosted cache server response to the client request message
        /// </param>
        /// <returns>Return a pchc response message.</returns>
        public RESPONSE_MESSAGE CreateResponseMessage(RESPONSE_CODE responseCode)
        {
            RESPONSE_MESSAGE responseMessage;

            // Size (4 bytes):  Total message size in bytes, excluding this field.
            // ResponseCode (1 byte):  A code that indicates the server response to the client request message.
            responseMessage.TransportHeader.Size = 1;
            responseMessage.ResponseCode         = responseCode;

            if (this.logger != null)
            {
                this.logger.AddDebug(string.Format(
                                         "Pchc response message is created with reposne code: {0}",
                                         (RESPONSE_CODE)responseCode));
            }

            return(responseMessage);
        }
示例#4
0
 public ResponseModel(T t, bool success, RESPONSE_CODE code)
 {
     this.message = t;
     this.success = success;
     this.code    = code;
 }
        /// <summary>
        /// Create pchc response message.
        /// </summary>
        /// <param name="responseCode">
        /// The response code indicates the hosted cache server response to the client request message
        /// </param>
        /// <returns>Return a pchc response message.</returns>
        public RESPONSE_MESSAGE CreateResponseMessage(RESPONSE_CODE responseCode)
        {
            RESPONSE_MESSAGE responseMessage;

            // Size (4 bytes):  Total message size in bytes, excluding this field.
            // ResponseCode (1 byte):  A code that indicates the server response to the client request message.
            responseMessage.TransportHeader.Size = 1;
            responseMessage.ResponseCode = responseCode;

            if (this.logger != null)
            {
                this.logger.AddDebug(string.Format(
                    "Pchc response message is created with reposne code: {0}",
                    (RESPONSE_CODE)responseCode));
            }

            return responseMessage;
        }
        /// <summary>
        /// Convert the responsecode struct defined in stack to adapter
        /// </summary>
        /// <param name="responseCodeStack">ResponseCode values.</param>
        /// <returns>Return the ResponseCode type defined in adapter</returns>
        private static ResponseCode ConvertFromStackForResponseCode(RESPONSE_CODE responseCodeStack)
        {
            ResponseCode responseCode;
            responseCode = (ResponseCode)responseCodeStack;

            return responseCode;
        }