Beispiel #1
0
        static void Main(string[] args)
        {
            service.CreateAccount(
                new Account
            {
                AccountType = AccountType.Base,
                Balance     = 300,
                FirstName   = "Vasya",
                LastName    = "Pupkin"
            });

            service.CreateAccount(
                new Account
            {
                AccountType = AccountType.Gold,
                Balance     = 500,
                FirstName   = "pasha",
                LastName    = "vaskin"
            });

            service.CreateAccount(
                new Account
            {
                AccountType = AccountType.Silver,
                Balance     = 400,
                FirstName   = "sasha",
                LastName    = "pashkin"
            });

            var account = service.GetAccounts();

            foreach (var item in account)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("Add balance");

            foreach (var item in account)
            {
                service.AddBalance(item.Id, 50);
            }

            foreach (var item in account)
            {
                Console.WriteLine(item);
            }

            Console.BackgroundColor = ConsoleColor.Red;

            Console.WriteLine("Remove balance");

            foreach (var item in account)
            {
                service.RemoveBalance(item.Id, 50);
            }

            foreach (var item in account)
            {
                Console.WriteLine(item);
            }

            Console.ReadKey();
        }