Exemplo n.º 1
0
        public CustomerRegistration(Context context) : base(context, "Namn?", "* Skapa kund *")
        {
            Customer = new AgiltBankLibrary.Models.Customer();
            while (Customer.Id < 1)
            {
                Customer.Id = Guid.NewGuid().GetHashCode();
            }

            AssignProperty = AssignName;

            Console.WriteLine(Header);
            Read();
        }
Exemplo n.º 2
0
        private void WriteCustomerSummary(AgiltBankLibrary.Models.Customer customer)
        {
            Console.WriteLine($"Kundnummer: {customer.Id}");
            Console.WriteLine($"Organisationsnummer: {customer.OrganisationNumber}");
            Console.WriteLine($"Namn: {customer.Name}");
            Console.WriteLine($"Adress: {customer.StreetAddress}, {customer.PostalCode} {customer.City}");

            var accounts = Context.BankData.Accounts.Where(a => a.CustomerId == customer.Id).ToList();

            if (accounts.Count > 0)
            {
                Console.WriteLine();
                Console.WriteLine("Konton");

                foreach (var account in accounts)
                {
                    var balance = account.Balance.ToString(new CultureInfo("sv-SE"));
                    Console.WriteLine($"{account.Id}: {balance} kr");
                }
            }
        }