Example #1
0
        private IList <AllergyInformation> MapAllergyInformation(ProductGWO source)
        {
            IList <AllergyInformation> allergyInformation = new List <AllergyInformation>();

            foreach (var allergyInfoGwo in source.Allergies)
            {
                var ingredient = IngredientApplicationService.FindIngredient(allergyInfoGwo.SubstanceName, true, true);
                allergyInformation.Add(new AllergyInformation
                {
                    Allergene = ingredient,
                    Remark    = allergyInfoGwo.Remark
                });
            }
            return(allergyInformation);
        }
Example #2
0
        public override Product Map(ProductGWO source)
        {
            var brand = MapBrandByName(source.Trademark.Replace("®", ""), false);

            if (brand.Owner == null)
            {
                var company = MapCompanyByName(source.Supplier);
                brand.Owner = company;
            }
            var originCountry = MapOriginCountry(source.Origin);

            var allergyInformation = MapAllergyInformation(source);

            var ingredients = IngredientApplicationService.FindIngredientsForTableOfContents(source.Content);

            var markingNames = from marking in source.Markings
                               select marking.MarkName;
            var certificationMarks = MapCertificationMarks(source.Markings);//MapMarkingNames(markingNames);


            var mappedProduct = new Product
            {
                AllergyInformation = allergyInformation,
                CertificationMarks = certificationMarks,
                Brand                 = brand,
                Description           = "",
                GlobalTradeItemNumber = source.EAN,
                Ingredients           = ingredients,
                OriginCountry         = originCountry,
                ProductName           = source.Name,
                //Quantity =
                QuantityUnit          = source.WeightVolume,
                TableOfContent        = source.Content,
                LastUpdated           = DateTime.Now,
                Durability            = source.Durability,
                ImageUrlLarge         = source.ImageURL_Jpg300px,
                ImageUrlMedium        = source.ImageURL_Jpg150px,
                ImageUrlSmall         = source.ImageURL_Jpg66px,
                Nutrition             = source.Nutrition,
                SupplierArticleNumber = source.SuppArtNo
            };

            return(mappedProduct);
        }