Exemple #1
0
        public void Run()
        {
            int choice = 0;

            do
            {
                IMenu genreMenu = new GenreMenu();
                choice = genreMenu.PrintMenu();
                switch (choice)
                {
                case (int)GenreMenuOption.Insert:
                    AddGenreAsync().Wait();
                    break;

                case (int)GenreMenuOption.Delete:
                    DeleteGenreAsync().Wait();
                    break;

                case (int)GenreMenuOption.Print:
                    PrintAllAsync().Wait();
                    break;

                case (int)GenreMenuOption.Update:
                    UpdateGenreAsync().Wait();
                    break;

                case (int)GenreMenuOption.GetGenreById:
                    PrintGenreByIdAsync().Wait();
                    break;

                case (int)GenreMenuOption.Exit:
                    Console.WriteLine("Thanks for your visit. Please visit the Genre Menu again !!!!");
                    break;

                default:
                    Console.WriteLine("Invalid Option");
                    break;
                }

                if (choice != (int)GenreMenuOption.Exit)
                {
                    //Console.WriteLine("genre " + choice);
                    Console.WriteLine("Press Enter to continue.......");
                    Console.ReadLine();
                    Console.Clear();
                }
            } while (choice != (int)GenreMenuOption.Exit);
        }
Exemple #2
0
        public void Run()
        {
            int       choice = 0;
            GenreMenu m      = new GenreMenu();

            do
            {
                choice = m.PrintMenu();

                switch (choice)
                {
                case (int)GenreOption.Insert:
                    AddGenre();
                    break;

                case (int)GenreOption.Update:
                    UpdateGenre();
                    break;

                case (int)GenreOption.Delete:
                    DeleteGenre();
                    break;

                case (int)GenreOption.PrintAll:
                    PrintAll();
                    break;

                case (int)GenreOption.PrintById:
                    PrintById();
                    break;

                case (int)GenreOption.Exit:
                    Console.WriteLine("Thanks for visit. Please Visit Again!!!!");
                    break;

                default:
                    Console.WriteLine("Invalid Option");
                    break;
                }
                if (choice != (int)GenreOption.Exit)
                {
                    Console.WriteLine("Press Enter to continue......");
                    Console.ReadLine();
                    Console.Clear();
                }
            } while (choice != (int)GenreOption.Exit);
        }