Пример #1
0
        public void SetUp()
        {
            _loggerFactory      = Mock.Of <ILoggerFactory>();
            _countryManagerMock = Mock.Of <ICountryManager>();
            _userManagerMock    = Mock.Of <IUserManagerWrapper <ApplicationUser> >();
            _companyManagerMock = Mock.Of <ICompanyManager>();
            _currentUser        = new ApplicationUser()
            {
                Id       = Guid.NewGuid().ToString(),
                UserName = "******",
                Email    = "*****@*****.**"
            };

            Mock.Get(_countryManagerMock)
            .Setup(x => x.GetCountries())
            .Returns(new List <CountryBo> {
                new CountryBo
                {
                    IsoCountryCode = "US",
                    Name           = "United States"
                }
            });

            Mock.Get(_userManagerMock)
            .Setup(x => x.GetUserAsync(_controller.User).Result)
            .Returns(_currentUser);

            _controller = new OrganizationController(_countryManagerMock, _companyManagerMock, _userManagerMock, _loggerFactory);
        }
Пример #2
0
 public OrganizationController(ICountryManager countryManager, ICompanyManager companyManager, IUserManagerWrapper <ApplicationUser> userManager, ILoggerFactory loggerFactory)
 {
     _countryManager = countryManager;
     _companyManager = companyManager;
     _userManager    = userManager;
     _logger         = loggerFactory.CreateLogger(nameof(OrganizationController));
 }
Пример #3
0
 public CustomersController(ICustomerManager customerManager, IContactManager contactManager, IBuildingManager buildingManager,
                            IRequestManager requestManager,
                            IInterventionManager interventionManager, IOfferManager offerManager,
                            IOrderManager orderManager, IDepositInvoiceManager depositInvoiceManager, IInvoiceManager invoiceManager,
                            ITagManager tagManager, ICountryManager countryManager, ILanguageManager languageManager,
                            IHonorificPrefixManager honorificPrefixManager, IIncludedCollector includedCollector,
                            IMapper mapper, IJsonApiBuilder jsonApiBuilder)
 {
     _customerManager        = customerManager;
     _contactManager         = contactManager;
     _buildingManager        = buildingManager;
     _requestManager         = requestManager;
     _interventionManager    = interventionManager;
     _offerManager           = offerManager;
     _orderManager           = orderManager;
     _depositInvoiceManager  = depositInvoiceManager;
     _invoiceManager         = invoiceManager;
     _tagManager             = tagManager;
     _countryManager         = countryManager;
     _languageManager        = languageManager;
     _honorificPrefixManager = honorificPrefixManager;
     _includedCollector      = includedCollector;
     _mapper         = mapper;
     _jsonApiBuilder = jsonApiBuilder;
 }
        internal static void InitialiseerDI(out IClientManager clientManager,
                                            out ICountryManager countryManager,
                                            out IInvoiceManager invoiceManager,
                                            out IConsultManager consultManager)
        {
            IConfigurationBuilder configBuilder = new ConfigurationBuilder()
                                                  .SetBasePath(Directory.GetCurrentDirectory())
                                                  .AddJsonFile("appsettings.json", optional: true);

            var config = configBuilder.Build();

            var connectionstring = config.GetConnectionString("StandaardverBInding");

            //setup our DI
            var serviceProvider = new ServiceCollection()
                                  .AddLogging()
                                  .AddScoped <IClientManager, ClientManager>()
                                  .AddScoped <ICountryManager, CountryManager>()
                                  .AddScoped <IInvoiceManager, InvoiceManager>()
                                  .AddScoped <IConsultManager, ConsultManager>()
                                  .AddScoped <IClientRepository, ClientRepository>()
                                  .AddScoped <ICountryRepository, CountryRepository>()
                                  .AddScoped <IInvoiceRepository, InvoiceRepository>()
                                  .AddScoped <IConsultRepository, ConsultRepository>()

                                  // Onderstaande regel is nodig omdat DI voor de gehele keten moet werken:

                                  .AddDbContext <ApplicationDbContext>(options => options.UseSqlServer(connectionstring))
                                  .BuildServiceProvider();

            clientManager  = serviceProvider.GetService <IClientManager>();
            countryManager = serviceProvider.GetService <ICountryManager>();
            invoiceManager = serviceProvider.GetService <IInvoiceManager>();
            consultManager = serviceProvider.GetService <IConsultManager>();
        }
 public BranchController(IBranchManager iBranchManager,
                         ICountryManager iCountryManager, ICityManager iCityManager)
 {
     _iBranchManager  = iBranchManager;
     _iCountryManager = iCountryManager;
     _iCityManager    = iCityManager;
 }
 public FrmDragDropListBoxToListBoxClients(IClientManager clientManager,
                                           ICountryManager countryManager)
 {
     InitializeComponent();
     _clientManager  = clientManager;
     _countryManager = countryManager;
 }
 public FrmCountryListBox(IClientManager clientManager,
                          ICountryManager countryManager)
 {
     InitializeComponent();
     _clientManager  = clientManager;
     _countryManager = countryManager;
 }
Пример #8
0
 public CityService(IRepository <Country> countryRepository,
                    IMapper mapper,
                    ICountryManager countryManager)
 {
     _countryRepository = countryRepository;
     _mapper            = mapper;
     _countryManager    = countryManager;
 }
Пример #9
0
 public RootQuery(IAddressManager addressManager, IArticleManager articleManager,
                  ICountryManager countryManager, ICityManager cityManager, IPersonManager personManager,
                  IStateManager stateManager, IUnitManager unitManager)
 {
     InitDependencies(addressManager, articleManager, cityManager, countryManager,
                      personManager, stateManager, unitManager);
     InitQuery();
 }
 public EditWindow()
 {
     InitializeComponent();
     policyManager  = new PolicyManager();
     quoteManager   = new QuoteManager();
     countryManager = new CountryManager();
     countriesList  = countryManager.GetCountries();
 }
Пример #11
0
 public CountryController(ICountryManager countryManager,
                          IImageManager imageManager,
                          IOptions <TravelxSettings> config)
 {
     _countryManager = countryManager;
     _imageManager   = imageManager;
     _settings       = config?.Value;
 }
Пример #12
0
 public ClientController(ILogger <ClientController> logger,
                         IClientManager clientManager,
                         ICountryManager countryManager)
 {
     _logger         = logger;
     _clientManager  = clientManager;
     _countryManager = countryManager;
 }
Пример #13
0
		public BootstrapViewModel(ICountryManager countryManager, ICityManager cityManager, ILocalizationService localizationService)
			: base()
		{
			this._localizationService = localizationService;
			this._countryManager = countryManager;
			this._cityManager = cityManager;
			this.Language = localizationService.Language;
		}
Пример #14
0
 public NewPolicy()
 {
     InitializeComponent();
     policy         = new Policy();
     policyManager  = new PolicyManager();
     countryManager = new CountryManager();
     countriesList  = countryManager.GetCountries();
     DataContext    = this;
 }
 public NewQuote()
 {
     InitializeComponent();
     quote          = new Quote();
     quoteManager   = new QuoteManager();
     countryManager = new CountryManager();
     countriesList  = countryManager.GetCountries();
     DataContext    = this;
 }
Пример #16
0
 private void InitDependencies(IDataLoaderContextAccessor accessor, ICityManager cityManager,
                               ICountryManager countryManager, IStateManager stateManager, IPersonManager personManager)
 {
     Accessor       = accessor;
     CityManager    = cityManager;
     CountryManager = countryManager;
     StateManager   = stateManager;
     PersonManager  = personManager;
 }
Пример #17
0
		public StoreFilter()
			:base()
		{
			_authService = Mvx.Resolve<IAuthenticationService>();
			_countryManager = Mvx.Resolve<ICountryManager>();
			_cityManager = Mvx.Resolve<ICityManager>();

			initialize();
		}
 public ManufacturerController(
     IManufacturerManager manufacturerManager,
     ICountryManager countryManager,
     IManufacturerFieldCopier manufacturerFieldCopier)
 {
     _manufacturerManager     = manufacturerManager;
     _countryManager          = countryManager;
     _manufacturerFieldCopier = manufacturerFieldCopier;
 }
Пример #19
0
 public UserPage(IUserInfoManager userInfoManager, IApplicationUser user, ICountryManager countryManager, IAdressManager adressManager, ICardInfoMananger cardInfoMananger)
 {
     this._user             = user;
     this._userInfoManager  = userInfoManager;
     this._countryManager   = countryManager;
     this._adressManager    = adressManager;
     this._cardInfoMananger = cardInfoMananger;
     InitializeComponent();
     InitFields();
 }
Пример #20
0
 public RegisterForm(IRegisterManager registerManager, IAdressManager adressManager, IBankManager bankManager, ICountryManager countryManager, IApplicationUser user)
 {
     this._registerManager = registerManager;
     this._adressManager   = adressManager;
     this._bankManager     = bankManager;
     this._countryManager  = countryManager;
     this._user            = user;
     InitializeComponent();
     InitForm();
 }
Пример #21
0
 public LoginForm(IAuthManager manager, IRegisterManager registerManager, IAdressManager adressManager, IBankManager bankManager, ICountryManager countryManager, IUserInfoManager userInfoManager, IApplicationUser user)
 {
     InitializeComponent();
     _manager = manager;
     this._registerManager = registerManager;
     this._adressManager   = adressManager;
     this._bankManager     = bankManager;
     this._countryManager  = countryManager;
     this._user            = user;
     this._userInfoManager = userInfoManager;
 }
 public FrmClientListView(IClientManager clientManager,
                          ICountryManager countryManager,
                          IInvoiceManager invoiceManager,
                          IConsultManager consultManager)
 {
     InitializeComponent();
     _clientManager  = clientManager;
     _countryManager = countryManager;
     _invoiceManager = invoiceManager;
     _consultManager = consultManager;
 }
Пример #23
0
		public ProfileSettingsViewModel(IAuthenticationService authService, IMvxMessenger messenger, 
			ICountryManager countryManager, ICityManager cityManager,
			IUserManager userManager)
			: base(authService, messenger)
		{
			this.ShouldSubscribeToSessionChange = true;
			this._countryManager = countryManager;
			this._cityManager = cityManager;
			this._userManager = userManager;
			PropertyChanged += propertyChanged;
			updateUserData();
		}
Пример #24
0
		public SaveStoreViewModel(IStoreManager storeManager, IStoreCategoryManager categoryManager, ICountryManager countryManager, 
			ICityManager cityManager, IAuthenticationService authService, IMvxMessenger messenger)
			: base(authService, messenger)
		{
			this.ShouldSubscribeToSessionChange = true;
			this._storeManager = storeManager;
			this._cityManager = cityManager;
			this._countryManager = countryManager;
			this._categoryManager = categoryManager;
			this.PropertyChanged += propertyChanged;
			this.MainImage = new ImageViewModel();
		}
Пример #25
0
 private void InitDependencies(IAddressManager addressManager, IArticleManager articleManager,
                               ICityManager cityManager, ICountryManager countryManager, IPersonManager personManager,
                               IStateManager stateManager, IUnitManager unitManager)
 {
     AddressManager = addressManager;
     ArticleManager = articleManager;
     CityManager    = cityManager;
     CountryManager = countryManager;
     PersonManager  = personManager;
     StateManager   = stateManager;
     UnitManager    = unitManager;
 }
Пример #26
0
 public TelephonesController(ITelephoneManager telephoneManager, ICountryManager countryManager, ITelephoneTypeManager telephoneTypeManager,
                             ICustomerManager customerManager, IContactManager contactManager, IBuildingManager buildingManager,
                             IMapper mapper, IJsonApiBuilder jsonApiBuilder)
 {
     _telephoneManager     = telephoneManager;
     _countryManager       = countryManager;
     _telephoneTypeManager = telephoneTypeManager;
     _customerManager      = customerManager;
     _contactManager       = contactManager;
     _buildingManager      = buildingManager;
     _mapper         = mapper;
     _jsonApiBuilder = jsonApiBuilder;
 }
Пример #27
0
 public BuildingsController(IBuildingManager buildingManager, ITelephoneManager telephoneManager, ICountryManager countryManager,
                            ILanguageManager languageManager, IHonorificPrefixManager honorificPrefixManager,
                            IIncludedCollector includedCollector, IMapper mapper, IJsonApiBuilder jsonApiBuilder)
 {
     _buildingManager        = buildingManager;
     _telephoneManager       = telephoneManager;
     _countryManager         = countryManager;
     _languageManager        = languageManager;
     _honorificPrefixManager = honorificPrefixManager;
     _includedCollector      = includedCollector;
     _mapper         = mapper;
     _jsonApiBuilder = jsonApiBuilder;
 }
Пример #28
0
		public FilterStoresViewModel(IStoreManager storeManager,
		                             IStoreCategoryManager categoryManager,
		                             ICountryManager countryManager, 
		                             ICityManager cityManager, 
		                             ITagManager tagManager)
			: base()
		{
			this._storeManager = storeManager;
			this._tagManager = tagManager;
			this._cityManager = cityManager;
			this._countryManager = countryManager;
			this._categoryManager = categoryManager;
			this.StoreFilter.PropertyChanged += StoreFilter_PropertyChanged;
		}
Пример #29
0
 public ContactsController(IContactManager contactManager, ICountryManager countryManager,
                           ILanguageManager languageManager, IHonorificPrefixManager honorificPrefixManager,
                           IRequestManager requestManager, IInvoiceManager invoiceManager,
                           IIncludedCollector includedCollector, IMapper mapper, IJsonApiBuilder jsonApiBuilder)
 {
     _contactManager         = contactManager;
     _countryManager         = countryManager;
     _languageManager        = languageManager;
     _honorificPrefixManager = honorificPrefixManager;
     _requestManager         = requestManager;
     _invoiceManager         = invoiceManager;
     _includedCollector      = includedCollector;
     _mapper         = mapper;
     _jsonApiBuilder = jsonApiBuilder;
 }
Пример #30
0
 public ParticipationService(
     IInstantWinService instantWinService,
     IPrizeManager prizeManager,
     IParticipantManager participantManager,
     IParticipationManager participationManager,
     ICountryManager countryManager,
     ISynchronizationService crmService)
 {
     _instantWinService    = instantWinService;
     _participationManager = participationManager;
     _prizeManager         = prizeManager;
     _participantManager   = participantManager;
     _crmService           = crmService;
     _countryManager       = countryManager;
 }
Пример #31
0
 public void Initialize()
 {
     _mockRepository = new Mock <ICountryRepository>();
     _service        = new CountryManager(_mockRepository.Object);
     list            = new List <Country> {
         new Country {
             Id = 1, Name = "US"
         },
         new Country {
             Id = 2, Name = "India"
         },
         new Country {
             Id = 3, Name = "Russia"
         }
     };
 }
Пример #32
0
 public FilterProductsViewModel(IProductManager productManager,
                                IProductCategoryManager categoryManager,
                                IProductSubcategoryManager subcategoryManager,
                                ICountryManager countryManager,
                                ICityManager cityManager,
                                ITagManager tagManager)
     : base()
 {
     this._productManager = productManager;
     this._tagManager = tagManager;
     this._cityManager = cityManager;
     this._countryManager = countryManager;
     this._subcategoryManager = subcategoryManager;
     this._categoryManager = categoryManager;
     this.ProductFilter.PropertyChanged += ProductFilter_PropertyChanged;
     this.ProductFilter.Tags.CollectionChanged += tagsChanged;
 }
Пример #33
0
 public ValidationController(
     ICarModelManager carModelManager,
     IManufacturerManager manufacturerManager,
     ICountryManager countryManager,
     ICarBodyTypeManager carBodyTypeManager,
     ICarOptionManager carOptionManager,
     IFuelTypeManager fuelTypeManager,
     ITransmitionTypeManager transmitionTypeManager
     )
 {
     _carModelManager        = carModelManager;
     _manufacturerManager    = manufacturerManager;
     _countryManager         = countryManager;
     _carBodyTypeManager     = carBodyTypeManager;
     _carOptionManager       = carOptionManager;
     _fuelTypeManager        = fuelTypeManager;
     _transmitionTypeManager = transmitionTypeManager;
 }
Пример #34
0
 public PayLendUserManager(IPayLendUserRepository repository, ICountryManager countryManager, IAccountCodeConfirmationManager accountCodeConfirmationManager, IPayLendCardManager payLendCardManager, ILogManager logManager,
                           IAzureStorageManager azureStorageManager, IEmailLogManager emailLogManager, IBankManager bankManager, IResetPasswordManager resetPasswordManager, IBankUserManager bankUserManager,
                           IPayLendConfigManager payLendConfigManager, IBackOfficeTopUpManager backOfficeTopUpManager, IBorrowerAgencyDataManager borrowerAgencyDataManager, IUser_PermissionManager userPermissionManager)
 {
     _repository     = repository;
     _countryManager = countryManager;
     _accountCodeConfirmationManager = accountCodeConfirmationManager;
     _payLendCardManager             = payLendCardManager;
     _logManager                = logManager;
     _azureStorageManager       = azureStorageManager;
     _emailLogManager           = emailLogManager;
     _bankManager               = bankManager;
     _resetPasswordManager      = resetPasswordManager;
     _bankUserManager           = bankUserManager;
     _payLendConfigManager      = payLendConfigManager;
     _backOfficeTopUpManager    = backOfficeTopUpManager;
     _borrowerAgencyDataManager = borrowerAgencyDataManager;
     _userPermissionManager     = userPermissionManager;
 }
Пример #35
0
        public CreateAssetCommandValidator(ICountryManager countryManager)
        {
            RuleFor(x => x.AssetName)
            .NotEmpty()
            .MinimumLength(5);

            RuleFor(x => x.Department)
            .Cascade(CascadeMode.Stop)
            .NotEmpty()
            .Must(x => Enum.IsDefined(typeof(Department), x))
            .WithMessage("Department is not valid");

            RuleFor(x => x.EMailAdressOfDepartment).EmailAddress(FluentValidation.Validators.EmailValidationMode.AspNetCoreCompatible);

            RuleFor(x => x.CountryOfDepartment)
            .MustAsync((x, cancellation) => countryManager.CountryIsValid(x))
            .WithMessage("Country is not valid");

            RuleFor(x => x.PurchaseDate).GreaterThan(x => DateTime.UtcNow.AddYears(-1));
        }
Пример #36
0
        //public UserController(
        //    IUnitOfWork unitOfWork,
        //    TournamentRegistrationsManager tournamentRegistrationsManager,
        //    ISendMail sendMail,
        //    OrganizationManager organizationManager,
        //    ISecurityManager securityManager,
        //    ICountryManager countryManager,
        //    ITournamentManager tournamentManager)
        //{
        //    this.unitOfWork = unitOfWork;
        //    this.tournamentRegistrationsManager = tournamentRegistrationsManager;
        //    this.sendMail = sendMail;
        //    this.organizationManager = organizationManager;
        //    this.userManager = this.UserManager;
        //    this.securityManager = securityManager;
        //    this.countryManager = countryManager;
        //    this.tournamentManager = tournamentManager;
        //}

        public UserController(
            IUnitOfWork unitOfWork,
            TournamentRegistrationsManager tournamentRegistrationsManager,
            ISendMail sendMail,
            OrganizationManager organizationManager,
            DebRegUserManager userManager,
            ISecurityManager securityManager,
            ICountryManager countryManager,
            ITournamentManager tournamentManager)
        {
            this.unitOfWork = unitOfWork;
            this.tournamentRegistrationsManager = tournamentRegistrationsManager;
            this.sendMail = sendMail;
            this.organizationManager = organizationManager;
            this.securityManager = securityManager;
            this.countryManager = countryManager;
            this.tournamentManager = tournamentManager;
            this.userManager = userManager;
        }
 public CountryViewModel(
         ICountryManager countryManager
     )
 {
     _countryManager = countryManager;
 }
Пример #38
0
 public ConsumerManager(ICountryManager countryManager)
 {
     _countryManager = countryManager;
 }
Пример #39
0
 public ReportController(ITournamentRegistrationsManager tournamentRegistrationsManager, ITournamentManager tournamentManager, ICountryManager countryManager, DebRegUserManager userManager, ISecurityManager securityManager, ISlotManager slotManager)
 {
     this.tournamentRegistrationsManager = tournamentRegistrationsManager;
     this.tournamentManager = tournamentManager;
     this.countryManager = countryManager;
     this.securityManager = securityManager;
     this.userManager = userManager;
     this.slotManager = slotManager;
 }