Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var userKeeper = new UserKeeper();
            Gym newGym     = new Gym();

            char ch = ' ';

            while (ch != 'e')
            {
                Console.WriteLine("1. Add new client\n" +
                                  "2. Print a list of clients\n" +
                                  "3. Coach all clients\n" +
                                  "e. Exit\n\n" +
                                  "Your choice: ");

                ch = ReadFromConsole(ch);

                switch (ch)
                {
                case '1':
                    Console.WriteLine("Please input customer name: ");
                    string name = Console.ReadLine();
                    Console.WriteLine("\nPlease input an amount of exercises is needed to be done: ");
                    int exercises = ReadFromConsole();

                    User newUser = new User(name, exercises);
                    newGym.Add(newUser);

                    Console.WriteLine("New customer was actually created and added to a list\n");

                    Console.WriteLine("Do you wsnt to do something else?\n");

                    break;

                case '2':
                    Console.WriteLine("Here's the list of customers");
                    newGym.PrintList();

                    Console.WriteLine("Do you wsnt to do something else?\n");
                    break;

                case '3':

                    newGym.Training();

                    Console.WriteLine("Do you want to do something else?\n");
                    break;

                case 'e':
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public void PrintList()
 {
     UserKeeper.PrintAllUsers();
 }
Exemplo n.º 3
0
 public void Delete(User user)
 {
     UserKeeper.DeleteUser(user);
 }
Exemplo n.º 4
0
 public void Add(User user)
 {
     UserKeeper.AddUser(user);
 }