Exemple #1
0
        public void CheckOutMenu(List <Resource> resources, Dictionary <string, List <string> > students, DVD dvd, Magazine mags, Book book)
        {
            while (true)
            {
                Console.WriteLine("Enter a letter to select the type of resource you want to check out: ");
                Console.WriteLine("A - Book");
                Console.WriteLine("B - DVD");
                Console.WriteLine("C - Magazine");

                string input = Console.ReadLine().ToUpper();

                switch (input)
                {
                case "A":
                    book.CheckOutResource(resources, students);
                    break;

                case "B":
                    dvd.CheckOutResource(resources, students);
                    break;

                case "C":
                    mags.CheckOutResource(resources, students);
                    break;

                default:
                    continue;
                }
                break;
            }
        }
Exemple #2
0
        public void MainMenu(List <Resource> resources, Dictionary <string, List <string> > students)
        {
            bool     close = false;
            DVD      dvd   = new DVD();
            Magazine mags  = new Magazine();
            Book     book  = new Book();

            while (close == false)
            {
                Console.Clear();
                PrintMenu();

                int    choice;
                string menuChoice = Console.ReadLine();
                Console.WriteLine();

                bool result = int.TryParse(menuChoice, out choice);

                switch (choice)
                {
                case 1:     //view all resources
                    PrintAllResources();
                    break;

                case 2:     //view available resources
                    ReadAvailableResourcesFile();
                    break;

                case 3:
                    //edit resources
                    EditResourceMenu(resources, dvd, mags, book);
                    break;

                case 4:     //view student accounts
                    ViewStudentAccount(students);
                    break;

                case 5:     //view list of all students
                    PrintAllStudentNames();
                    break;

                case 6:
                    //check in
                    CheckInMenu(resources, students, dvd, mags, book);
                    break;

                case 7:
                    //check out
                    CheckOutMenu(resources, students, dvd, mags, book);
                    break;

                case 8:     //exit
                    ClosingImage();
                    ImperialMarch();
                    close = true;
                    break;

                default:
                    continue;
                }
            }
        }