示例#1
0
        public void AddAccount(AccountData account)
        {
            lock (this)
            {
                var security = this.destinationBook.Securities.Where(s => s.SecurityId == account.SecurityId).Single();

                Account parent = null;
                if (account.ParentAccountId.HasValue)
                {
                    parent = this.destinationBook.Accounts.Where(a => a.AccountId == account.ParentAccountId).Single();
                }

                var newAccount = new Account(
                    account.AccountId,
                    account.AccountType,
                    security,
                    parent,
                    account.Name,
                    account.SmallestFraction);

                this.destinationBook.AddAccount(
                    newAccount);
            }
        }
示例#2
0
 /// <summary>
 /// Adds an account to the <see cref="SaveTrack"/>.
 /// </summary>
 /// <param name="account">The account to add.</param>
 public void AddAccount(AccountData account)
 {
     this.actions.Add(new Action
     {
         ActionType = ActionType.AddAccount,
         Item = account,
     });
 }