private static GetParentKitDataResponse GetParentProductKit(GetParentKitDataRequest request) { GetKitComponentsProcedure getKitComponentsProcedure = new GetKitComponentsProcedure(request); PagedResult <KitComponent> kitComponents = getKitComponentsProcedure.Execute(); return(new GetParentKitDataResponse(kitComponents)); }
private void GetKits( IList <long> masterIds, IList <long> kitMasterIds, IList <long> productIdsForKitComponentLookup, out ReadOnlyCollection <KitDefinition> kitDefinitions, out ReadOnlyCollection <KitComponent> kitComponentAndSubstituteList, out ReadOnlyCollection <KitConfigToComponentAssociation> kitConfigToComponentAssociations, out ReadOnlyCollection <KitComponent> parentKitsComponentInfo) { // kits var getKitsRequest = new GetProductKitDataRequest(kitMasterIds); var getKitsResponse = this.request.RequestContext.Execute <GetProductKitDataResponse>(getKitsRequest); // handle kit response kitDefinitions = getKitsResponse.KitDefinitions; kitComponentAndSubstituteList = getKitsResponse.KitComponentAndSubstituteList; kitConfigToComponentAssociations = getKitsResponse.KitConfigToComponentAssociations; // depending on data level, we need to retrieve more information if (this.request.Criteria.DataLevel >= CommerceEntityDataLevel.Complete) { var getKitParentRequest = new GetParentKitDataRequest(productIdsForKitComponentLookup, masterIds); getKitParentRequest.QueryResultSettings = QueryResultSettings.AllRecords; var kitParentResponse = this.request.RequestContext.Execute <GetParentKitDataResponse>(getKitParentRequest); parentKitsComponentInfo = kitParentResponse.KitComponents.Results; } else { parentKitsComponentInfo = new ReadOnlyCollection <KitComponent>(new List <KitComponent>()); } }
/// <summary> /// Initializes a new instance of the <see cref="GetKitComponentsProcedure"/> class. /// </summary> /// <param name="request">The request message.</param> public GetKitComponentsProcedure(GetParentKitDataRequest request) { this.request = request; }