Example #1
0
 public MessagesController(IMessageRepository repo, IBrokerRepository bRepo, IStaffProfileRepository sRepo, IKWTaskRepository repo2)
 {
     messageRepo = repo;
     brokerRepo  = bRepo;
     staffRepo   = sRepo;
     taskRepo    = repo2;
 }
Example #2
0
 public ApartmentAdDetailsQueryHandler(
     IApartmentAdRepository apartmentAdRepository,
     IBrokerRepository brokerRepository)
 {
     this.apartmentAdRepository = apartmentAdRepository;
     this.brokerRepository      = brokerRepository;
 }
        private AccountCheckStream()
        {
            walletRepository  = new WalletRepository();
            accountRepository = AccountRepository.Instance;
            orderRepository   = OrderRepository.Instance;
            profitCalculator  = ProfitCalculator.Instance;
            tradeManager      = ManagerTrade.Instance.tradeManager;
            brokerRepository  = new BrokerRepository();

            threadIntervalMils = AppConfig.GetIntParam("CheckLoop.Interval", 100);

            schedules = new[]
            {
                new Schedule(CheckOrders, AppConfig.GetIntParam("CheckLoop.IntervalOrders", 300)),
                new Schedule(CheckMargin, AppConfig.GetIntParam("CheckLoop.IntervalMargin", 15000)),
                new Schedule(CheckSwap, AppConfig.GetIntParam("CheckLoop.IntervalSwap", 1000)),
                new Schedule(RenewSubscriptions, AppConfig.GetIntParam("CheckLoop.UpdateSubscriptions", 1000))
            };

            // параметры начисления свопов
            var    dicMetadata = brokerRepository.GetMetadataByCategory("SWAP");
            object swapHourGmtObj, minutesToCheckSwapObj;

            if (!dicMetadata.TryGetValue("Hour.GMT", out swapHourGmtObj))
            {
                swapHourGmtObj = 21;
            }
            swapCheckHourGmt = (int)swapHourGmtObj;

            if (!dicMetadata.TryGetValue("MinutesToCheck", out minutesToCheckSwapObj))
            {
                minutesToCheckSwapObj = 0;
            }
            minutesToCheckSwap = (int)minutesToCheckSwapObj;
        }
Example #4
0
        public BrokerController(
			IBrokerRepository brokerRepository,
			IMappingEngine mappingEngine)
        {
            _brokerRepository = brokerRepository;
            _mappingEngine = mappingEngine;
        }
 public EditBrokerCommandHandler(
     ICurrentUser currentUser,
     IBrokerRepository brokerRepository)
 {
     this.currentUser      = currentUser;
     this.brokerRepository = brokerRepository;
 }
        private AccountCheckStream()
        {
            walletRepository = new WalletRepository();
            accountRepository = AccountRepository.Instance;
            orderRepository = OrderRepository.Instance;
            profitCalculator = ProfitCalculator.Instance;
            tradeManager = ManagerTrade.Instance.tradeManager;
            brokerRepository = new BrokerRepository();

            threadIntervalMils = AppConfig.GetIntParam("CheckLoop.Interval", 100);

            schedules = new[]
                {
                    new Schedule(CheckOrders, AppConfig.GetIntParam("CheckLoop.IntervalOrders", 300)),
                    new Schedule(CheckMargin, AppConfig.GetIntParam("CheckLoop.IntervalMargin", 15000)),
                    new Schedule(CheckSwap, AppConfig.GetIntParam("CheckLoop.IntervalSwap", 1000)),
                    new Schedule(RenewSubscriptions, AppConfig.GetIntParam("CheckLoop.UpdateSubscriptions", 1000))
                };

            // параметры начисления свопов
            var dicMetadata = brokerRepository.GetMetadataByCategory("SWAP");
            object swapHourGmtObj, minutesToCheckSwapObj;
            if (!dicMetadata.TryGetValue("Hour.GMT", out swapHourGmtObj))
                swapHourGmtObj = 21;
            swapCheckHourGmt = (int) swapHourGmtObj;

            if (!dicMetadata.TryGetValue("MinutesToCheck", out minutesToCheckSwapObj))
                minutesToCheckSwapObj = 0;
            minutesToCheckSwap = (int)minutesToCheckSwapObj;
        }
Example #7
0
 public PiDetailService(IPiDetailRepository piDetailRepository, IPiRepository piRepository, IBrokerRepository brokerRepository, ICommodityCustomerRepository customerRepository)
 {
     this.piDetailRepository = piDetailRepository;
     this.piRepository       = piRepository;
     _brokerRepository       = brokerRepository;
     this.customerRepository = customerRepository;
 }
Example #8
0
        public void Initialize()
        {
            // Initialize the data we're going to use in the tests
            _brokerListMock = BrokerMocks.GetBrokerListMock();

            // First we need to mock the DbSet
            _brokerDbSetMock = new Mock <DbSet <Broker> >();

            // Since we're faking the db context with async methods, we need to set up a few things first
            _brokerDbSetMock.As <IDbAsyncEnumerable <Broker> >()
            .Setup(m => m.GetAsyncEnumerator())
            .Returns(new TestDbAsyncEnumerator <Broker>(_brokerListMock.AsQueryable().GetEnumerator()));

            _brokerDbSetMock.As <IQueryable <Broker> >()
            .Setup(m => m.Provider)
            .Returns(new TestDbAsyncQueryProvider <Broker>(_brokerListMock.AsQueryable().Provider));

            _brokerDbSetMock.As <IQueryable <Broker> >().Setup(m => m.Expression).Returns(_brokerListMock.AsQueryable().Expression);
            _brokerDbSetMock.As <IQueryable <Broker> >().Setup(m => m.ElementType).Returns(_brokerListMock.AsQueryable().ElementType);
            _brokerDbSetMock.As <IQueryable <Broker> >().Setup(m => m.GetEnumerator()).Returns(_brokerListMock.AsQueryable().GetEnumerator());

            // Now we can mock the entire context
            _realStateContextMock = new Mock <IRealStateContext>();
            _realStateContextMock.Setup(context => context.Brokers).Returns(_brokerDbSetMock.Object);

            // Initialize the repository with the mocked dbContext
            _brokerRepositoryMock = new BrokerRepository(_realStateContextMock.Object);
        }
 public InteractionsController(IInteractionsRepository repo, IBrokerRepository repo2, IStaffProfileRepository repo3, IKWTaskRepository repo4)
 {
     intRepo    = repo;
     brokerRepo = repo2;
     staffRepo  = repo3;
     taskRepo   = repo4;
 }
 public BrokerCommandHandler(IBrokerRepository brokerRepository,
                             IUnitOfWork uow,
                             IMediatorHandler bus,
                             INotificationHandler <DomainNotification> notifications) : base(uow, bus, notifications)
 {
     _brokerRepository = brokerRepository;
     _bus = bus;
 }
Example #11
0
 public AdminController(IInteractionsRepository repo, IStaffProfileRepository repo2, UserManager <StaffUser> usrMgr, IBrokerRepository repo3, IKWTaskRepository repo4)
 {
     intRepo     = repo;
     staffRepo   = repo2;
     userManager = usrMgr;
     brokerRepo  = repo3;
     taskRepo    = repo4;
 }
Example #12
0
 public static void GenerateWallet(ICustomerRepository customerRepository,
                                   IBrokerRepository brokerRepository)
 {
     var customer = customerRepository.GetById(Guid.NewGuid());
     var broker   = brokerRepository.GetbyId(Guid.NewGuid());
     var wallet   = new Wallet(
         new BuyDate(new DateTime(20190909), new DateTime(20190912)));
 }
Example #13
0
 public HomeController(UserManager <StaffUser> usrMgr, IStaffProfileRepository repo, IKWTaskRepository repo2, IInteractionsRepository repo3, IBrokerRepository repo4)
 {
     staffProfRepo = repo;
     userManager   = usrMgr;
     taskRepo      = repo2;
     intRepo       = repo3;
     brokerRepo    = repo4;
 }
Example #14
0
 public BrokerDetailViewModel(IEventAggregator eventAggregator,
                              IMessageDialogService messageDialogService,
                              IBrokerRepository customerBrokerRepository)
     : base(eventAggregator, messageDialogService)
 {
     _messageDialogService = messageDialogService;
     _repository           = customerBrokerRepository;
 }
 public BrokerAppService(IMapper mapper,
                         IBrokerRepository brokerRepository,
                         IMediatorHandler bus)
 {
     _mapper           = mapper;
     _brokerRepository = brokerRepository;
     _bus = bus;
 }
Example #16
0
 public ChangeAvailabilityCommandHandler(
     ICurrentUser currentUser,
     IApartmentAdRepository apartmentAdRepository,
     IBrokerRepository brokerRepository)
 {
     this.currentUser           = currentUser;
     this.apartmentAdRepository = apartmentAdRepository;
     this.brokerRepository      = brokerRepository;
 }
 public CreateUserCommandHandler(
     IIdentity identity,
     IBrokerFactory brokerFactory,
     IBrokerRepository brokerRepository)
 {
     this.identity         = identity;
     this.brokerFactory    = brokerFactory;
     this.brokerRepository = brokerRepository;
 }
Example #18
0
 public DeleteApartmentAdCommandHandler(
     ICurrentUser currentUser,
     IApartmentAdRepository apartmentAdRepository,
     IBrokerRepository brokerRepository)
 {
     this.currentUser           = currentUser;
     this.apartmentAdRepository = apartmentAdRepository;
     this.brokerRepository      = brokerRepository;
 }
Example #19
0
 public BrokerManager(IUserManager userManager,
                      ICacheStoreManager cacheStoreManager,
                      ILogManager logManager,
                      IBrokerRepository brokerRepository,
                      IBrokerTransformationManager brokerTransformationManager)
     : base(userManager, cacheStoreManager, logManager)
 {
     _brokerRepository            = ValidateRepository(brokerRepository);
     _brokerTransformationManager = ValidateManager(brokerTransformationManager);
 }
Example #20
0
 public AwbPresenter(
     IAwbRepository awbs,
     IAwbFileRepository files,
     IBrokerRepository brokers,
     IStateRepository states)
 {
     _awbs    = awbs;
     _files   = files;
     _brokers = brokers;
     _states  = states;
 }
Example #21
0
        public Broker[] GetBrokers()
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                IBrokerRepository brokerRepository = _DataRepositoryFactory.GetDataRepository <IBrokerRepository>();

                Broker[] brokers = brokerRepository.Get().ToArray();

                return brokers;
            }));
        }
Example #22
0
		public AwbPresenter(
			IAwbRepository awbs,
			IAwbFileRepository files,
			IBrokerRepository brokers,
			IStateRepository states)
		{
			_awbs = awbs;
			_files = files;
			_brokers = brokers;
			_states = states;
		}
Example #23
0
		public AwbEventRecipientsFacade(
			IAdminRepository admins,
			IManagerRepository managers,
			IBrokerRepository brokers,
			IAwbRepository awbs,
			IEventEmailRecipient recipients)
		{
			_admins = admins;
			_managers = managers;
			_brokers = brokers;
			_awbs = awbs;
			_recipients = recipients;
		}
Example #24
0
 public AwbEventRecipientsFacade(
     IAdminRepository admins,
     IManagerRepository managers,
     IBrokerRepository brokers,
     IAwbRepository awbs,
     IEventEmailRecipient recipients)
 {
     _admins     = admins;
     _managers   = managers;
     _brokers    = brokers;
     _awbs       = awbs;
     _recipients = recipients;
 }
 public CurrencySaleService(ICurrencySaleRepository saleRepository, ICurrencySalePiDetailRepository salePiDetailRepository, ICurrencySaleExDecRepository saleExDecRepository, IExDeclarationRepository declarationRepository, IPiDetailRepository piDetailRepository, IBrokerRepository brokerRepository, ICustomerRepository customerRepository, IMiscellaneousCustomerRepository miscellaneousCustomerRepository, ICommodityCustomerRepository commodityCustomerRepository, IFinancialPeriodRepository financialPeriodRepository)
 {
     _saleRepository                  = saleRepository;
     _salePiDetailRepository          = salePiDetailRepository;
     _saleExDecRepository             = saleExDecRepository;
     _declarationRepository           = declarationRepository;
     _piDetailRepository              = piDetailRepository;
     _brokerRepository                = brokerRepository;
     _customerRepository              = customerRepository;
     _miscellaneousCustomerRepository = miscellaneousCustomerRepository;
     _commodityCustomerRepository     = commodityCustomerRepository;
     _financialPeriodRepository       = financialPeriodRepository;
 }
Example #26
0
        private ManagerTrade(Dictionary <string, IDealer> dealers)
        {
            accountRepository = AccountRepository.Instance;
            orderRepository   = OrderRepository.Instance;
            profitCalculator  = ProfitCalculator.Instance;
            walletRepository  = new WalletRepository();
            brokerRepository  = new BrokerRepository();

            this.dealers = dealers;
            foreach (var pair in dealers)
            {
                pair.Value.ServerInterface = this;
            }
        }
Example #27
0
		public AdminAwbController(
			IIdentityService identity,
			IAwbManager awbManager,
			IAwbPresenter awbPresenter,
			IAwbUpdateManager awbUpdateManager,
			IBrokerRepository brokers,
			ISenderRepository senders)
		{
			_identity = identity;
			_awbManager = awbManager;
			_awbPresenter = awbPresenter;
			_awbUpdateManager = awbUpdateManager;
			_brokers = brokers;
			_senders = senders;
		}
Example #28
0
 public AdminAwbController(
     IIdentityService identity,
     IAwbManager awbManager,
     IAwbPresenter awbPresenter,
     IAwbUpdateManager awbUpdateManager,
     IBrokerRepository brokers,
     ISenderRepository senders)
 {
     _identity         = identity;
     _awbManager       = awbManager;
     _awbPresenter     = awbPresenter;
     _awbUpdateManager = awbUpdateManager;
     _brokers          = brokers;
     _senders          = senders;
 }
Example #29
0
 public UserService(IUserRepository users,
                    IAdminRepository admins,
                    IManagerRepository managers,
                    ICarrierRepository carriers,
                    ISenderRepository senders,
                    IForwarderRepository forwarders,
                    IBrokerRepository brokers)
 {
     _users      = users;
     _admins     = admins;
     _managers   = managers;
     _carriers   = carriers;
     _senders    = senders;
     _forwarders = forwarders;
     _brokers    = brokers;
 }
Example #30
0
		public UserService(IUserRepository users,
			IAdminRepository admins,
			IManagerRepository managers,
			ICarrierRepository carriers,
			ISenderRepository senders,
			IForwarderRepository forwarders,
			IBrokerRepository brokers)
		{
			_users = users;
			_admins = admins;
			_managers = managers;
			_carriers = carriers;
			_senders = senders;
			_forwarders = forwarders;
			_brokers = brokers;
		}
Example #31
0
        private ManagerTrade(bool initialize)
        {
            accountRepository = AccountRepository.Instance;
            orderRepository   = OrderRepository.Instance;
            profitCalculator  = ProfitCalculator.Instance;
            brokerRepository  = new BrokerRepository();
            walletRepository  = new WalletRepository();

            if (!initialize)
            {
                return;
            }

            InitializeDealers();


            // инициализация сериализаторов
            SerializationWriter.TypeSurrogates.Add(new MarketOrderSerializer());
        }
Example #32
0
        public static async Task <Result> BrokerHasApartmentAd(
            this ICurrentUser currentUser,
            IBrokerRepository brokerRepository,
            int apartmentAdId,
            CancellationToken cancellationToken)
        {
            var brokerId = await brokerRepository.GetBrokerId(
                currentUser.UserId,
                cancellationToken);

            var brokerHasApartment = await brokerRepository.HasApartmentAd(
                brokerId,
                apartmentAdId,
                cancellationToken);

            return(brokerHasApartment
                ? Result.Success
                : "You cannot edit this apartment ad.");
        }
Example #33
0
		public IdentityService(
			IUserRepository users,
			IAdminRepository admins,
			IManagerRepository managers,
			ICarrierRepository carriers,
			ISenderRepository senders,
			IClientRepository clients,
			IForwarderRepository forwarders,
			IBrokerRepository brokers)
		{
			if(HttpContext.Current == null)
				throw new NotSupportedException("UserHolder works only when the HttpContext.Current is presented");

			_users = users;
			_admins = admins;
			_managers = managers;
			_carriers = carriers;
			_senders = senders;
			_clients = clients;
			_forwarders = forwarders;
			_brokers = brokers;
		}
Example #34
0
 public AirWaybillController(
     IAwbPresenter awbPresenter,
     IApplicationAwbManager applicationAwbManager,
     IAwbManager awbManager,
     IStateConfig config,
     IAwbRepository awbs,
     IAwbStateManager awbStateManager,
     ISenderRepository senders,
     IBrokerRepository brokers,
     IIdentityService identity)
 {
     _awbPresenter          = awbPresenter;
     _brokers               = brokers;
     _applicationAwbManager = applicationAwbManager;
     _awbManager            = awbManager;
     _config          = config;
     _awbs            = awbs;
     _awbStateManager = awbStateManager;
     _senders         = senders;
     _brokers         = brokers;
     _identity        = identity;
 }
Example #35
0
		public AirWaybillController(
			IAwbPresenter awbPresenter,
			IApplicationAwbManager applicationAwbManager,
			IAwbManager awbManager,
			IStateConfig config,
			IAwbRepository awbs,
			IAwbStateManager awbStateManager,
			ISenderRepository senders,
			IBrokerRepository brokers,
			IIdentityService identity)
		{
			_awbPresenter = awbPresenter;
			_brokers = brokers;
			_applicationAwbManager = applicationAwbManager;
			_awbManager = awbManager;
			_config = config;
			_awbs = awbs;
			_awbStateManager = awbStateManager;
			_senders = senders;
			_brokers = brokers;
			_identity = identity;
		}
Example #36
0
 public ApplicationEventRecipientsFacade(
     IAwbRepository awbs,
     IApplicationRepository applications,
     IAdminRepository admins,
     IManagerRepository managers,
     ISenderRepository senders,
     IClientRepository clients,
     ICarrierRepository carriers,
     IForwarderRepository forwarders,
     IBrokerRepository brokers,
     IEventEmailRecipient recipients)
 {
     _awbs         = awbs;
     _applications = applications;
     _admins       = admins;
     _managers     = managers;
     _senders      = senders;
     _clients      = clients;
     _carriers     = carriers;
     _forwarders   = forwarders;
     _brokers      = brokers;
     _recipients   = recipients;
 }
		public ApplicationEventRecipientsFacade(
			IAwbRepository awbs,
			IApplicationRepository applications,
			IAdminRepository admins,
			IManagerRepository managers,
			ISenderRepository senders,
			IClientRepository clients,
			ICarrierRepository carriers,
			IForwarderRepository forwarders,
			IBrokerRepository brokers,
			IEventEmailRecipient recipients)
		{
			_awbs = awbs;
			_applications = applications;
			_admins = admins;
			_managers = managers;
			_senders = senders;
			_clients = clients;
			_carriers = carriers;
			_forwarders = forwarders;
			_brokers = brokers;
			_recipients = recipients;
		}
Example #38
0
        public IdentityService(
            IUserRepository users,
            IAdminRepository admins,
            IManagerRepository managers,
            ICarrierRepository carriers,
            ISenderRepository senders,
            IClientRepository clients,
            IForwarderRepository forwarders,
            IBrokerRepository brokers)
        {
            if (HttpContext.Current == null)
            {
                throw new NotSupportedException("UserHolder works only when the HttpContext.Current is presented");
            }

            _users      = users;
            _admins     = admins;
            _managers   = managers;
            _carriers   = carriers;
            _senders    = senders;
            _clients    = clients;
            _forwarders = forwarders;
            _brokers    = brokers;
        }
Example #39
0
 private OrderRepository()
 {
     brokerRepository = new BrokerRepository();
 }
Example #40
0
        public BrokerValidationController(
			IBrokerRepository brokerRepository)
        {
            _brokerRepository = brokerRepository;
        }
 private DictionaryManager()
 {
     groupMarkupList = new ThreadSafeUpdatingList<GroupMarkup>(lockIntervalMils, updateIntervalMils, GroupMarkupUpdateRoutine);
     userList = new ThreadSafeUpdatingList<PlatformUser>(lockIntervalMils, updateIntervalMils, UserUpdateRoutine);
     brokerRepository = new BrokerRepository();
 }
Example #42
0
 private DictionaryManager()
 {
     groupMarkupList  = new ThreadSafeUpdatingList <GroupMarkup>(lockIntervalMils, updateIntervalMils, GroupMarkupUpdateRoutine);
     userList         = new ThreadSafeUpdatingList <PlatformUser>(lockIntervalMils, updateIntervalMils, UserUpdateRoutine);
     brokerRepository = new BrokerRepository();
 }