Пример #1
0
 public InvestorDepot Login(InvestorRegistration r, string exchangeId)
 {
     email = r.Email;
     client.SubscribeOnNewShareInformationAvailable(exchangeId);
     client.SubscribeOnNewOrderAvailable(exchangeId);
     client.SubscribeOnNewTransactionAvailable(exchangeId);
     client.SubscribeOnNewInvestorDepotAvailable(exchangeId);
     return(client.LoginInvestor(r, exchangeId));
 }
Пример #2
0
        public InvestorDepot LoginInvestor(InvestorRegistration registration, string exchangeId)
        {
            InvestorDepot depot;
            var           exists = data.Exchanges[exchangeId].InvestorDepots.TryGetValue(registration.Email, out depot);

            if (!exists)
            {
                depot = new InvestorDepot {
                    Id = registration.Email, ExchangeName = exchangeId, Budget = 0, Shares = new Dictionary <string, int>()
                };
            }
            depot.Budget += registration.Budget;
            data.Exchanges[exchangeId].InvestorDepots[depot.Id] = depot;
            return(depot);
        }