Пример #1
0
        public static TT_Account GetAccount(string account_id)
        {
            if (!privInstance.accounts.ContainsKey(account_id))
            {
                TT_Account req = RequestAccount(account_id);
                if (req != null)
                {
                    privInstance.accounts.Add(req.id, req);
                }
            }
            TT_Account acct = privInstance.accounts[account_id];

            return(acct);
        }
Пример #2
0
        private static TT_Account RequestAccount(string account_id)
        {
            var result = RestManager.GetRequest("risk", "account/" + account_id);

            try
            {
                AccountResponse acct = JsonConvert.DeserializeObject <AccountResponse>(result.Content);
                return(acct.account[0]);
            }
            catch (Exception)
            {
                TT_Account acct = new TT_Account();
                acct.id   = account_id;
                acct.name = "PLACEHOLDER";
                return(acct);
            }
        }