public void MapMaterialIdsToResponse(ProductSpecResponse response) { var request = new ProductRequirementSpecificationByVersionUUIDQueryMessage_sync(); request.ProductRequirementSpecificationByVersionUUID = new ProductSpecManageService.UUID[response.ProductSpec.Count]; foreach (var spec in response.ProductSpec) { int index = response.ProductSpec.IndexOf(spec); request.ProductRequirementSpecificationByVersionUUID[index] = new ProductSpecManageService.UUID(); request.ProductRequirementSpecificationByVersionUUID[index].Value = spec.VersionUUID; } var productSpecList = _manageClient.ReadPRS(request); //TODO check if read call failed foreach (var spec in productSpecList.ProductRequirementSpecification) { foreach (var res in response.ProductSpec) { if (Int32.Parse(spec.ID.Value) == Int32.Parse(res.ProductSpecId)) { res.MaterialId = spec.RequirementObject[0].RequirementObjectMaterial.RequirementObjectMaterialKey.ProductID.Value; } } } }
public string GetProductSpecFromList(ProductSpecResponse productSpecList, string productId) { string mappedSpec = ""; foreach (var spec in productSpecList.ProductSpec) { if (spec.MaterialId.Equals(productId)) { mappedSpec = spec.ProductSpecId; } } return(mappedSpec); }
public ProductSpecResponse ParseProductSpecResponse(PRSMaintainConfirmationBundleMessage_sync response) { ProductSpecResponse parsedResponse = new ProductSpecResponse(); BaseResponse tempRes = SapLogParser.ParseSapResponseLog(response.Log); parsedResponse.Errors = tempRes.Errors; parsedResponse.Warnings = tempRes.Warnings; parsedResponse.ProductSpec = new List <ProductSpecObject>(); if (response.ProductRequirementSpecification != null) { foreach (var spec in response.ProductRequirementSpecification) { parsedResponse.ProductSpec.Add(new ProductSpecObject { ProductSpecId = spec.ID.Value, VersionUUID = spec.VersionUUID.Value }); } } return(parsedResponse); }