public override Task <Order> PrintAdvertAndUpdateOrder(Order order)
        {
            var advert = new Advert {
                CreatedOn = DateTime.Now,
                Heading   = "County Diner",
                Content   = "Kids eat free every Thursday night"
            };

            order.Advert = advert;
            _printer.PrintCustom(advert);
            order.Status = "Complete";
            return(Task.FromResult(order));
        }
        public override async Task <Order> PrintAdvertAndUpdateOrder(Order order)
        {
            var deal   = _dealService.GenerateDeal(DateTime.Now);
            var biz    = _randomHelper.GetRandomValueFromList(LocalBusiness.AllBusinesses);
            var result = await _chamberOfCommerceApi.GetImageAndThumbnailDataFor(District.Middleton);

            var advert = new Advert {
                CreatedOn = DateTime.Now,
                Heading   = $"Middleton {biz}",
                Content   = $"Get {Math.Round(deal * 100, 2)}% off your next purchase!",
                ImageUrl  = result.ThumbnailUrl
            };

            order.Advert = advert;
            _printer.PrintCustom(advert);
            order.Status = "Complete";
            return(order);
        }
        public override Task <Order> PrintAdvertAndUpdateOrder(Order order)
        {
            if (_dateTimeResolver.IsItTheWeekend())
            {
                _printer.PrintDefault(null);
            }

            var advert = new Advert {
                Heading   = "Downtown Coffee Roasters",
                CreatedOn = DateTime.Now,
                Content   = "Get a free coffee drink when you buy 1lb of coffee beans"
            };

            order.Advert = advert;
            _printer.PrintCustom(advert);
            order.Status = "Complete";

            return(Task.FromResult(order));
        }
Exemple #4
0
        public override async Task <Order> PrintAdvertAndUpdateOrder(Order order)
        {
            var advert = new Advert();

            advert.CreatedOn = DateTime.Now;
            advert.Heading   = "Cambridge Bakery";
            advert.Content   = "Custom Birthday and Wedding Cakes";
            if (_dateResolver.IsItTuesday())
            {
                var result = await _chamberOfCommerceApi.GetImageAndThumbnailDataFor("Middleton");

                advert.ImageUrl = result.ThumbnailUrl;
            }
            order.Advert = advert;
            _printer.PrintCustom(advert);
            order.Status = "Complete";

            return(order);
        }