Esempio n. 1
0
        public void Create()
        {
            lines = new List <ImportLine>();

            partner = partnerRepository.GetByCode(feedImporter.PartnerCode);

            trends         = new List <Trend>(trendRepository.GetCurrentTrends());
            silouhettes    = new List <Silouhette>(silouhetteRepository.GetAll());
            patterns       = new List <Pattern>(patternRepository.GetAll());
            colorFamilies  = new List <ColorFamily>(colorFamilyRepository.GetAll());
            outfitUpdaters = new List <OutfitUpdater>(outfitUpdaterRepository.GetFor(partner));

            // Retrieve Keywords
            colorFamilyKeywords = colorFamilyRepository.GetKeywordsByPartner(partner);
            patternKeywords     = patternRepository.GetKeywordsByPartner(partner);
            silouhetteKeywords  = silouhetteRepository.GetKeywordsByPartner(partner);

            // Set discard words
            wordsForDiscard.Add("men");
            wordsForDiscard.Add("mens");
            wordsForDiscard.Add("men's");
            wordsForDiscard.Add("men´s");
            wordsForDiscard.Add("kid");
            wordsForDiscard.Add("kids");
            wordsForDiscard.Add("kid's");
            wordsForDiscard.Add("infant");
            wordsForDiscard.Add("girl");
            wordsForDiscard.Add("boy");
            wordsForDiscard.Add("girls");
            wordsForDiscard.Add("boys");
            wordsForDiscard.Add("girl’s");
            wordsForDiscard.Add("boy’s");
            wordsForDiscard.Add("girl's");
            wordsForDiscard.Add("boy's");
            wordsForDiscard.Add("Toddler");
            wordsForDiscard.Add("4-6X");
            wordsForDiscard.Add("Newborn");
            wordsForDiscard.Add("Bedding Collection");
            wordsForDiscard.Add("Sleep Sense");
            wordsForDiscard.Add("7-16");
            wordsForDiscard.Add("Pajamas");
            wordsForDiscard.Add("Bra");
            wordsForDiscard.Add("Hipster");
            wordsForDiscard.Add("8-20");
            wordsForDiscard.Add("swimsuit");
            wordsForDiscard.Add("luggage");
            wordsForDiscard.Add("table linens");
            wordsForDiscard.Add("2T-10");
            wordsForDiscard.Add("China");
            wordsForDiscard.Add("stemwear");
            wordsForDiscard.Add("cuff links");
            wordsForDiscard.Add("Noritake");
            wordsForDiscard.Add("Jasmine & Ginger");

            _logger.InfoFormat("Looping through file");
            feedImporter.FeedLineRead += new FeedLineReadEventHandler(ouImportationClassBuilder_FeedLineRead);
            feedImporter.ProcessFeed();

            CheckToSaveLines();
        }
        public void UpdateFeeds()
        {
            try
            {
                logger.InfoFormat("Starting to update feeds");
                OUImportationController temp = new OUImportationController(new ZapposClassBuilder(), outfitUpdaterRepository, trendRepository, silouhetteRepository, patternRepository, colorFamilyRepository);
                temp.HaveHeader = true;
                temp.Separator  = "\t";
                temp.Filename   = "Zappos_Complete.txt";
                temp.Partner    = partnerRepository.GetByCode("ZP");
                temp.MemorySafe = Convert.ToDouble(5);

                logger.InfoFormat("Starting to import");
                temp.Create();

                logger.InfoFormat("Match updaters");
                MatchOutfitUpdaters();
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                throw ex;
            }
        }