Example #1
0
 public void SetUp()
 {
     repository  = new TestWishListRepository();
     wishService = new WishService(repository, new TestMailService());
     userService = new UserService(repository);
     controller  = new WishController(wishService, userService);
 }
        public PurchaseBookViewModel(IBookRepository bookRepository,
                                     IReviewRepository reviewRepository,
                                     IMessageQueue messaging,
                                     IWishListRepository wishListRepository,
                                     WriteReviewViewModel newReview,
                                     PurchaseBookService purchaseService)
        {
            m_booksRepository    = bookRepository;
            m_reviewRepository   = reviewRepository;
            m_wishListRepository = wishListRepository;
            m_purchaseService    = purchaseService;
            m_messaging          = messaging;

            NewReview = newReview;
            Reviews   = new ObservableRangeCollection <Review>();

            PurchaseBook    = CreateBuyBookCommand(purchaseService, wishListRepository, messaging);
            AddWishList     = CreateAddWishListCommand(purchaseService, wishListRepository);
            ShowBookCover   = CreateShowBookCoverCommand(messaging);
            SubmitNewReview = CreateSubmitNewReviewCommand(reviewRepository);

            newReview.PropertyChanged += (sender, args) =>
            {
                ChangeCanCommandExecute(SubmitNewReview);
            };
        }
        private ICommand CreateBuyBookCommand(PurchaseBookService purchaseService,
                                              IWishListRepository wishListRepository,
                                              IMessageQueue messaging)
        {
            return(new Command(
                       execute: async() =>
            {
                IsBusy = true;
                try
                {
                    purchaseService.PurchaseAsync(m_book);
                    m_bookViewModel.PurchasedCount += 1;

                    await wishListRepository.RemoveAsync(m_book);

                    ChangeCanCommandExecute(PurchaseBook);
                    UpdateCanBookBeAddedToWishList(m_book);

                    messaging.Send(this, BookPurchased, m_book);
                }
                catch (Exception ex)
                {
                    m_messaging.Send(this, ex);
                }
                IsBusy = false;
            }, canExecute: () =>
            {
                return Book != null && purchaseService.IsMoneyEnoughForPurchase(m_book);
            }));
        }
 public ShopingCartController(IPageRepository page_repo,
                              IGamePlatformRepository gp_repo,
                              IProductRepository prod_repo,
                              IGameRepository game_repo,
                              IUserRepository user_repo,
                              ICommon_Name_UrlRepository common_repo,
                              IPaymentSettingRepository pay_repo,
                              IShopping_Cart_Repository shop_repo,
                              IAddressRepository addr_repo,
                              IReviewRepository review_repo,
                              IWishListRepository wish_repo,
                              ISearchRepository search_repo,
                              ICreditRepository credit_repo,
                              IEmailSender emailSender,
                              ISmsSender sms_sender)
 {
     _page_repo   = page_repo;
     _gp_repo     = gp_repo;
     _prod_repo   = prod_repo;
     _game_repo   = game_repo;
     _common_repo = common_repo;
     _pay_repo    = pay_repo;
     _shop_repo   = shop_repo;
     _addr_repo   = addr_repo;
     _review_repo = review_repo;
     _wish_repo   = wish_repo;
     _search_repo = search_repo;
     _credit_repo = credit_repo;
     _emailSender = emailSender;
     _user_repo   = user_repo;
     _sms_sender  = sms_sender;
     _fetchr      = new FetchrApi();
 }
Example #5
0
        public WishListViewService(
            IWishListRepository wishListRepository,
            ILineItemViewModelFactory lineItemViewModelFactory,
            IWishListUrlProvider wishListUrlProvider,
            IFixCartService fixCartService,
            IImageService imageService)
        {
            if (wishListRepository == null)
            {
                throw new ArgumentNullException("wishListRepository");
            }
            if (lineItemViewModelFactory == null)
            {
                throw new ArgumentNullException("lineItemViewModelFactory");
            }
            if (wishListUrlProvider == null)
            {
                throw new ArgumentNullException("wishListUrlProvider");
            }
            if (fixCartService == null)
            {
                throw new ArgumentNullException("fixCartService");
            }
            if (imageService == null)
            {
                throw new ArgumentNullException("imageService");
            }

            WishListRepository       = wishListRepository;
            LineItemViewModelFactory = lineItemViewModelFactory;
            WishListUrlProvider      = wishListUrlProvider;
            FixCartService           = fixCartService;
            ImageService             = imageService;
        }
Example #6
0
 public UserService(IWishListRepository repository)
 {
     if (repository == null)
     {
         throw new ArgumentNullException("repository", "Repository cannot be null!");
     }
     _repository = repository;
 }
Example #7
0
        public UnitOfWork(ApplicationContext context)
        {
            _context = context;

            BookRepository     = new BookRepository(_context);
            CategoryRepository = new CategoryRepository(_context);
            WishListRepository = new WishListRepository(_context);
        }
Example #8
0
 public UnitOfWork(ProductsCatalogContext productsCatalogContext)
 {
     _productsCatalogContext = productsCatalogContext;
     ProductRepository       = new ProductRepository(_productsCatalogContext);
     CategoryRepository      = new CategoryRepository(_productsCatalogContext);
     SlideshowRepository     = new SlideshowRepository(_productsCatalogContext);
     WishListRepository      = new WishListRepository(_productsCatalogContext);
 }
Example #9
0
 public WishService(IWishListRepository repository, IMailService mailService)
 {
     if (repository == null)
     {
         throw new ArgumentNullException("repository", "Repository cannot be null!");
     }
     _repository  = repository;
     _mailService = mailService;
 }
Example #10
0
 public UnitOfWork()
 {
     _dbContext  = new MyContext();
     User        = new UserRepository(_dbContext);
     Product     = new ProductRepository(_dbContext);
     Category    = new CategoryRepository(_dbContext);
     SubCategory = new SubCategoryRepository(_dbContext);
     WishList    = new WishListRepository(_dbContext);
 }
Example #11
0
 public UserRepository(IDbFactory dbFactory,
                       IAddressRepository addressRepository,
                       ICartRepository cartRepository,
                       IWishListRepository wishListRepository) : base(dbFactory)
 {
     this.addressRepository  = addressRepository;
     this.cartRepository     = cartRepository;
     this.wishListRepository = wishListRepository;
 }
Example #12
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;
 }
 public RegisterMemberService(IBasicUserRepository basicUserRepository, IWishListRepository wishListRepository, IClosetRepository closetRepository, IUserSizeRepository userSizeRepository, ISecurityQuestionRepository securityQuestionRepository, IMessageSenderService messageSenderService, IInvitationCodeRepository invitationCodeRepository,
                              IFriendRepository friendRepository)
 {
     this.basicUserRepository      = basicUserRepository;
     this.wishListRepository       = wishListRepository;
     this.closetRepository         = closetRepository;
     this.messageSenderService     = messageSenderService;
     this.invitationCodeRepository = invitationCodeRepository;
     this.friendRepository         = friendRepository;
 }
Example #14
0
        public WishListService(IWishListRepository wishListRepository, IHttpContextAccessor httpContextAccessor, IHttpClientFactory clientFactory)
        {
            this._wishListRepository = wishListRepository ??
                                       throw new ArgumentNullException(nameof(wishListRepository));

            this._httpContextAccessor = httpContextAccessor ??
                                        throw new ArgumentNullException(nameof(httpContextAccessor));

            this._clientFactory = clientFactory ??
                                  throw new ArgumentNullException(nameof(clientFactory));
        }
 public UsersController(ISecretSantasRepository santasRepository,
                        IUserRepository userRepository,
                        IWishListRepository wishListRepo,
                        ICommentsRepository commentsRepo,
                        IChristmasStatusService statusService)
 {
     _santasRepo    = santasRepository;
     _userRepo      = userRepository;
     _wishListRepo  = wishListRepo;
     _commentsRepo  = commentsRepo;
     _statusService = statusService;
 }
Example #16
0
 public GarmentSelectorController(IContentService contentService, IEventTypeRepository eventTypeRepository, ISilouhetteRepository silouhetteRepository, IPatternRepository patternRepository, IFabricRepository fabricRepository, IGarmentRepository garmentRepository, IRegisteredUserRepository registeredUserRepository, IWishListRepository wishListRepository, IClosetRepository closetRepository, IFashionFlavorRepository fashionFlavorRepository)
 {
     this.contentService           = contentService;
     this.silouhetteRepository     = silouhetteRepository;
     this.patternRepository        = patternRepository;
     this.garmentRepository        = garmentRepository;
     this.fabricRepository         = fabricRepository;
     this.registeredUserRepository = registeredUserRepository;
     this.wishListRepository       = wishListRepository;
     this.closetRepository         = closetRepository;
     this.fashionFlavorRepository  = fashionFlavorRepository;
     this.eventTypeRepository      = eventTypeRepository;
 }
Example #17
0
 public WishListViewService(
     IWishListRepository wishListRepository,
     ILineItemViewModelFactory lineItemViewModelFactory,
     IWishListUrlProvider wishListUrlProvider,
     IFixCartService fixCartService,
     IImageService imageService)
 {
     WishListRepository       = wishListRepository ?? throw new ArgumentNullException(nameof(wishListRepository));
     LineItemViewModelFactory = lineItemViewModelFactory ?? throw new ArgumentNullException(nameof(lineItemViewModelFactory));
     WishListUrlProvider      = wishListUrlProvider ?? throw new ArgumentNullException(nameof(wishListUrlProvider));
     FixCartService           = fixCartService ?? throw new ArgumentNullException(nameof(fixCartService));
     ImageService             = imageService ?? throw new ArgumentNullException(nameof(imageService));
 }
Example #18
0
 public UnitOfWork(GameShopContext context)
 {
     _context           = context;
     Products           = new ProductRepository(_context);
     Categories         = new CategoryRepository(_context);
     Carts              = new CartRepository(_context);
     Orders             = new OrderRepository(_context);
     ProductImages      = new ProductImageRepository(_context);
     ParameterGroups    = new ParameterGroupRepository(_context);
     ParameterSubGroups = new ParameterSubGroupRepository(_context);
     ParameterValues    = new ParameterValueRepository(_context);
     WishLists          = new WishListRepository(_context);
 }
Example #19
0
 public BuildYourClosetController(IFashionFlavorRepository repository, IStylePhotographRepository stylePhotographRepository, IBrandSetRepository brandSetRepository, IWordingRepository wordingRepository, IEventTypeRepository eventTypeRepository, ISilouhetteRepository silouhetteRepository, IPatternRepository patternRepository, IGarmentRepository garmentRepository, IRegisteredUserRepository registeredUserRepository, IWishListRepository wishListRepository, IClosetRepository closetRepository, IUserSizeRepository userSizeRepository, IFabricRepository fabricRepository, ISecurityQuestionRepository securityQuestionRepository, IZipCodeRepository zipCodeRepository)
 {
     this.fashionFlavorRepository    = repository;
     this.stylePhotographRepository  = stylePhotographRepository;
     this.brandSetRepository         = brandSetRepository;
     this.wordingRepository          = wordingRepository;
     this.eventTypeRepository        = eventTypeRepository;
     this.silouhetteRepository       = silouhetteRepository;
     this.patternRepository          = patternRepository;
     this.garmentRepository          = garmentRepository;
     this.registeredUserRepository   = registeredUserRepository;
     this.wishListRepository         = wishListRepository;
     this.closetRepository           = closetRepository;
     this.userSizeRepository         = userSizeRepository;
     this.fabricRepository           = fabricRepository;
     this.securityQuestionRepository = securityQuestionRepository;
     this.zipCodeRepository          = zipCodeRepository;
 }
Example #20
0
 public AccountController(
     IUserRepository userRepository,
     IEmailSender emailSender,
     IAddressRepository addr_repo,
     IShopping_Cart_Repository shop_repo,
     IGuest_User_Repository guest_repo,
     ICountryRepository cntry_repo,
     IWishListRepository wish_repo,
     ICreditRepository credit_repo,
     IOrder_Repository order_repo)
 {
     _userRepository = userRepository;
     _emailSender    = emailSender;
     _addr_repo      = addr_repo;
     _shop_repo      = shop_repo;
     _guest_repo     = guest_repo;
     _cntry_repo     = cntry_repo;
     _wish_repo      = wish_repo;
     _credit_repo    = credit_repo;
     _order_repo     = order_repo;
 }
 public WishListService(IWishListRepository repository, IProductRepository productRepository, IWishListValidator validator)
 {
     _repository        = repository ?? throw new ArgumentNullException(nameof(repository));
     _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository));
     _validator         = validator ?? throw new ArgumentNullException(nameof(validator));
 }
 public WishListBAL(IWishListRepository IWishListRepository)
 {
     _IWishListRepository = IWishListRepository;
 }
Example #23
0
 public WishListApi(IWishListRepository wishListRepository)
 {
     _wishListRepository = wishListRepository;
 }
Example #24
0
 public WishListService(IWishListRepository wishListRepository)
 {
     _wishListRepository = wishListRepository;
 }
Example #25
0
 public WishListController(IWishListRepository repo, UserManager <ApplicationUser> userManager)
 {
     WishListRepository = repo;
     _userManager       = userManager;
 }
Example #26
0
 public WishListBusiness(IWishListRepository repository) : base(repository)
 {
 }
Example #27
0
 public WishListController(IWishListRepository repository,
                           ILoggerFactory logger)
 {
     _repository = repository;
     _logger     = logger.CreateLogger <WishListController>();
 }
 public WishListController()
 {
     this.wishlistrepository = new WishListRepository(new E_CommerceEntities());
 }
Example #29
0
 public WishListController(IWishListRepository wishLists)
 {
     _wishLists = wishLists;
 }
 public WishListController(IWishListRepository wishListRepo)
 {
     _wishListRepo = wishListRepo;
 }