Beispiel #1
0
        public CASAManager(List <CustodialAccount> custAccounts)
        {
            CustAccounts  = custAccounts;
            Clients       = CustAccounts.SelectMany(a => a.getClients()).Distinct().ToList();
            Suitabilities = Clients.Select(c => c.Suitablity).Distinct().ToList();
            Advisers      = CustAccounts.Select(c => c.PrimaryAdviser).Distinct().ToList();
            CustodialAccount acc = new CustodialAccount();

            CaAccounts = CustAccounts.GroupBy(c => new { c.PrimaryClient, c.PrimaryAdviser, c.PrimaryClient.Suitablity })
                         //.Select(a=> a.ToList().ForEach())

                         .Select(a =>
            {
                CambridgeAccount ca = new CambridgeAccount(a.Key.PrimaryClient, a.Key.PrimaryAdviser);
                a.ToList().ForEach(account => ca.AddCustAccount(account));
                return(ca);
            }).ToList();



            //.Select(ca => CustAccounts.FindAll(cua => cua.PrimaryClient ==  ca.PrimaryClient && cua.PrimaryAdviser == ca.PrimaryAdviser ).ForEach(resacc => ca.AddCustAccount(resacc)))).getCambridgeAccounts();

            //.Select(new CambridgeAccount(CAAcct.PrilmaryClient, CAAcct.PrimaryAdviser)).ToList();
        }
Beispiel #2
0
 public void AddCustAccount(CustodialAccount a)
 {
     _accounts.Add(a);
     a.Subscribe(this);
 }