Example #1
0
 public Basket(IProductRepository products, IOfferRepository offers)
 {
     _purchasedProducts = new Dictionary <string, int>
                              (StringComparer.InvariantCultureIgnoreCase);
     _products = products;
     _offers   = offers;
 }
Example #2
0
 public OfferService(IOfferRepository offerRepository, IAuctionRepository auctionRepository, IUserRepository userRepository, Authorization authorization)
 {
     this.offerRepository   = offerRepository;
     this.auctionRepository = auctionRepository;
     this.userRepository    = userRepository;
     this.authorization     = authorization;
 }
Example #3
0
 public UpdateOfferCommandHandler(
     IOfferRepository offerRepository,
     IMapper mapper)
 {
     _offerRepository = Guard.NotNull(offerRepository, nameof(offerRepository));
     _mapper          = Guard.NotNull(mapper, nameof(mapper));
 }
Example #4
0
 public HomeController(ILogger <HomeController> logger, IUserRepository userRepository, IOfferRepository offerRepository, IMapper mapper)
 {
     _logger          = logger;
     _userRepository  = userRepository;
     _offerRepository = offerRepository;
     _mapper          = mapper;
 }
        public OffersManager initOffersManager(
            IOfferRepository IOfferRepository,
            IOfferAttributeRepository IOfferAttributeRepository,
            IProviderRepository IProviderRepository,
            IAttributeRepository IAttributeRepository, 
            ILiveMatch ILiveMatch,
            IRespondentCatalog IRespondentCatalog,
            IQuotaExpressionRepository IQuotaExpressionRepository,
            IQuotaMappingRepository IQuotaMappingRepository,
            ISampleMappingRepository ISampleMappingRepository,
            IGMIStudy IGMIStudy,
            ISteamStudy ISteamStudy,
            IQuotaLiveMatch IQuotaLiveMatch
            )
        {
            OffersManager OffersManager = new OffersManager(
            IOfferRepository,
            IOfferAttributeRepository,
            IProviderRepository,
            IAttributeRepository,
            ILiveMatch,
            IRespondentCatalog,
            IQuotaExpressionRepository,
            IQuotaMappingRepository,
            ISampleMappingRepository,
            IGMIStudy,
            ISteamStudy,
            IQuotaLiveMatch);

            return OffersManager;
        }
Example #6
0
        public TurnsController(ITurnsService turnsService,
                               IDoctorServiceManager doctorServiceManager,
                               IAppointmentService appointmentService,
                               IServiceSupplyService serviceSupplyService,
                               IServicesService servicesService,
                               IBlockedMobileService blockedMobileService,
                               IIPAsManager iPAsManager,
                               IPersonService userService,
                               IAppointmentsManager appointmentsManager,
                               INotificationService notificationService,
                               IOfferRepository offerRepository)
        {
            _turnsService         = turnsService;
            _doctorServiceManager = doctorServiceManager;
            _userService          = userService;
            _appointmentsManager  = appointmentsManager;
            _notificationService  = notificationService;
            _servicesService      = servicesService;
            _blockedMobileService = blockedMobileService;
            _iPAsManager          = iPAsManager;
            _appointmentService   = appointmentService;
            _serviceSupplyService = serviceSupplyService;
            _offerRepository      = offerRepository;

            logger = LogManager.GetCurrentClassLogger();
        }
Example #7
0
 public CreatePolicyCommandHandler(IMapper mapper, IEventPublisher eventPublisher, IOfferRepository offerRepository, IPolicyRepository policyRepository)
 {
     this._mapper           = mapper;
     this._eventPublisher   = eventPublisher;
     this._offerRepository  = offerRepository;
     this._policyRepository = policyRepository;
 }
Example #8
0
 public AuctionFacade(IAuctionRepository auctionRepository, IOfferRepository offerRepository, AuctionBusiness auctionBusiness, OfferBusiness offerBusiness)
 {
     _auctionRepository = auctionRepository;
     _offerRepository   = offerRepository;
     _auctionBusiness   = auctionBusiness;
     _offerBusiness     = offerBusiness;
 }
 public PublishOfferCommandHandler(IHttpContextAccessor httpContextAccessor,
                                   IOfferRepository offerRepository)
 {
     _httpContext = httpContextAccessor.HttpContext ??
                    throw new ArgumentNullException(nameof(httpContextAccessor.HttpContext));
     _offerRepository = offerRepository ?? throw new ArgumentNullException(nameof(offerRepository));
 }
Example #10
0
 protected CrawlerBase(IOfferRepository repository, IParser parser, string requestUriString, string nodesXPath)
 {
     _repository       = repository;
     _parser           = parser;
     _requestUriString = requestUriString;
     _nodesXPath       = nodesXPath;
 }
 public OfferService(IOfferRepository offerRepository, IDraftRepository draftRepository, IApartmentRepository apartmentRepository, IDiscountService discountService)
 {
     _offerRepository     = offerRepository;
     _draftRepository     = draftRepository;
     _apartmentRepository = apartmentRepository;
     _discountService     = discountService;
 }
Example #12
0
 public ShoppingCartModel(ShoppingCartService shoppingService, IOfferRepository offerRepo, DiscountService discountService)
 {
     ItemsInCart     = shoppingService;
     OItems          = new List <OrderItem>();
     OfferRepository = offerRepo;
     discount        = discountService;
 }
Example #13
0
 public ProfileController(IProductRepository productRepository,
                          IOfferRepository offerRepository, IWatchListRepository watchListRepository)
 {
     _productRepository   = productRepository;
     _offerRepository     = offerRepository;
     _watchListRepository = watchListRepository;
 }
 /// <summary>
 /// Xunit Constructor
 /// </summary>
 /// <param name="IOfferRepository"></param>
 /// <param name="IOfferAttributeRepository"></param>
 /// <param name="IProviderRepository"></param>
 /// <param name="IAttributeRepository"></param>
 /// <param name="ILiveMatch"></param>
 /// <param name="IRespondentCatalog"></param>
 public OffersManager(
     IOfferRepository IOfferRepository,
     IOfferAttributeRepository IOfferAttributeRepository,
     IProviderRepository IProviderRepository,
     IAttributeRepository IAttributeRepository,
     ILiveMatch ILiveMatch,
     IRespondentCatalog IRespondentCatalog,
     IQuotaExpressionRepository IQuotaExpressionRepository,
     IQuotaMappingRepository IQuotaMappingRepository,
     ISampleMappingRepository ISampleMappingRepository,
     IGMIStudy IGMIStudy,
     ISteamStudy ISteamStudy,
     IQuotaLiveMatch IQuotaLiveMatch
     )
 {
     //log = LoggerFactory.GetLogger("Xunit");
     //detailedLog = LoggerFactory.GetLogger("Xunit");
     this.xunit = true;
     this.IOfferRepository = IOfferRepository;
     this.IOfferAttributeRepository = IOfferAttributeRepository;
     this.IProviderRepository = IProviderRepository;
     this.IAttributeRepository = IAttributeRepository;
     this.ILiveMatch = ILiveMatch;
     this.IRespondentCatalog = IRespondentCatalog;
     this.IQuotaExpressionRepository = IQuotaExpressionRepository;
     this.IQuotaMappingRepository = IQuotaMappingRepository;
     this.ISampleMappingRepository = ISampleMappingRepository;
     this.IGMIStudy = IGMIStudy;
     this.ISteamStudy = ISteamStudy;
     this.IQuotaLiveMatch = IQuotaLiveMatch;
 }
Example #15
0
 public AddOfferCommandHandler(
     IOfferRepository offerRepository,
     IOfferFactory offerFactory)
 {
     this.offerRepository = offerRepository;
     this.offerFactory    = offerFactory;
 }
Example #16
0
 public GetOffersCommand(
     IOfferRepository offerRepository,
     IMapper <Datasource.OfferData, Offer> offerMapper)
 {
     this.offerRepository = offerRepository;
     this.offerMapper     = offerMapper;
 }
 public BasketCalculatorService(
     IOfferRepository offerRepository,
     IProductRepository productRepository)
 {
     _offerRepository   = offerRepository;
     _productRepository = productRepository;
 }
        //private readonly OfferDataExtension _ext;

        public OffersController(IOfferDbContextService service, IOfferData data, OfferDbContext dbContext, IMapper mapper, IOfferRepository repo)
        {
            _service   = service;
            _mapper    = mapper;
            _dataRepo  = repo;
            _dbContext = dbContext;
        }
Example #19
0
 public EFDataStore(InsuranceDbContext dbContext)
 {
     this.dbContext         = dbContext;
     this.offerRepository   = new EFOfferRepository(this.dbContext);
     this.productRepository = new EFProductRepository(this.dbContext);
     this.policyRepository  = new EFPolicyRepository(this.dbContext);
 }
        public BasketStepDefinitions()
        {
            _offerRepository = ObjectFactory.GetInstance<IOfferRepository>();
            _productRepository = ObjectFactory.GetInstance<IProductRepository>();
            _uow = ObjectFactory.GetInstance<IUnitOfWork>();

            _basket_Controller = ObjectFactory.GetInstance<BasketController>();
        }
 public BaseScrapper(IUrlGenerator <TWebsite> urlGenerator,
                     IOfferRepository repository)
 {
     _urlGenerator = urlGenerator;
     _repository   = repository;
     HtmlClient    = new HtmlWeb();
     TargetWebsite = new TWebsite();
 }
Example #22
0
 public OfferService(IOfferRepository offerRepository, IClientRepository clientRepository, IOfferNoteRepository offerNoteRepository, IOfferSectionRepository offerSectionRepository, IOfferItemRepository offerItemRepository)
 {
     _offerRepository        = offerRepository;
     _clientRepository       = clientRepository;
     _offerNoteRepository    = offerNoteRepository;
     _offerSectionRepository = offerSectionRepository;
     _offerItemRepository    = offerItemRepository;
 }
Example #23
0
 public OffersController(IOfferRepository offerRepository,
                         IMapper mapper,
                         IHubContext <OfferHub> hub)
 {
     _offerRepository = offerRepository;
     _mapper          = mapper;
     _hub             = hub;
 }
Example #24
0
 public RemoveOfferDraftCommandHandler(IHttpContextAccessor httpContextAccessor, IOfferRepository offerRepository,
                                       IImageStorage imageStorage)
 {
     _httpContext = httpContextAccessor.HttpContext ??
                    throw new ArgumentNullException(nameof(httpContextAccessor.HttpContext));
     _offerRepository = offerRepository ?? throw new ArgumentNullException(nameof(offerRepository));
     _imageStorage    = imageStorage ?? throw new ArgumentNullException(nameof(imageStorage));
 }
 public OffersController(IOfferRepository offerRepository,
                         ILoggerService logger,
                         IMapper mapper)
 {
     _offerRepository = offerRepository;
     _logger          = logger;
     _mapper          = mapper;
 }
Example #26
0
 public PostOfferCommand(
     IOfferRepository offerRepository,
     IMapper <Datasource.OfferData, Offer> offerToOfferMapper,
     IMapper <SaveOffer, Datasource.OfferData> saveOfferToOfferMapper)
 {
     this._offerRepository        = offerRepository;
     this._offerToOfferMapper     = offerToOfferMapper;
     this._saveOfferToOfferMapper = saveOfferToOfferMapper;
 }
Example #27
0
        public void Init()
        {
            _offerRepositoryMock = Substitute.For <IOfferRepository>();
            _geoCodeProviderMock = Substitute.For <IGeoCodeProvider>();
            _imagePathBuilder    = Substitute.For <IImagePathBuilder>();
            _imageSaver          = Substitute.For <IImageSaver>();

            _offerService = new OfferService(_offerRepositoryMock, _geoCodeProviderMock, _imagePathBuilder, _imageSaver);
        }
Example #28
0
 public CandidateController(ICandidateRepository CandidateRepo, ICompanyRepository CompanyRepo, IOfferRepository OfferRepo, IJobOrderRepository JobOrderRepo, IPlacementsRepository PlacementRepo)
 {
     CandidateRepository = CandidateRepo;
     CompanyRepository   = CompanyRepo;
     OfferRepository     = OfferRepo;
     JobOrderRepository  = JobOrderRepo;
     PlacementRepository = PlacementRepo;
     ViewBag.Name        = System.Web.HttpContext.Current.Session["Name"];
 }
Example #29
0
        public CreateOfferHandler(IOfferRepository repository, IBusPublisher busPublisher, IPointOfSaleVerifier posVerifier, IProductVerifier productVerifier, IStockItemVerifier stockItemVerifier)
        {
            _repository   = repository ?? throw new ArgumentNullException(nameof(repository));
            _busPublisher = busPublisher ?? throw new ArgumentNullException(nameof(busPublisher));

            _posVerifier       = posVerifier ?? throw new ArgumentNullException(nameof(posVerifier));
            _productVerifier   = productVerifier ?? throw new ArgumentNullException(nameof(productVerifier));
            _stockItemVerifier = stockItemVerifier ?? throw new ArgumentNullException(nameof(stockItemVerifier));
        }
Example #30
0
 public UserService(IUserRepository userRepository, IHoldingRepository holdingRepository, INoticeRepository noticeRepository,
                    IOfferRepository offerRepository, ISaleRepository saleRepository)
 {
     _userRepository    = userRepository;
     _holdingRepository = holdingRepository;
     _noticeRepository  = noticeRepository;
     _offerRepository   = offerRepository;
     _saleRepository    = saleRepository;
 }
Example #31
0
 public PostOfferApplicationCommand(
     IOfferRepository offerRepository,
     IMapper <Datasource.OfferApplicationData, OfferApplicationData> offerToOfferMapper,
     IMapper <SaveOfferApplication, Datasource.OfferApplicationData> saveOfferToOfferMapper)
 {
     this._offerRepository       = offerRepository;
     this.offerToOfferMapper     = offerToOfferMapper;
     this.saveOfferToOfferMapper = saveOfferToOfferMapper;
 }
Example #32
0
 public ManagementUnitOfWork(
     DbContext context,
     IdentityDbContext <ApplicationUser> appContext,
     ILinkRepository linkRepository,
     IPageRepository pageRepository,
     ITenantRepository tenantRepository,
     IEronFileRepository fileRepository,
     IBannerSliderRepository bannerSliderRepository,
     IOfferRepository offerRepository,
     IInvoiceRepository invoiceRepository,
     IInvoiceItemRepository invoiceItemRepository,
     IInvoiceLogRepository invoiceLogRepository,
     IWishListRepository wishListRepository,
     ICartRepository cartRepository,
     IOrderRepository orderRepository,
     ITariffRepository tariffRepository,
     ITariffPriceRepository tariffPriceRepository,
     ITariffItemRepository tariffItemRepository,
     IProductRepository productRepository,
     IProductPriceRepository productPriceRepository,
     IProductPropertyRepository productPropertyRepository,
     IProductPropertyNameRepository productPropertyNameRepository,
     IProductCategoryRepository productCategoryRepository,
     IServiceReviewRepository serviceReviewRepository,
     ITariffCategoryRepository tariffCategoryRepository, IFinanceTransactionRepository financeTransactionRepository, IBlogRepository blogRepository, IBlogArchiveRepository blogArchiveRepository, ICommentRepository commentRepository, ILikeRepository likeRepository, IHashTagRepository hashTagRepository) : base(context)
 {
     AppContext                    = appContext;
     LinkRepository                = linkRepository;
     PageRepository                = pageRepository;
     TenantRepository              = tenantRepository;
     FileRepository                = fileRepository;
     BannerSliderRepository        = bannerSliderRepository;
     OfferRepository               = offerRepository;
     InvoiceRepository             = invoiceRepository;
     InvoiceItemRepository         = invoiceItemRepository;
     InvoiceLogRepository          = invoiceLogRepository;
     WishListRepository            = wishListRepository;
     CartRepository                = cartRepository;
     OrderRepository               = orderRepository;
     TariffRepository              = tariffRepository;
     TariffPriceRepository         = tariffPriceRepository;
     TariffItemRepository          = tariffItemRepository;
     ProductRepository             = productRepository;
     ProductPriceRepository        = productPriceRepository;
     ProductPropertyRepository     = productPropertyRepository;
     ProductPropertyNameRepository = productPropertyNameRepository;
     ProductCategoryRepository     = productCategoryRepository;
     ServiceReviewRepository       = serviceReviewRepository;
     TariffCategoryRepository      = tariffCategoryRepository;
     FinanceTransactionRepository  = financeTransactionRepository;
     BlogRepository                = blogRepository;
     BlogArchiveRepository         = blogArchiveRepository;
     CommentRepository             = commentRepository;
     LikeRepository                = likeRepository;
     HashTagRepository             = hashTagRepository;
 }
Example #33
0
 public OfferController(IAuthorizationService authorizationService,
                        IOfferRepository offerRepository,
                        ILoggingRepository loggingRepository,
                        IOfferService offerService)
 {
     _authorizationService = authorizationService;
     _offerRepository      = offerRepository;
     _loggingRepository    = loggingRepository;
     _offerService         = offerService;
 }
 public OfferAssignmentService(
     IMemberRepository memberRepository,
     IOfferTypeRepository offerTypeRepository,
     IOfferValueCalculator offerValueCalculator,
     IOfferRepository offerRepository
     )
 {
     _memberRepository = memberRepository;
     _offerTypeRepository = offerTypeRepository;
     _offerValueCalculator = offerValueCalculator;
     _offerRepository = offerRepository;
 }
Example #35
0
 public OfferService(
     IOfferRepository offerRepository,
     IOfferTypeRepository offerTypeRepository)
 {
     if (offerRepository == null)
     {
         throw new ArgumentNullException("offerRepository");
     }
     if (offerTypeRepository == null)
     {
         throw new ArgumentNullException("offerTypeRepository");
     }
     this.offerRepository = offerRepository;
     this.offerTypeRepository = offerTypeRepository;
 }
Example #36
0
 public static void GetOffer(int id, int offerId, out Offer offer, ILocalisationRepository lRepo, IOfferRepository oRepo, Func<ActionResult> caseError)
 {
     //case no offer selected, take the first one
     if (offerId == 0)
     {
         var loc = lRepo.Get(id);
         offer = loc.Offers.FirstOrDefault();
         if (offer == null)
         {
             caseError.Invoke();
         }
     }
     else
     {
         offer = oRepo.Get(offerId);
     }
 }
Example #37
0
        public static void CompareOffer(List<string> topWordsList, IOfferRepository offerRepositiry)
        {
            //List<string> result = one.Union(two).ToList();

            var listAllOffer = offerRepositiry.GetAll().OrderBy(x => x.IT_ID).ToList();
            List<Offer> result = new List<Offer>();
            double progress = 0.0;
            var watch = Stopwatch.StartNew();

            foreach (var offer in listAllOffer.Take(100))
            {
                List<string> keyWordsList = new List<string>();
                foreach (var word in topWordsList)
                {
                    var value = offer.GetType().GetProperty(word).GetValue(offer, null);
                    if (value.Equals("1"))
                    {
                        keyWordsList.Add(word);
                    }
                }

                if(keyWordsList.Count() > 0)
                {
                    result.Add(new Offer(offer.IT_ID, keyWordsList));
                }
            }

            Console.WriteLine(progress);

            foreach (var item in result)
            {
                progress += 1.28;
                string query = String.Empty;

                var last = item.keyWordsList.Last();
                foreach (var attr in item.keyWordsList)
                {
                    if (attr.Equals(last))
                    {
                        query += attr + "=\"1\"";
                    }
                    else
                    {
                        query += attr + "=\"1\" OR ";
                    }
                }

                var listAllSimilarOffer = listAllOffer.Where(query).ToList();
                listAllSimilarOffer.Remove(listAllOffer.FirstOrDefault(x => x.IT_ID.Equals(item.offerId)));

                foreach(var similarOffer in listAllSimilarOffer)
                {
                    List<string> keyWordsList = new List<string>();
                    foreach (var word in topWordsList)
                    {
                        var value = similarOffer.GetType().GetProperty(word).GetValue(similarOffer, null);
                        if (value.Equals("1"))
                        {
                            keyWordsList.Add(word);
                        }
                    }

                    double intersectCount = item.keyWordsList.Select(x => x).Intersect(keyWordsList).Count();
                    double unionCounter = item.keyWordsList.Union(keyWordsList).ToList().Count();
                    double divideResult = unionCounter.Equals(0) ? 0 : (intersectCount / unionCounter);
                    item.similarOfferList.Add(new Similar(similarOffer.IT_ID, divideResult));
                }

                Console.Clear();
                progress += 1.28;
                Console.Write(progress);
            }

            watch.Stop();
            Console.Clear();
            Console.WriteLine("Time elapsed: {0:hh\\:mm\\:ss}", watch.Elapsed);

            foreach (var item in result)
            {
                item.similarOfferList = item.similarOfferList.OrderByDescending(x => x.percentSimilar).ToList();

                Console.WriteLine("Offer: " + item.offerId);
                Console.WriteLine("Similar: " + item.similarOfferList.First().offerId + " Percent: " + item.similarOfferList.First().percentSimilar);
                Console.WriteLine();
            }
        }
 /// <summary>
 /// Xunit constructor
 /// </summary>
 /// <param name="IOfferRepository"></param>
 public OffersManager(IOfferRepository IOfferRepository)
 {
     this.xunit = true;
     this.IOfferRepository = IOfferRepository;
 }
Example #39
0
 public OfferService(IOfferRepository offerRepository)
 {
     _offerRepository = offerRepository;
 }
 public BasketPricingService(IBasketRepository basketRepository, IOfferRepository offerRepository)
 {
     _basketRepository = basketRepository;
     _offerRepository = offerRepository;
 }
 public PriceCalculator(IOfferRepository offerRepository)
 {
     this.offerRepository = offerRepository;
 }