コード例 #1
0
        private static AccountViewModel BuildViewModel(AccountModule accountModule, Account account)
        {
            decimal balance = accountModule.GetAccountBalance(account.Id);
            Client client = accountModule.GetAccountHolder(account.Id);

            return new AccountViewModel
            {
                AccountNumber = account.AccountNumber,
                Balance = balance.ToString("C"),
                Id = account.Id,
                ClientName = client.ClientName,
                Status = account.Closed ? "Closed" : "Open",
                Closed = account.Closed
            };
        }
        private static AccountDetailsViewModel BuildViewModel(AccountModule accountModule, Account account)
        {
            decimal balance = accountModule.GetAccountBalance(account.Id);
            IEnumerable<Transaction> ledger = accountModule.GetLedger(account.Id);
            Client client = accountModule.GetAccountHolder(account.Id);

            return new AccountDetailsViewModel
            {
                AccountNumber = account.AccountNumber,
                Balance = balance.ToString("C"),
                Id = account.Id,
                ClientName = client.ClientName,
                Status = account.Closed ? "Closed" : "Open",
                Ledger = ledger
            };
        }