コード例 #1
0
ファイル: FilesViewModel.cs プロジェクト: hva/warehouse.net
        public FilesViewModel(IFilesRepository filesRepository, IAuthStore authStore, IProductsRepository productsRepository, 
            Func<CreateFileViewModel> createFactory, Func<EditFileViewModel> editFactory)
        {
            this.filesRepository = filesRepository;
            this.productsRepository = productsRepository;
            this.createFactory = createFactory;
            this.editFactory = editFactory;

            var token = authStore.LoadToken();
            if (token != null)
            {
                IsEditor = token.IsEditor();
                IsAdmin = token.IsAdmin();
            }

            cvs = new CollectionViewSource();
            items = new ObservableCollection<FileDescription>();
            cvs.Source = items;
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("Id", ListSortDirection.Ascending));

            editRequest = new InteractionRequest<IConfirmation>();
            BrowseCommand = new DelegateCommand(Browse);
            EditCommand = new DelegateCommand<FileDescription>(Edit);

            deleteCommand = new DelegateCommand(PromtDelete, HasSelectedItems);
            deleteRequest = new InteractionRequest<Confirmation>();
        }
コード例 #2
0
 public NorthwindUnitOfWork()
 {
     _dbContext = new NorthwindSlim();
     _productsRepository = new ProductsRepository(_dbContext);
     _customersRepository = new CustomersRepository(_dbContext);
     _ordersRepository = new OrdersRepository(_dbContext);
 }
コード例 #3
0
 public ProductsController(IProductsRepository productsRepository)
 {
     this.productsRepository = productsRepository;
     //  productsRepository = new FakeProductsRepository();
     //            string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Trusted_Connection=yes;";
     //            productsRepository = new SqlSportsRepository(connectionString);
 }
コード例 #4
0
ファイル: MainViewModel.cs プロジェクト: hva/warehouse.net
        public MainViewModel(IEventAggregator eventAggregator, ISignalRClient signalRClient, IAuthStore authStore,
            IProductsRepository productsRepository)
        {
            this.eventAggregator = eventAggregator;
            this.signalRClient = signalRClient;
            this.productsRepository = productsRepository;

            deleteRequest = new InteractionRequest<Confirmation>();
            CreateProductCommand = new DelegateCommand(CreateProduct);
            OpenProductCommand = new DelegateCommand<Product>(EditProduct);
            changePriceCommand = new DelegateCommand(ChangePrice, HasSelectedProducts);
            deleteCommand = new DelegateCommand(PromtDelete, HasSelectedProducts);

            cvs = new CollectionViewSource();
            items = new ObservableCollection<Product>();
            cvs.Source = items;
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("Size", ListSortDirection.Ascending));

            var token = authStore.LoadToken();
            if (token != null)
            {
                IsEditor = token.IsEditor();
                IsAdmin = token.IsAdmin();
            }
        }
コード例 #5
0
 public OrderOperations()
 {
     _orderRepository = OrderRepositoryFactory.CreateOrderRepository();
     _productsRepository = ProductsRepositoryFactory.CreateProductsRepository();
     _statesRepository = StatesRepositoryFactory.CreateStatesRepository();
     _response = new Response();
 }
コード例 #6
0
 public ManageProductsController(IProductsRepository productsRepository, ICategoryRepository categoryRepository,
     IManufacturersRepository manufacturerRepository, IProductImagesRepository productImagesRepository)
 {
     _productsRepository = productsRepository;
     _categoryRepository = categoryRepository;
     _manufacturerRepository = manufacturerRepository;
     _productImagesRepository = productImagesRepository;
 }
コード例 #7
0
 public RecommendationController(ICustomerRepository customerRepository, IProductsRepository productsRepository, IPromotionsRepository promotionsRepository, ITelemetryRepository telemetryRepository)
 {
     // Setup Fields
     _customerRepository = customerRepository;
     _productsRepository = productsRepository;
     _promotionsRepository = promotionsRepository;
     _telemetryRepository = telemetryRepository;
 }
コード例 #8
0
        public ChangePriceWindowViewModel(IProductsRepository repository, IEventAggregator eventAggregator)
        {
            this.repository = repository;
            this.eventAggregator = eventAggregator;

            SaveCommand = new DelegateCommand(Save);
            CancelCommand = new DelegateCommand(() => IsWindowOpen = false);
        }
コード例 #9
0
ファイル: DashboardFlow.cs プロジェクト: SYW/social-insight
 public DashboardFlow(IContextProvider contextProvider,
     IStateProvider stateProvider)
 {
     _userContextProvider = new UserContextProvider(stateProvider, contextProvider);
     _productsApi = new ProductsApi(contextProvider);
     _productsRepository = new ProductsRepository();
     _userCatalogProvider = new UserCatalogProvider(contextProvider, stateProvider);
 }
コード例 #10
0
 protected BaseController(
     ICategoryRepository categoryRepository,
     IManufacturersRepository manufacturersRepository,
     IProductsRepository productsRepository)
 {
     _catRepo = categoryRepository;
     _manufacturersRepository = manufacturersRepository;
     _productsRepository = productsRepository;
 }
コード例 #11
0
 public PrecalculatedDashboardFlow(IContextProvider contextProvider, 
     IStateProvider stateProvider)
 {
     _productScoreCalculator = new ProductScoreCalculator(contextProvider, stateProvider);
     _offlineTokenProvider = new OfflineTokenProvider(contextProvider);
     _platformTokenProvider = new PlatformTokenProvider(contextProvider);
     _catalogsRepository = new CatalogsRepository();
     _productsRepository = new ProductsRepository();
 }
コード例 #12
0
 protected BaseController(
     ICategoryRepository categoryRepository,
     IManufacturersRepository manufacturersRepository,
     IProductsRepository productsRepository)
 {
     CatRepo = categoryRepository;
     ManufacturersRepository = manufacturersRepository;
     ProductsRepository = productsRepository;
     AutoLoginRememberedUser();
 }
コード例 #13
0
        public ProductEditViewModel(IProductsRepository repository, IEventAggregator eventAggregator, IAuthStore authStore, AttachmentsViewModel attachmentsViewModel)
        {
            this.repository = repository;
            this.eventAggregator = eventAggregator;
            this.authStore = authStore;
            this.attachmentsViewModel = attachmentsViewModel;

            SaveCommand = new DelegateCommand<ChildWindow>(Save);
            TabLoadedCommand = new DelegateCommand<object>(OnTabLoaded);
        }
コード例 #14
0
 public ShoppingCartModel()
 {
     INhibernateConnection connection = new NHibernateConnection();
     ISessionFactory sessionFactory = connection.CreateSessionFactory();
     ISession _session = sessionFactory.OpenSession();
     _cartRepo = new ShoppingCartRepository(connection);
     _orderRepo = new OrdersRepository(connection);
     _orderDetailsRepo = new OrderDetailsRepository(connection);
     _producRepo = new ProductsRepository(connection);
 }
コード例 #15
0
        public ProductBO(IProductsRepository productsRepository
                , IProductCategoryRepository categoriesRepository
                , IProductSubcategoryRepository subcategoriesRepository)
        {
            _productsRepository = productsRepository;
            _categoriesRepository = categoriesRepository;
            _subcategoriesRepository = subcategoriesRepository;

            InitMaps();
        }
コード例 #16
0
 public HomeController(
     ICategoryRepository catRepo,
     IProductsRepository productRepo,
     IManufacturersRepository manufacturerRepo)
     : base(catRepo,manufacturerRepo,productRepo)
 {
     homeLogic = new Home(_productsRepository);
     ViewBag.Categories = GetCategories();
     ViewBag.Manufacturers = GetManufacturers();
     ViewBag.CategorySelectList = GetCategoryList();
 }
コード例 #17
0
		public LicensesRepository(ScutexEntities db, IFeaturesRepository featuresRepository, IProductsRepository productsRepository,
			ILicenseSetsRepository licenseSetsRepository, ITrialSettingsRepository trialSettingsRepository, IServicesRepository servicesRepository)
		{
			this.db = db;

			_featuresRepository = featuresRepository;
			_productsRepository = productsRepository;
			_licenseSetsRepository = licenseSetsRepository;
			_trialSettingsRepository = trialSettingsRepository;
			_servicesRepository = servicesRepository;
		}
コード例 #18
0
 public HomeController(
     ICustomerRepository customerRepository,
     IProductsRepository productsRepository,
     IPromotionsRepository promotionsRepository,
     ITelemetryRepository telemetryRepository)
 {
     _customerRepository = customerRepository;
     _productsRepository = productsRepository;
     _promotionsRepository = promotionsRepository;
     _telemetryRepository = telemetryRepository;
 }
コード例 #19
0
 public void SetUp()
 {
     _repo = ProductsRepositoryFactory.CreateProductsRepository();
     _products = new[]
     {
         "Carpet,2.25,2.10",
         "Laminate,1.75,2.10",
         "Tile,3.50,4.15",
         "Wood,5.15,4.75"
     };
 }
コード例 #20
0
        public ChangePriceViewModel(IEnumerable<Product> products, IProductsRepository repository, IEventAggregator eventAggregator)
        {
            this.repository = repository;
            this.eventAggregator = eventAggregator;

            SaveCommand = new DelegateCommand(Save);
            CancelCommand = new DelegateCommand(() => IsWindowOpen = false);

            LoadItems(products);
            UpdatePrice();
        }
コード例 #21
0
        public void Initialize()
        {
            _repository = new EFProductRepository();

            //HttpContext.Current = new HttpContext(new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter()));

            //// User is logged in
            //HttpContext.Current.User = new GenericPrincipal(new GenericIdentity("username"), new string[0]);

            //// User is logged out
            //HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(String.Empty), new string[0]);
        }
コード例 #22
0
        public AttachmentsViewModel(IFilesRepository filesRepository, IProductsRepository productsRepository)
        {
            this.filesRepository = filesRepository;
            this.productsRepository = productsRepository;

            BrowseCommand = new DelegateCommand(Browse);
            OpenFileCommand = new DelegateCommand<FileDescription>(OpenFile);
            Files = new ObservableCollection<FileDescription>();
            //openDetailRequest = new InteractionRequest<AttachmentDetailViewModel>();
            deleteCommand = new DelegateCommand(PromtDelete, CanDelete);
            //deleteRequest = new InteractionRequest<Confirmation>();
        }
コード例 #23
0
        public OfferController(
            ICategoryRepository catRepo, 
            IProductsRepository productRepo, 
            IManufacturersRepository manufacturersRepository)
            : base(catRepo,manufacturersRepository,productRepo)
        {
            offerLogic = new Offer(_productsRepository);
            ViewBag.Categories = GetCategories();
            ViewBag.Manufacturers = GetManufacturers();
            ViewBag.CategorySelectList = GetCategoryList();

            ViewData["SearchOptions"] = new SelectList(Common.GetSortOptions(), "Id", "Name", 1);
        }
コード例 #24
0
        public ProductPickerViewModel(IProductsRepository productsRepository)
        {
            this.productsRepository = productsRepository;

            CancelCommand = new DelegateCommand(Close);
            PickCommand = new DelegateCommand(Pick);

            items = new ObservableCollection<ProductName>();
            cvs = new CollectionViewSource { Source = items };
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));

            Title = "Товарные позиции";
        }
コード例 #25
0
 public ProductsController(
     INhibernateConnection connection, IProductsRepository repo,
     ICategoryRepository categoryRepo,
     IManufacturersRepository manufacturersRepo,
     IProductImagesRepository productImageRepo
     )
 {
     _productRepo = repo;
     ISessionFactory sessionFactory = connection.CreateSessionFactory();
     _session = sessionFactory.OpenSession();
     _categoryRepo = categoryRepo;
     _manufacturersRepo = manufacturersRepo;
     _productImagesRepository = productImageRepo;
 }
コード例 #26
0
 public ProductController(
     IProductImagesRepository productImageRepo,
     IProductsRepository productsRepo,
     ICategoryRepository catRepo,
     IManufacturersRepository manufacturersRepository)
     : base(catRepo,manufacturersRepository,productsRepo)
 {
     _productLogic = new Product(productsRepo);
     _productImagesRepository = productImageRepo;
     ViewBag.Categories = GetCategories();
     ViewBag.Manufacturers = GetManufacturers();
     ViewBag.CategorySelectList = GetCategoryList();
     ViewData["SearchOptions"] = new SelectList(Common.GetSortOptions(), "Id", "Name", 1);
 }
コード例 #27
0
 public SetupController(ICategoryRepository catRepo, IOrderDetailsRepository orderDetailsRepository,
     IOrdersRepository orderRepo, IManufacturersRepository manuRepo,
     IProductImagesRepository productImgRepo, IUserRepository userRepo, INhibernateConnection conn,
     IProductsRepository productRepo,
     IDeliveryTypesRepository deliveryRepo)
 {
     _manuRepo = manuRepo;
     _productRepo = productRepo;
     _catRepo = catRepo;
     _productImagesRepository = productImgRepo;
     _userRepo = userRepo;
     _ordersRepository = orderRepo;
     _orderDetailsRepository = orderDetailsRepository;
     _deliveryRepo = deliveryRepo;
     _session = conn.CreateSessionFactory().OpenSession();
 }
コード例 #28
0
        //private readonly AttachmentsViewModel attachmentsViewModel;

        public ProductEditWindowViewModel(IProductsRepository repository, IEventAggregator eventAggregator,
            IAuthStore authStore/*, AttachmentsViewModel attachmentsViewModel*/)
        {
            this.repository = repository;
            this.eventAggregator = eventAggregator;
            //this.attachmentsViewModel = attachmentsViewModel;

            var token = authStore.LoadToken();
            if (token != null)
            {
                canSave = token.IsEditor();
                canEditPrice = token.IsAdmin();
            }

            SaveCommand = new DelegateCommand(Save, () => canSave);
            CancelCommand = new DelegateCommand(() => IsWindowOpen = false);
        }
コード例 #29
0
ファイル: Delete.cshtml.cs プロジェクト: sergden/OOOFormula
 public DeleteModel(IProductsRepository db, IFilesRepository fileRepository)
 {
     _db             = db;
     _fileRepository = fileRepository;
 }
コード例 #30
0
 public ProductsController(IProductsRepository productsRepository)
 {
     _productsRepository = productsRepository;
 }
コード例 #31
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            using (IServiceScope scope = _provider.CreateScope())
            {
                Debug.Write($"InicializadorAPI Iniciando...");
                _logService.SendMessagesAsync("StoreCatalog Iniciando InitializeCheck");

                List <Store> stores = new List <Store>();
                stores.AddRange(new List <Store> {
                    new Store {
                        Name = "California - Pasadena", StoreId = new Guid("8048e9ec-80fe-4bad-bc2a-e4f4a75c834e")
                    },
                    new Store {
                        Name = "Los Angeles - Beverly Hills", StoreId = new Guid("8d618778-85d7-411e-878b-846a8eef30c0")
                    }
                });

                _productsRepository   = scope.ServiceProvider.GetRequiredService <IProductsRepository>();
                _productionRepository = scope.ServiceProvider.GetRequiredService <IProductionRepository>();
                _storeRepository      = scope.ServiceProvider.GetRequiredService <IStoreRepository>();
                _apiService           = scope.ServiceProvider.GetRequiredService <IApiService>();

                List <Production.Contract.Production> areas = _apiService.GetProductionAreas().Result;

                var store = stores.Find(x => x.Name.Contains(_appSettings.LojaSettings.Nome));

                var productions = _mapper.Map <IEnumerable <Model.Production> >(areas);
                var products    = _mapper.Map <IEnumerable <Product> >(_apiService.GetProducts(_appSettings.LojaSettings.Nome).Result);

                if (products != null)
                {
                    foreach (var item in products)
                    {
                        _productsRepository.Create(item);
                    }
                }
                else
                {
                    _logService.SendMessagesAsync(
                        JsonConvert.SerializeObject(HttpStatusCode.ServiceUnavailable));
                }

                if (store != null)
                {
                    _storeRepository.Create(store);
                }
                else
                {
                    _logService.SendMessagesAsync(
                        JsonConvert.SerializeObject(HttpStatusCode.ServiceUnavailable));
                }

                if (productions != null)
                {
                    foreach (var item in productions)
                    {
                        _productionRepository.Create(item);
                    }
                }
                else
                {
                    _logService.SendMessagesAsync(
                        JsonConvert.SerializeObject(HttpStatusCode.ServiceUnavailable));
                }

                StoreCatalogReady storeCatalogReady = new StoreCatalogReady()
                {
                    Ready   = true,
                    StoreId = store.StoreId
                };

                _storeCatalogReadyService.SendMessagesAsync(JsonConvert.SerializeObject(storeCatalogReady));

                _logService.SendMessagesAsync("StoreCatalog Finalizando InitializeCheck");

                stoppingToken.Register(() =>
                                       Debug.Write($" InicializadorAPI Parando"));
            }
        }
コード例 #32
0
 public ProductsServices(IProductsRepository repo, IMapper autoMapper)
 {
     _autoMapper        = autoMapper;
     productsRepository = repo;
 }
コード例 #33
0
 public ProductsService(IProductsRepository productRepo, IMapper mapper)
 {
     _productRepo = productRepo;
     _mapper      = mapper;
 }
コード例 #34
0
 public ProductsViewModel(IProductsRepository productsRepository)
 {
     _productsRepository = productsRepository;
 }
コード例 #35
0
 public LocationController(ILocationRepo locationRepo, ICustomerRepository customerRepo, IProductsRepository productsRepo, IOrdersRepository ordersRepo)
 {
     LocRepo  = locationRepo;
     CusRepo  = customerRepo;
     ProdRepo = productsRepo;
     OrdRepo  = ordersRepo;
 }
コード例 #36
0
 public ProductController(IProductsRepository productRepository)
 {
     this.repository = productRepository;
 }
コード例 #37
0
 public NavController(IProductsRepository repo)
 {
     _repository = repo;
 }
コード例 #38
0
 public ProductsController(IProductsRepository productsRepository, ILoggerService loggerService, IUrlHelper urlHelper)
 {
     _productsRepository = productsRepository;
     _logger             = loggerService;
     _urlHelper          = urlHelper;
 }
コード例 #39
0
 public ProductController(IProductsRepository repo, IWarehouseRepository houseRepo, UserManager <ApplicationUser> userManager)
 {
     _repo        = repo;
     _houseRepo   = houseRepo;
     _userManager = userManager;
 }
コード例 #40
0
ファイル: CartController.cs プロジェクト: Maks417/SportsStore
 public CartController(IProductsRepository repo, IOrderProcessor proc)
 {
     repository = repo;
     orderProcessor = proc;
 }
コード例 #41
0
 public AdminController(IProductsRepository productsRepository)
 {
     this.productsRepository = productsRepository;
 }
コード例 #42
0
ファイル: CartController.cs プロジェクト: delve/StudyingBooks
 public CartController(IProductsRepository repo, IOrderProcessor processor)
 {
     this.repository     = repo;
     this.orderProcessor = processor;
 }
コード例 #43
0
 public ProductsController(IProductsRepository productsRepository, ILogger <ProductsController> logger)
 {
     _productsRepository = productsRepository;
     _logger             = logger;
 }
コード例 #44
0
 public ProductsQueries(IProductsRepository productsRepository)
 {
     this.productsRepository = productsRepository;
 }
コード例 #45
0
ファイル: ProductsController.cs プロジェクト: izzeldeen/Youth
 public ProductsController(ICategoriesRepository categoriesRepository, ICountriesRepository countriesRepository, IProductsRepository productsRepository, ModelValidations modelValidations, ImageUploader imageUploader)
 {
     _productsRepository   = productsRepository;
     _countriesRepository  = countriesRepository;
     _categoriesRepository = categoriesRepository;
     _modelValidations     = modelValidations;
     _imageUploader        = imageUploader;
 }
コード例 #46
0
 public ProductDeletedHandler(ICartsRepository cartsRepository,
                              IProductsRepository productsRepository)
 {
     _cartsRepository    = cartsRepository;
     _productsRepository = productsRepository;
 }
コード例 #47
0
ファイル: ProductsService.cs プロジェクト: wojtekkg/BioEkoFit
 public ProductsService(ILogger <ProductsService> logger, IProductsRepository productsRepository)
     : base(logger, nameof(ProductsService))
 {
     _productsRepository = productsRepository ?? throw new ArgumentNullException(nameof(productsRepository));
 }
コード例 #48
0
 public MockNorthwindUnitOfWork(IProductsRepository productsRepository)
 {
     ProductsRepository = productsRepository;
 }
コード例 #49
0
 public ProductController(IProductsRepository productsRepositoryParam)
 {
     _productsRepository = productsRepositoryParam;
 }
コード例 #50
0
 public PaginationService(IProductsRepository repository)
 {
     this._repository = repository;
 }
コード例 #51
0
 public ProductsController()
 {
     db = SQLiteRegistration.GetRepository(this);
 }
コード例 #52
0
 public StoreController(IPartsUnlimitedContext context, IMemoryCache memoryCache, IProductsRepository productsRepository, ITextAnalyticsService textAnalyticsService)
 {
     _db    = context;
     _cache = memoryCache;
     this.productsRepository   = productsRepository;
     this.textAnalyticsService = textAnalyticsService;
 }
コード例 #53
0
 public AdminController(IProductsRepository repo)
 {
     repository = repo;
 }
コード例 #54
0
 public ChannelEngineRepositoryWrapper(IOrdersRepository ordersRepository,
                                       IProductsRepository productsRepository)
 {
     Orders   = ordersRepository;
     Products = productsRepository;
 }
コード例 #55
0
 public ProductsService(IProductsRepository productsRepo, IMapper autoMapper)
 {
     _productsRepo = productsRepo;
     _autoMapper   = autoMapper;
 }
コード例 #56
0
 public ProductService(IProductsRepository productsRepository)
 {
     _productsRepository = productsRepository;
 }
コード例 #57
0
 public CartController(IProductsRepository repo, IOrderProcessor proc)
 {
     repository     = repo;
     orderProcessor = proc;
 }
コード例 #58
0
 public HomeController(ILogger <HomeController> logger, IProductsRepository repository)
 {
     _logger             = logger;
     _productsRepository = repository;
 }
コード例 #59
0
 public ProductController(IProductsRepository productRepository) {
     this.repository = productRepository;
 }
コード例 #60
0
ファイル: OrderService.cs プロジェクト: ToobooYana/GrpcWorld
 public OrderService(IProductsRepository productsRepository)
 {
     _productsRepository = productsRepository;
 }