public MiddlewareSyncRequest <QcInspectionSync> Create(QcInspectionResponse qc) { var syncRequest = new MiddlewareSyncRequest <QcInspectionSync>(0, MiddlewareObjectTypes.QcInspection.ToString()); var qcSync = QcSync(qc); syncRequest.Data = qcSync; return(syncRequest); }
public MiddlewareSyncRequest <BusinessPartnerSync> Create(BusinessPartnerIncomingResponse businessPartner) { var syncRequest = new MiddlewareSyncRequest <BusinessPartnerSync>(0, MiddlewareObjectTypes.Account.ToString()); var bpSync = BusinessPartnerSync(businessPartner); syncRequest.Data = bpSync; return(syncRequest); }
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); }