Exemplo n.º 1
0
 public SupermarketsController(ISupermarketRepository supermarketRepository,
                               ICategoryRepository categoryRepository, ISupermarketCategoriesRepository supermarketCategoriesRepository)
 {
     this.supermarketRepository           = supermarketRepository;
     this.categoryRepository              = categoryRepository;
     this.supermarketCategoriesRepository = supermarketCategoriesRepository;
 }
Exemplo n.º 2
0
        public BuyerAI(Buyer buyer, ISupermarketRepository supermarketRepository, IShelfSelectionAlgorithm shelfSelectionAlgorithm,
                       ICashboxSelectionAlgorithm cashboxSelectionAlgorithm)
        {
            if (buyer == null)
            {
                throw new ArgumentNullException(nameof(buyer));
            }

            if (supermarketRepository == null)
            {
                throw new ArgumentNullException(nameof(supermarketRepository));
            }

            if (shelfSelectionAlgorithm == null)
            {
                throw new ArgumentNullException(nameof(shelfSelectionAlgorithm));
            }

            if (cashboxSelectionAlgorithm == null)
            {
                throw new ArgumentNullException(nameof(cashboxSelectionAlgorithm));
            }

            Buyer = buyer;
            _supermarketRepository     = supermarketRepository;
            _shelfSelectionAlgorithm   = shelfSelectionAlgorithm;
            _cashboxSelectionAlgorithm = cashboxSelectionAlgorithm;
            _manualResetEvent          = new ManualResetEvent(false);
        }
Exemplo n.º 3
0
 public StockController(ISupermarketRepository supermarketRepository,
                        IStockPropertyMappingService stockMappingService, ITypeHelperService typeHelperService, IUrlHelper urlHelper)
 {
     _supermarketRepository = supermarketRepository;
     _stockMappingService   = stockMappingService;
     _typeHelperService     = typeHelperService;
     _urlHelper             = urlHelper;
 }
 public ProductsController(ISupermarketRepository supermarketRepository,
                           IProductPropertyMappingService propertyMappingService, ITypeHelperService typeHelperService, IUrlHelper urlHelper)
 {
     _supermarketRepository  = supermarketRepository;
     _propertyMappingService = propertyMappingService;
     _typeHelperService      = typeHelperService;
     _urlHelper = urlHelper;
 }
 public SupermarketController(ISupermarketRepository supermarketRepository,
                              IUrlHelper urlHelper, IPropertyMappingService propertyMappingService, ITypeHelperService typeHelperService,
                              IProductPropertyMappingService productPropertyMappingService, IStaffMemberPropertyMappingService staffMemberPropertyMappingService)
 {
     _supermarketRepository             = supermarketRepository;
     _urlHelper                         = urlHelper;
     _propertyMappingService            = propertyMappingService;
     _typeHelperService                 = typeHelperService;
     _productPropertyMappingService     = productPropertyMappingService;
     _staffMemberPropertyMappingService = staffMemberPropertyMappingService;
 }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            _supermarketRepository = new SupermarketRepository();
            var supermarketProvider = new SupermarketProvider();
            var productSpecProvider = new ProductSpecificationsProvider();

            _buyerProvider             = new BuyerProvider();
            _shelfSelectionAlgorithm   = new ShelfSelectionAlgorithm();
            _cashboxSelectionAlgorithm = new CashboxSelectionAlgorithm();

            _supermarket = supermarketProvider.Provide(productSpecProvider.Provide(30), 5);
            _supermarketRepository.Save(_supermarket);

            EnterBuyers(10);
            Console.ReadLine();
        }
Exemplo n.º 7
0
 public ProductCollectionsController(ISupermarketRepository supermarketRepository, ILogger <SupermarketController> logger)
 {
     _supermarketRepository = supermarketRepository;
     _logger = logger;
 }
 public StaffMemberCollectionsController(ISupermarketRepository supermarketRepository, ILogger <SupermarketController> logger)
 {
     _supermarketRepository = supermarketRepository;
     _logger = logger;
 }
Exemplo n.º 9
0
 public HomeController(ISupermarketRepository supermarketRepository)
 {
     _supermarketRepository = supermarketRepository;
 }
Exemplo n.º 10
0
 public BasketController(ISupermarketRepository supermarketRepository)
 {
     _supermarketRepository = supermarketRepository;
     _basket          = ShoppingBasket.GetBasket(1); // We will need to update to get basket id from DB or Session / cookies etc
     _basket.Products = _supermarketRepository.GetAllLineItemsByBasketId(_basket.BasketId).ToList();
 }