コード例 #1
0
        protected void ImportClick(object sender, EventArgs e)
        {
            string[] isbnNumbers = LoadIsbnNumbers().ToArray();

            WipePriceDatabase();

            var collection = PriceHarvestRepository.MongoCollection();

            foreach (string isbnNumber in isbnNumbers)
            {
                var pricingService = new PricingService(new ConsoleLog());

                var pricingDetails = new PricingDetails()
                {
                    IsbnNumber = isbnNumber
                };

                foreach (Currency currency in pricingService.Currencies)
                {
                    var price = pricingService.FindPriceByIsbn(isbnNumber, currency);

                    PricingMapper.Map(isbnNumber, price, pricingDetails);
                }

                collection.Insert(pricingDetails);
            }
        }
コード例 #2
0
ファイル: PriceHarvest.aspx.cs プロジェクト: Trayek/informa
        protected void ImportClick(object sender, EventArgs e)
        {
            string[] isbnNumbers = LoadIsbnNumbers().ToArray();

            WipePriceDatabase();

            var collection = PriceHarvestRepository.MongoCollection();

            foreach (string isbnNumber in isbnNumbers)
            {
                var pricingService = new PricingService(new ConsoleLog());

                var pricingDetails = new PricingDetails()
                {
                    IsbnNumber = isbnNumber
                };

                foreach (Currency currency in pricingService.Currencies)
                {
                    var price = pricingService.FindPriceByIsbn(isbnNumber, currency);

                    PricingMapper.Map(isbnNumber, price, pricingDetails);
                }

                collection.Insert(pricingDetails);
            }
        }
コード例 #3
0
        private static PricingCurrencyDetails GetApiPrices(string isbn, string currency)
        {
            Endpoints.PricingService service = new Endpoints.PricingService(new ConsoleLog());

            var result = service.FindPriceByIsbn(isbn);

            return SelectCurrency(PricingMapper.Map(isbn, result), currency);
        }
コード例 #4
0
        private static PricingCurrencyDetails GetApiPrices(string isbn, string currency)
        {
            Endpoints.PricingService service = new Endpoints.PricingService(new ConsoleLog());

            var result = service.FindPriceByIsbn(isbn);

            return(SelectCurrency(PricingMapper.Map(isbn, result), currency));
        }