예제 #1
0
        public Account GetAccount()
        {
            AccountPM account = accountsRepository.GetAccountAndCardsForUser(GetCurrentUserId());

            Account accountDetails = new Account()
            {
                AccountNumberId  = account.AccountNumberId,
                AccountState     = account.AccountState,
                CustomerType     = account.CustomerType,
                FirstName        = account.FirstName,
                LastName         = account.LastName,
                BusinessName     = account.BusinessName,
                CompanyRegNumber = account.CompanyRegNumber,
                TaxNumber        = account.TaxNumber,
                Balance          = account.Balance,
            };

            account.Cards.ForEach(x =>
            {
                Card cd = new Card()
                {
                    CardSerialNumberId = x.CardSerialNumberId,
                    CardState          = x.CardState,
                    DailySpendLimit    = x.DailySpendLimit,
                    MonthlySpendLimit  = x.MonthlySpendLimit,
                    FreindlyName       = x.FreindlyName,
                };
                accountDetails.Cards.Add(cd);
            });

            return(accountDetails);
        }