public MainForm() { _priceListRepository = new SqlPriceListRepository(connectionString); _roomRepository = new SqlRoomRepository(connectionString); _bookingRepository = new SqlBookingRepository(connectionString); InitializeComponent(); }
public HomeController( IPromotionRepository promotionRepository, IPhotoRepository photoRepository, IPriceListRepository priceListRepository ) { _promotionRepository = promotionRepository; _photoRepository = photoRepository; _priceListRepository = priceListRepository; }
public PriceListApp(IPriceListRepository priceListRepository, IUnitOfWork unitOfWork, INotifier notifier) : base(unitOfWork, notifier) { _priceListRepository = priceListRepository; }
public PriceListController(IPriceListRepository repository, ILogger <PriceListController> logger) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
internal static int GetTotal(IDictionary <string, int> scannedSkus, ISpecialOfferRepository offers, IPriceListRepository priceList) { var total = 0; foreach (var sku in scannedSkus.Keys) { var numberOfItemsScannedForSku = scannedSkus[sku]; var specialOffer = offers.GetOfferFor(sku); if (specialOffer.Found) { var offer = specialOffer.Offer; var numberOfTimeSpecialOfferScanned = numberOfItemsScannedForSku / offer.Quantity; total += offer.Price * numberOfTimeSpecialOfferScanned; numberOfItemsScannedForSku -= offer.Quantity * numberOfTimeSpecialOfferScanned; } total += priceList.GetPriceFor(sku) * numberOfItemsScannedForSku; } return(total); }
public TotalCalculator(IDisplay display, IPriceListRepository priceListRepository) { _display = display; _priceListRepository = priceListRepository; }
public Cart() { _priceList = new PriceListRepository(); _offers = new SpecialOfferRepository(); }
public PriceListController(IPriceListRepository priceListRepository) { this._priceListRepository = priceListRepository; }