Esempio n. 1
0
        // P-S-T module

        /// <summary>
        /// Gets portfolio-security-target composition.
        /// </summary>
        /// <param name="portfolioId">Portfolio ID for which composition is requested.</param>
        public ManagingPst.RootModel GetPstModel(String portfolioId)
        {
            using (var ondemandManager = new OnDemandDataManager(this.connectionFactory, this.dataManagerFactory))
            {
                var securityRepository = this.RepositoryManager.ClaimSecurityRepository(ondemandManager);
                var result             = this.PstManager.GetPstRootModel(ondemandManager.Claim(), portfolioId, securityRepository);
                return(result);
            }
        }
Esempio n. 2
0
        // security picker

        /// <summary>
        /// Gets a list of securities whose names match the pattern.
        /// </summary>
        public IEnumerable <ISecurity> GetSecurities(String securityNamePattern, Int32 atMost)
        {
            using (var ondemandManager = new OnDemandDataManager(this.connectionFactory, this.dataManagerFactory))
            {
                var repository = this.RepositoryManager.ClaimSecurityRepository(ondemandManager);
                var securities = repository.FindSomeUsingPattern(securityNamePattern, atMost, security => true);
                return(securities);
            }
        }
Esempio n. 3
0
 public Gadgets.PortfolioPicker.RootModel GetTargetingTypePortfolioPickerModel()
 {
     using (var ondemandManager = new OnDemandDataManager(this.connectionFactory, this.dataManagerFactory))
     {
         var targetingTypeRepository = this.RepositoryManager.ClaimTargetingTypeRepository(ondemandManager);
         var portfolioRepository     = this.RepositoryManager.ClaimPortfolioRepository(ondemandManager);
         var result = this.PortfiolioPickerManager.GetRootModel(targetingTypeRepository, portfolioRepository);
         return(result);
     }
 }
Esempio n. 4
0
 public IEnumerable <ISecurity> GetSecurities(String securityNamePattern, Int32 atMost, Int32 basketId)
 {
     using (var ondemandManager = new OnDemandDataManager(this.connectionFactory, this.dataManagerFactory))
     {
         var securityRepository = this.RepositoryManager.ClaimSecurityRepository(ondemandManager);
         var basketRepository   = this.RepositoryManager.ClaimBasketRepository(ondemandManager);
         var basket             = basketRepository.GetBasket(basketId);
         var securities         = securityRepository.FindSomeUsingPattern(
             securityNamePattern,
             atMost,
             security => this.BasketManager.IsSecurityFromBasket(security, basket));
         return(securities);
     }
 }
Esempio n. 5
0
        // backet picker

        public Gadgets.BasketPicker.RootModel GetBasketPickerRootModel(String username)
        {
            IEnumerable <TargetingTypeGroup> targetingTypeGroups;
            IEnumerable <UsernameBasketInfo> userBaskets;

            using (var ondemandManager = new OnDemandDataManager(this.connectionFactory, this.dataManagerFactory))
            {
                var targetingTypeGroupRepository = this.RepositoryManager.ClaimTargetingTypeGroupRepository(ondemandManager);
                targetingTypeGroups = targetingTypeGroupRepository.GetTargetingTypeGroups();
                userBaskets         = ondemandManager.Claim().GetUsernameBaskets(username);
            }
            var result = this.BasketPickerManager.GetRootModel(targetingTypeGroups, userBaskets);

            return(result);
        }