Пример #1
0
        public static string WhichMediaToCheckIn()
        {
            List <Movie> movieInfo = MovieMethods.MovieTxtToList();
            List <Music> musicInfo = MusicMethods.MusicTxtToList();
            List <Book>  bookInfo  = BookMethods.BookTxtToList();

            Console.WriteLine("Great! and what are you checking in today?\n1.Book\n2.Movie\n3.Music Album");
            string userCheckInType = Console.ReadLine().ToLower();

            if (userCheckInType == "1")
            {
                CheckInBook(bookInfo);
            }
            else if (userCheckInType == "2")
            {
                CheckInMovie(movieInfo);
            }
            else if (userCheckInType == "3")
            {
                CheckInMusic(musicInfo);
            }
            else
            {
                Console.WriteLine("Invalid Response");
                WhichMediaToCheckIn();
            }
            return(userCheckInType);
        }
Пример #2
0
        public static void GoToCheckOut()
        {
            bool         validate;
            List <Movie> movieInfo = MovieMethods.MovieTxtToList();
            List <Music> musicInfo = MusicMethods.MusicTxtToList();
            List <Book>  bookInfo  = BookMethods.BookTxtToList();
            {
                string whichMediaType = WhichMediaToCheckOut();
                if (whichMediaType == "1")
                {
                    validate = AskForBookTitleToCheckOut(bookInfo);
                    if (validate == false)
                    {
                        NotInStockPrompt(); //prompts to check out again, search again, or to exit
                    }

                    else
                    {
                        ReturnToMainMenuOrExit();
                    }
                }

                else if (whichMediaType == "2")
                {
                    validate = AskForMovieTitleToCheckOut(movieInfo);
                    if (validate == false)
                    {
                        NotInStockPrompt(); //prompts to check out again, search again, or to exit
                    }

                    else
                    {
                        ReturnToMainMenuOrExit();
                    }
                }

                else
                {
                    validate = AskForMusicTitleToCheckOut(musicInfo);
                    if (validate == false)
                    {
                        NotInStockPrompt(); //prompts to check out again, search again, or to exit
                    }

                    else
                    {
                        ReturnToMainMenuOrExit();
                    }
                }
            }
        }
Пример #3
0
        public static void AskWhichMediaToAdd()
        {
            List <Book>  bookInfo  = BookMethods.BookTxtToList();
            List <Movie> movieInfo = MovieMethods.MovieTxtToList();
            List <Music> musicInfo = MusicMethods.MusicTxtToList();

            Console.WriteLine("Which media would you like to add to the database?\n1.Book\n2.Movie\n3.Music");
            string mediaToAddResponse = Console.ReadLine().ToLower();

            if (mediaToAddResponse == "1")
            {
                BookMethods.AddToBookList(bookInfo);
                Console.WriteLine("Thank you for donating! We appreciate it!");
                AskToSearchReturnOrAdd();
            }

            else if (mediaToAddResponse == "2")
            {
                MovieMethods.AddToMovieList(movieInfo);
                Console.WriteLine("Thank you for donating! We appreciate it!");
                AskToSearchReturnOrAdd();
            }

            else if (mediaToAddResponse == "3")
            {
                MusicMethods.AddToMusicList(musicInfo);
                Console.WriteLine("Thank you for donating! We appreciate it!");
                AskToSearchReturnOrAdd();
            }

            else
            {
                Console.WriteLine("Invalid response");
                AskWhichMediaToAdd();
            }
        }
Пример #4
0
        public static void MovieBookorMusic()
        {
            Console.WriteLine("What would you like to search for?\n1. Book\n2. Movie\n3. Music\n4. Quit");
            string userMediaPreference = Console.ReadLine().ToLower();

            if (userMediaPreference == "1")
            {
                List <Book> bookInfo = BookMethods.BookTxtToList();
                Console.WriteLine("We have a lot of books.");
                Console.WriteLine("1. Search by title.\n2. Search by author\n3. Full List\n4. Quit");
                string userSearchPreference = Console.ReadLine().ToLower();
                if (userSearchPreference == "1")
                {
                    BookMethods.SearchBookTitle(bookInfo);
                    AskToSearchOrCheckOut();
                }

                else if (userSearchPreference == "2")
                {
                    BookMethods.SearchBookAuthor(bookInfo);
                    AskToSearchOrCheckOut();
                }

                else if (userSearchPreference == "3")
                {
                    BookMethods.PrintBookList(bookInfo);
                    AskToSearchOrCheckOut();
                }
                else if (userSearchPreference == "4")
                {
                    Console.WriteLine("Have a nice day!");
                    Environment.Exit(0);
                }
                else
                {
                    Console.WriteLine("That was not a valid response.");
                    MovieBookorMusic();
                }
            }
            else if (userMediaPreference == "2")
            {
                List <Movie> movieInfo = MovieMethods.MovieTxtToList();
                Console.WriteLine("We have a lot of movies.\n1. Search by title.\n2. Search by director.\n3. Full List\n4. Quit.");
                string userSearchPreference = Console.ReadLine().ToLower();
                if (userSearchPreference == "1")
                {
                    MovieMethods.SearchMovieTitle(movieInfo);
                    AskToSearchOrCheckOut();
                }

                else if (userSearchPreference == "2")
                {
                    MovieMethods.SearchMovieDirector(movieInfo);
                    AskToSearchOrCheckOut();
                }

                else if (userSearchPreference == "3")
                {
                    MovieMethods.PrintMovieList(movieInfo);
                    AskToSearchOrCheckOut();
                }
                else if (userSearchPreference == "4")
                {
                    Console.WriteLine("Have a nice day!");
                    Environment.Exit(0);
                }
                else
                {
                    Console.WriteLine("That was not a valid response.");
                    MovieBookorMusic();
                }
            }
            else if (userMediaPreference == "3")
            {
                List <Music> musicInfo = MusicMethods.MusicTxtToList();
                Console.WriteLine("We have a lot of music albums!\n1. Search by Title.\n2. Search by Artist.\n3. Full List.\n4. Quit.");
                string userSearchPreference = Console.ReadLine().ToLower();
                if (userSearchPreference == "1")
                {
                    MusicMethods.SearchMusicTitle(musicInfo);
                    AskToSearchOrCheckOut();
                }

                else if (userSearchPreference == "2")
                {
                    MusicMethods.SearchMusicArtist(musicInfo);
                    AskToSearchOrCheckOut();
                }

                else if (userSearchPreference == "3")
                {
                    MusicMethods.PrintMusicList(musicInfo);
                    AskToSearchOrCheckOut();
                }
                else if (userSearchPreference == "4")
                {
                    Console.WriteLine("Have a nice day!");
                    Environment.Exit(0);
                }
                else
                {
                    Console.WriteLine("That was not a valid response.");
                    MovieBookorMusic();
                }
            }
            else if (userMediaPreference == "4")
            {
                Console.WriteLine("Have a nice day!");
                Environment.Exit(0);
            }
            else
            {
                Console.WriteLine("That was not a valid response.");
                MovieBookorMusic();
            }
        }