コード例 #1
0
        /// <summary>
        /// Import Supplier purchase order
        /// </summary>
        /// <param name="request"></param>
        /// <param name="organization">Organization Name</param>
        /// <returns></returns>
        public virtual CreateOrUpdateEntityRootResponse CreateSupplierPurchaseOrder(SupplierPurchaseOrderImportRequest request, string organization)
        {
            var response          = new CreateOrUpdateEntityRootResponse();
            var validatorResponse = GetValidatorResponse(request);

            if (!validatorResponse.IsValidRequest)
            {
                response.ValidationError = validatorResponse.ValidationErrors;
                return(response);
            }
            response.CreateOrUpdateEntityResponse = ExecutePostRequest <CreateOrUpdateEntityResponse>(new ProfulfilmentRequestContent
            {
                RequestUri = PrepareRequestUrl("remotewarehouse/imports/importitems.xml"),
                PostData   = ProfulfilmentEntityRequestBody.SupplierPurchaseOrder(request.PurchaseOrder),
                HttpMethod = HttpMethod.Post,
                Headers    = new Dictionary <string, string> {
                    { "organisation", organization }
                }
            });
            return(response);
        }
コード例 #2
0
        /// <summary>
        /// The order import defines a mechanism for importing orders supplied as an XML document.
        /// </summary>
        /// <param name="request">order data to be created</param>
        /// <param name="channel">Channel Name</param>
        /// <returns></returns>
        public virtual CreateOrUpdateEntityRootResponse CreateOrder(ImportOrderRequest request, string channel)
        {
            var response          = new CreateOrUpdateEntityRootResponse();
            var validatorResponse = GetValidatorResponse(request);

            if (!validatorResponse.IsValidRequest)
            {
                response.ValidationError = validatorResponse.ValidationErrors;
                return(response);
            }

            response.CreateOrUpdateEntityResponse = ExecutePostRequest <CreateOrUpdateEntityResponse>(
                new ProfulfilmentRequestContent
            {
                RequestUri = PrepareRequestUrl("remoteorder/imports/importitems.xml"),
                PostData   = ProfulfilmentEntityRequestBody.Order(request),
                HttpMethod = HttpMethod.Post,
                Headers    = new Dictionary <string, string> {
                    { "channel", channel }
                }
            });
            return(response);
        }