예제 #1
0
        /// <summary>
        /// Get a member's balances.
        /// </summary>
        /// <param name="member">Member.</param>
        /// <returns>map currency: total</returns>
        public static IDictionary <string, double> MemberGetBalanceSample(UserMember member)
        {
            Dictionary <string, double> sums = new Dictionary <string, double>();

            IList <Tokenio.User.Account> accounts = member.GetAccountsBlocking();

            foreach (Tokenio.User.Account account in accounts)
            {
                Money balance = member.GetBalanceBlocking(account.Id(), Key.Types.Level.Standard).Current;

                sums[balance.Currency] = Double.Parse(balance.Value) + SampleExtensions.GetValueOrDefault(sums, balance.Currency, 0.0);
            }
            return(sums);
        }