예제 #1
0
        public async void Run()
        {
            int choice = 0;

            do
            {
                IMenu castMenu = new CastMenu();
                choice = castMenu.PrintMenu();
                switch (choice)
                {
                case (int)CastMenuOptions.Insert:
                    //await AddCastAsync();
                    AddCastAsync().Wait();
                    break;

                case (int)CastMenuOptions.Delete:
                    //await DeleteCastAsync();
                    DeleteCastAsync().Wait();
                    break;

                case (int)CastMenuOptions.Print:
                    //await PrintAllAsync();
                    PrintAllAsync().Wait();
                    break;

                case (int)CastMenuOptions.Update:
                    //await UpdateCastAsync();
                    UpdateCastAsync().Wait();
                    break;

                case (int)CastMenuOptions.GetCastWithMovie:
                    //await GetCastByIdWithMovieAsync();
                    GetCastByIdWithMovieAsync().Wait();
                    break;

                case (int)CastMenuOptions.Exit:
                    Console.WriteLine("Thanks for your visit. Please visit the Cast System again !!!!");
                    break;

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

                if (choice != (int)CastMenuOptions.Exit)
                {
                    Console.WriteLine("Press Enter to continue.......");
                    Console.ReadLine();
                    Console.Clear();
                }
            } while (choice != (int)CastMenuOptions.Exit);
        }
예제 #2
0
        public void Run()
        {
            int choice = 0;

            do
            {
                IMenu castMenu = new CastMenu();
                choice = castMenu.PrintMenu();
                switch (choice)
                {
                case (int)CastMenuOption.Insert:
                    AddCastAsync().Wait();
                    break;

                case (int)CastMenuOption.Delete:
                    DeleteCastAsync().Wait();
                    break;

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

                case (int)CastMenuOption.Update:
                    UpdateCastAsync().Wait();
                    break;

                case (int)CastMenuOption.GetCastById:
                    PrintCastByIdAsync().Wait();
                    break;

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

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

                if (choice != (int)CastMenuOption.Exit)
                {
                    //Console.WriteLine("genre " + choice);
                    Console.WriteLine("Press Enter to continue.......");
                    Console.ReadLine();
                    Console.Clear();
                }
            } while (choice != (int)CastMenuOption.Exit);
        }
예제 #3
0
        public void RunAsync()
        {
            int      choice = 0;
            CastMenu m      = new CastMenu();

            do
            {
                choice = m.PrintMenu();

                switch (choice)
                {
                case (int)CastOption.Insert:
                    AddCastAsync().Wait();
                    break;

                case (int)CastOption.Update:
                    UpdateCastAsync().Wait();
                    break;

                case (int)CastOption.Delete:
                    DeleteCastAsync().Wait();
                    break;

                case (int)CastOption.PrintAll:
                    PrintAllAsync().Wait();
                    break;

                case (int)CastOption.PrintById:
                    PrintByIdAsync().Wait();
                    break;

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

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