public static AccountDetailsViewModel Build(AccountModule accountModule, int accountId) { var account = accountModule.Get(accountId); return account == null ? BuildInvalidAccountViewModel() : BuildViewModel(accountModule, account); }
private static BankCardViewModel BuildViewModel(BankCardModule bankCardModule, AccountModule accountModule, BankCard bankCard) { var bankAccount = accountModule.Get(bankCard.AccountId); return new BankCardViewModel { Id = bankCard.Id, AccountNumber = bankAccount.AccountNumber, Status = bankCard.Disabled ? "Disabled" : "Active", Disabled = bankCard.Disabled }; }