public ProductsController(IRepository<Product> productRepository, IProductsService productsService, ICategoriesService categoriesService, IMaterialsService materialsService)
 {
     this.productRepository = productRepository;
     this.productsService = productsService;
     this.categoriesService = categoriesService;
     this.materialsService = materialsService;
 }
 public ShoppingService(IRepository<ShoppingCart> shoppingCarts,
     IRepository<Product> products, IRepository<Order> orders, IProductsService productService)
     : base(products)
 {
     this.shoppingCarts = shoppingCarts;
     this.orders = orders;
     this.productService = productService;
 }
        public ProductsScreen()
        {
            InitializeComponent();

            _productsService = ObjectLocator.GetInstance<IProductsService>();
            _eventAggregator = ObjectLocator.GetInstance<IEventAggregator>();

            _eventAggregator.AddListener<ProductsUpdatedEvent>(x => gridProducts.DataSource = _productsService.GetAllProducts());
        }
 public HomeController(
     IProductsService productsService, 
     ICacheService cacheService,
     ICategoriesService categoriesService)
 {
     this.productsService = productsService;
     this.categoriesService = categoriesService;
     this.Cache = cacheService;
 }
 public SellersController(
     IUsersService usersService,
     IRolesService rolesService,
     IUserRolesService<ApplicationUserRole> userRolesService,
     ICommentsService commentsService,
     IVotesService votesService,
     IProductsService productsService) 
     : base(usersService, rolesService, userRolesService, commentsService, votesService, productsService)
 {
 }
 public ProductsController(
     IProductsService productsService,
     IIdentifierProvider identifierProvider,
     IVotesService votesService,
     IMappingService mappingService)
 {
     this.productsService = productsService;
     this.votesService = votesService;
     this.identifierProvider = identifierProvider;
     this.mappingService = mappingService;
 }
		public ProductsScreen()
		{
			InitializeComponent();

			WindowHelper.CheckAndApplyTheme(this);

			_productsService = ObjectLocator.GetInstance<IProductsService>();
			_eventAggregator = ObjectLocator.GetInstance<IEventAggregator>();

			_eventAggregator.AddListener<ProductsUpdatedEvent>(x => gridProducts.ItemsSource = _productsService.GetAllProducts());
		}
        //private ISearchRefinementHelpers<ProductOfCategoryViewModel, SearchFilterForCategoryViewModel> searchAlgorithms;

        public SearchController(
            ICacheService cacheService,
            IProductsService productsService,
            ISearchFiltersService searchFiltersService,
            ICategoriesService categoriesService,
            ISearchFilterHelpers filterStringHelpers
            //ISearchRefinementHelpers<ProductOfCategoryViewModel, SearchFilterForCategoryViewModel> searchAlgorithms
            )
        {
            this.Cache = cacheService;
            this.productsService = productsService;
            this.searchFiltersService = searchFiltersService;
            this.categoriesService = categoriesService;
            this.filterStringHelpers = filterStringHelpers;
            //this.searchAlgorithms = searchAlgorithms;
        }
        public ActionResult All(string sortOrder, string currentFilter, string searchString, int? page)
        {
            ViewBag.CurrentSort = sortOrder;
            ViewBag.PriceSortParm = string.IsNullOrEmpty(sortOrder) ? "Price" : string.Empty;
            ViewBag.NameSortParm = sortOrder == "Name" ? "name_desc" : "Name";

            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            ViewBag.CurrentFilter = searchString;

            var products = this.products
                .AllProducts()
                .ProjectTo<ProductDetailsViewModel>();

            if (!string.IsNullOrEmpty(searchString))
            {
                products = products.Where(s => s.Name.Contains(searchString));
            }

            switch (sortOrder)
            {
                case "Name":
                    products = products.OrderBy(n => n.Name);
                    break;
                case "name_desc":
                    products = products.OrderByDescending(n => n.Name);
                    break;
                case "Price":
                    products = products.OrderBy(n => n.Price);
                    break;
                default:
                    products = products.OrderByDescending(n => n.Price);
                    break;
            }

            int pageNumber = page ?? 1;

            return this.View(products.ToPagedList(pageNumber, PageSize));
        }
        public ProductListViewModel(IMessenger messenger, IProductsService productService)
        {
            // Design Setup
            if (this.IsInDesignMode)
            {
                var product = new Product();
                product.ProductId = 1;
                product.Name = "Product";
                product.Price = 100;

                Products = new Product[] { product, product, product, product, product, product };
            }

            // Unpack
            _productService = productService;
            MessengerInstance = messenger;

            // Events
            MessengerInstance.Register<SearchMessage>(this, HandleSearch);

            // Commands
            ViewProductCommand = new RelayCommand<Product>(ViewProductExecute);
        }
Exemple #11
0
 public SearchService(IOrdersService ordersService, IProductsService productsService, ICustomersService customersService)
 {
     this.ordersService    = ordersService;
     this.productsService  = productsService;
     this.customersService = customersService;
 }
 public OrdersController(IProductsService productsService)
 {
     this.ordersService = productsService;
 }
 public SpecTrainingController(IUserTrainingsService userTrainings, IProductsService products)
 {
     this.userTrainings = userTrainings;
     this.products = products;
 }
 public ProductsController(IBusPublisher busPublisher,
                           IProductsService productsService) : base(busPublisher)
 {
     _productsService = productsService;
 }
 public OrdersController(IProductsService productsService, IOrdersService ordersService)
     : base(productsService)
 {
     this.ordersService = ordersService;
 }
 public ProductsController(IProductsService proxy)
 {
     this.Proxy = proxy;
 }
 public ProductsController(IProductsService service)
 {
     this.service = service;
 }
 public ProductsController(IUsersService usersService, IProductsService productsService)
 {
     _usersService    = usersService;
     _productsService = productsService;
 }
Exemple #19
0
 public HomeController(IProductsService productsService)
 {
     this.productsService = productsService;
 }
 public SubcategoriesController(IProductsService productsService, ISubcategoriesService subcategoriesService)
 {
     this.productsService      = productsService;
     this.subcategoriesService = subcategoriesService;
 }
Exemple #21
0
 public OrderProductsController(IProductsService productsService)
 {
     this.productsService = productsService;
 }
Exemple #22
0
 public ProductMutations([Service] IProductsService productsService)
 {
     _productsService = productsService;
 }
Exemple #23
0
 public CreateOrderHandler(ICartService cartService, IOrdersService ordersService, IProductsService productsService)
 {
     _cartService     = cartService;
     _ordersService   = ordersService;
     _productsService = productsService;
 }
 public ProductsController(IProductsService productsService, IOrdersService ordersService, IMapper mapper)
 {
     _productsService = productsService;
     _ordersService   = ordersService;
     _mapper          = mapper;
 }
 public BaseController(IProductsService productsService)
 {
     this.productsService = productsService;
 }
Exemple #26
0
 public ProductsController(IProductsService productsService, IOrdersService OrdersService, IIngredientsService ingredientsService)
 {
     this.productsService    = productsService;
     this.ingredientsService = ingredientsService;
     this.ordersService      = OrdersService;
 }
 public ProductController(IProductsService products)
 {
     this.products = products;
 }
Exemple #28
0
 public Products(IProductsService productsProxy)
 {
     this.ProductsProxy = productsProxy;
 }
 public ProductsQueryHandler(IMapper mapper, IProductsService productsService)
 {
     _mapper          = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _productsService = productsService ?? throw new ArgumentNullException(nameof(productsService));
 }
 public IndexModel(IProductsService productsService)
 {
     this.productsService = productsService;
 }
 public ShoppingCartsService(UniShopDbContext context, IUniShopUsersService usersService, IProductsService productsService)
 {
     this.context         = context;
     this.usersService    = usersService;
     this.productsService = productsService;
 }
        public OrderController(IOrdersService ordersService, IFullContactInfosService fullContactInfosService, IProductsService productService)
        {
            Guard.WhenArgument(ordersService, "ordersService").IsNull().Throw();
            Guard.WhenArgument(fullContactInfosService, "fullContactInfoService").IsNull().Throw();
            Guard.WhenArgument(productService, "productService").IsNull().Throw();

            this.ordersService           = ordersService;
            this.fullContactInfosService = fullContactInfosService;
            this.productService          = productService;
        }
    public static Autofac.IContainer CreateContainer(IEnumerable <IEndPointConfiguration> endPoints, string apiName, Action <string> logger)
    {
        /*
         * AdaptiveClient filters the collection of EndPoints that is registered and only uses the ones where IsActive = true.
         * However, for this demo app we want to force AdaptiveClient to encounter EndPoints that throw exceptions.
         * To do this we create a copy of the EndPoints list (fakeEndPoints) and set IsActive to true for each EndPoint in the copied list.
         * This effectively fools AdaptiveClient into thinking that all EndPoints are valid and should be used.
         * At the end of this method we look in the original EndPoint list and create service mocks for EndPoints where IsActive = false.
         * The resulting functionality is that AdaptiveClient attempts to use every EndPoint that is registered.  When it encounters a mock
         * it fails and tries to use the next EndPoint.
         */

        List <IEndPointConfiguration> fakeEndPoints = new List <IEndPointConfiguration>();

        foreach (IEndPointConfiguration ep in endPoints)
        {
            fakeEndPoints.Add(new PresentationEndPoint(ep)
            {
                IsActive = true
            });
        }

        ContainerBuilder builder = new ContainerBuilder();

        builder.RegisterModule(new AutofacModule());
        builder.RegisterModule(new LeaderAnalytics.AdaptiveClient.EntityFrameworkCore.AutofacModule());
        RegistrationHelper registrationHelper = new RegistrationHelper(builder);

        registrationHelper
        .RegisterEndPoints(fakeEndPoints)
        .RegisterModule(new Zamagon.Services.Common.AdaptiveClientModule());

        if (apiName == API_Name.BackOffice || apiName == null)
        {
            registrationHelper.RegisterModule(new Zamagon.Services.BackOffice.AdaptiveClientModule());
        }

        if (apiName == API_Name.StoreFront || apiName == null)
        {
            registrationHelper.RegisterModule(new Zamagon.Services.StoreFront.AdaptiveClientModule());
        }


        if (logger != null)
        {
            registrationHelper.RegisterLogger(logger);
        }

        // Create mocks
        Mock <IOrdersService> ordersServiceMock = new Mock <IOrdersService>();

        ordersServiceMock.Setup(x => x.GetOrders()).Throws(new Exception("Mock failure"));
        IOrdersService ordersService = ordersServiceMock.Object;

        Mock <IProductsService> productsServiceMock = new Mock <IProductsService>();

        productsServiceMock.Setup(x => x.GetProducts()).Throws(new Exception("Mock failure"));
        IProductsService productsService = productsServiceMock.Object;

        Mock <IEmployeesService> empServiceMock = new Mock <IEmployeesService>();

        empServiceMock.Setup(x => x.GetEmployees()).Throws(new Exception("Mock failure"));
        IEmployeesService empService = empServiceMock.Object;

        Mock <ITimeCardsService> tcServiceMock = new Mock <ITimeCardsService>();

        tcServiceMock.Setup(x => x.GetTimeCards()).Throws(new Exception("Mock failure"));
        ITimeCardsService tcService = tcServiceMock.Object;

        // look at the list of endPoints that was passed to us and register a mock for each
        // one that is not marked active

        foreach (IEndPointConfiguration ep in endPoints.Where(x => !x.IsActive))
        {
            builder.RegisterInstance(ordersService).Keyed <IOrdersService>(ep.EndPointType + ep.ProviderName);
            builder.RegisterInstance(productsService).Keyed <IProductsService>(ep.EndPointType + ep.ProviderName);
            builder.RegisterInstance(empService).Keyed <IEmployeesService>(ep.EndPointType + ep.ProviderName);
            builder.RegisterInstance(tcService).Keyed <ITimeCardsService>(ep.EndPointType + ep.ProviderName);
        }

        return(builder.Build());
    }
 public CartController(IProductsService productsService)
 {
     this.productsService = productsService;
 }
 public SportsController(IProductsService productsService)
     : base(productsService)
 {
 }
Exemple #36
0
 public EventInfoService(ApplicationDbContext db, IProductsService productsService)
 {
     _db = db;
     _productsService = productsService;
 }
Exemple #37
0
 public ProductController(IProductsService productService)
 {
     _productService = productService;
 }
 public ManageController(IProductsService products, ITrainingsService trainings, IDishesService dishes)
 {
     this.products = products;
     this.trainings = trainings;
     this.dishes = dishes;
 }
 public SearchService(IOrdersService orderService, IProductsService productsService, ICustomersService customersService)
 {
     _orderService     = orderService;
     _productsService  = productsService;
     _customersService = customersService;
 }
Exemple #40
0
 public ProductsController(IProductsService productsService, ICategoriesService categoriesService)
 {
     _productsService   = productsService;
     _categoriesService = categoriesService;
 }
 public SyncController(IProductsService productsService)
 {
     _productsService = productsService;
 }
 public DiscountController(IProductsService productsService)
 {
     _productService = productsService;
 }
 public BuyController(IProductsService productsService, IShoppingService shoppingService)
     : base(productsService)
 {
     this.shoppingService = shoppingService;
 }
 public ProductsController(IProductsService <Products> service, IMapper mapper)
 {
     this.service = service;
     this.Mapper  = mapper;
 }
 public LikesController(IProductsService productsService)
     : base(productsService)
 {
 }
 protected override IEnumerable <Product> Handle(IProductsService productsService, string room, string category, string search, bool rangeProvided, int from, int to)
 {
     return(productsService.GetLatestProducts(productsAmount));
 }
 public DishController(IDishesService dishes, IProductsService products)
 {
     this.dishes = dishes;
     this.products = products;
 }
 public ProductsController(IProductsService s1)
 {
     productService = s1;
 }
 public BrandsController(IProductsService productsService)
     : base(productsService)
 {
 }
 public FilesController(ILogger <FilesController> logger, IFilesService filesService, IProductsService productsService, IInventoryService inventoryService)
 {
     _filesService     = filesService;
     _productsService  = productsService;
     _inventoryService = inventoryService;
     _inventoryService.Subscribe(_filesService);
     _productsService.Subscribe(_filesService);
     _logger = logger;
 }
 public ProductController(IUsersService users, IProductsService products)
     : base(users)
 {
     this.products = products;
 }
 public CategoriesController(IProductsService service)
 {
     _service = service;
 }
Exemple #53
0
 public ProductController(IProductsService productsService, IMapper mapper)
 {
     _productsService = productsService;
     _mapper          = mapper;
 }
Exemple #54
0
 public Products(IProductsService productsProxy)
 {
     this.ProductsProxy = productsProxy;
 }
 public HomeController(INewsService newsService, IProductsService productsService, ICacheService cacheService)
 {
     this.newsService = newsService;
     this.productsService = productsService;
     this.cacheService = cacheService;
 }
Exemple #56
0
 public ProductsController(IProductsService productsService)
 {
     _productsService = productsService;
 }
 public SearchController(ICustomersService customersService, IProductsService productsService, ISalesServices salesServices)
 {
     this.customersService = customersService;
     this.productsService  = productsService;
     this.salesServices    = salesServices;
 }
 public GetSortedProductsQueryHandler(IProductsService productsService, IRecommendationEngine engine)
 {
     _productsService = productsService;
     _engine          = engine;
 }
 public HomeController(ILogger <HomeController> logger, IOrdersService ordersService, IProductsService productsService)
 {
     _logger          = logger;
     _ordersService   = ordersService;
     _productsService = productsService;
 }
 public CommentsController(IProductsService productsService)
     : base(productsService)
 {
 }