Ejemplo n.º 1
0
        /// <summary>
        /// 按错误数据创建输出对象
        /// </summary>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        public static SyncResponse GetErrorResponseData(string errorMsg, object data, SyncRequest request = null)
        {
            SyncResponse response = new SyncResponse();

            response.Success  = false;
            response.ErrorMsg = errorMsg;
            if (request != null)
            {
                response.RequestID = request.ID;
            }
            else
            {
                response.RequestID = "";
            }
            response.Data = data;
            return(response);
        }
Ejemplo n.º 2
0
        public static SyncResponse GetResponse(SyncRequest request, object data)
        {
            SyncResponse response = new SyncResponse();

            response.Success  = true;
            response.ErrorMsg = "";
            if (request != null)
            {
                response.RequestID = request.ID;
            }
            else
            {
                response.RequestID = "";
            }
            response.Data = data;
            return(response);
        }