コード例 #1
0
        public MiddlewareSyncRequest <QcInspectionSync> Create(QcInspectionResponse qc)
        {
            var syncRequest = new MiddlewareSyncRequest <QcInspectionSync>(0, MiddlewareObjectTypes.QcInspection.ToString());
            var qcSync      = QcSync(qc);

            syncRequest.Data = qcSync;
            return(syncRequest);
        }
コード例 #2
0
        public MiddlewareSyncRequest <BusinessPartnerSync> Create(BusinessPartnerIncomingResponse businessPartner)
        {
            var syncRequest = new MiddlewareSyncRequest <BusinessPartnerSync>(0, MiddlewareObjectTypes.Account.ToString());
            var bpSync      = BusinessPartnerSync(businessPartner);

            syncRequest.Data = bpSync;
            return(syncRequest);
        }
コード例 #3
0
        public string Sync <T>(MiddlewareSyncRequest <T> rqeuest) where T : MiddlewareSyncBase
        {
            var middlewareSyncResponse = _restClient.Post <MiddlewareSyncRequest <T>, MiddlewareSyncResponse>("transactions/add", rqeuest);

            if (!string.IsNullOrEmpty(middlewareSyncResponse.ErrorMessage))
            {
                var errorMessage = string.Format("Middleware error occured: {0}", middlewareSyncResponse.ErrorMessage);
                throw new GlobalApiException(errorMessage, "Middleware");
            }
            return(middlewareSyncResponse.TransactionId);
        }