Beispiel #1
0
        public void manageAnimals(Supplies theSupplies, Cages theCages)
        {
            char menuChoice;
            do
            {
                Console.SetCursorPosition(0, 0);    // move the cursor up Nine lines to paint next menu on top.

                //                "12345678901234567890123456789012" 
                Console.WriteLine("MANAGE ANIMALS                  ");
                Console.WriteLine("1-) Feed Dogs                   ");
                Console.WriteLine("2-) Feed Cats                   ");
                Console.WriteLine("3-) Feed Birds                  ");
                Console.WriteLine("4-) Feed Reptiles               ");
                Console.WriteLine("5-) Add Dog                     ");
                Console.WriteLine("6-) Add Cat                     ");
                Console.WriteLine("7-) Add Bird                    ");
                Console.WriteLine("8-) Add Reptile                 ");
                Console.WriteLine("9-) BACK TO MAIN MENU           ");
                Console.Write("ENTER CHOICE:                       ");
                Console.SetCursorPosition(Console.CursorLeft - 5, Console.CursorTop);    // move the cursor up Nine lines to paint next menu on top.
                menuChoice = Console.ReadKey().KeyChar;
                // or just pass 0,0
                switch (menuChoice)
                {
                    case '1':
                        feedDogs(theSupplies.dogFood);
                        break;
                    case '2':
                        feedCats(theSupplies.catFood);
                        break;
                    case '3':
                        feedBirds(theSupplies.birdFood);
                        break;
                    case '4':
                        feedReptiles(theSupplies.reptileFood);
                        break;
                    case '5':
                        addDog(theCages.getDogCage());
                        break;
                    case '6':
                        addCat();
                        break;
                    case '7':
                        addBird();
                        break;
                    case '8':
                        addReptile();
                        break;
                    case '9':
                        cleanUpBack();
                        break;
                }

            } while (menuChoice != '9');

            return;
        }
        public void Run()
        {
            Animals  theAnimals  = new Animals();
            Supplies theSupplies = new Supplies();
            Cages    theCages    = new Cages();
            char     menuChoice;

            do
            {
                Console.SetCursorPosition(0, 0);    // move the cursor up Nine lines to paint next menu on top.
                                                    //"12345678901234567890123456789012"
                Console.WriteLine("Humane Society Management System");
                Console.WriteLine("1-) Manage Animals              ");
                Console.WriteLine("2-) Manage  Adopter             ");
                Console.WriteLine("3-) Show Animals                ");
                Console.WriteLine("4-) Manage Food Supplies        ");
                Console.WriteLine("5-) Manage Medication Supplies  ");
                Console.WriteLine("6-) Manage Cages                ");      // setup the cages available in the facility
                Console.WriteLine("7-)                             ");
                Console.WriteLine("8-)                             ");
                Console.WriteLine("9-) QUIT                        ");
                Console.Write("ENTER CHOICE:                   ");
                Console.SetCursorPosition(Console.CursorLeft - 5, Console.CursorTop);    // move the cursor up Nine lines to paint next menu on top.
                menuChoice = Console.ReadKey().KeyChar;
                // or just pass 0,0

                switch (menuChoice)
                {
                case '1':
                    theAnimals.manageAnimals(theSupplies, theCages);
                    break;

                case '2':
                    Adopter theAdopter = new Adopter();
                    theAdopter.manageAdopter(theAnimals, theCages);

                    break;

                case '3':
                    theAnimals.showAnimals();
                    break;

                case '4':
                    theSupplies.manageFoodSupplies();
                    break;

                case '5':
                    //manageMedication();
                    break;

                case '6':
                    theCages.manageCages();
                    break;

                case '7':
                case '8':
                    Console.Beep(5000, 250);
                    Console.Beep(2000, 250);

                    break;

                case '9':
                    letsQuit();
                    break;
                }
            } while (menuChoice != '9');
        }