Exemple #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 manageAdopter(Animals theAnimals, 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 ADOPTER              ");
                Console.WriteLine("1-) Fill Aplication             ");
                Console.WriteLine("2-) Pay Fee                     ");
                Console.WriteLine("3-) Select Pet                  ");
                Console.WriteLine("4-)                             ");
                Console.WriteLine("5-)                             ");
                Console.WriteLine("6-)                             ");      // setup the cages available in the facility
                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;
                switch (menuChoice)
                {
                case '1':
                    fillApplication();
                    break;

                case '2':
                    payFee();
                    break;

                case '3':
                    selectPet(theAnimals, theCages);
                    break;

                case '4':
                    break;

                case '5':
                    break;

                case '6':
                    break;

                case '9':
                    cleanUpBack();
                    break;
                }
            } while (menuChoice != '9');
        }
Exemple #3
0
        public void removeDog(int cageID, Cages theCages)
        {
            Dog theDog = null;

            if (cageID == 0)
            {
                throw new System.NotImplementedException("remove Dog no valid cageID");
            }

            DogCage theDogCage = theCages.getThisDogCage(cageID);
            theDogCage.cageStatus = 0;          //set cage to empty so it can be used by another pet.
            theDog = theDogCage.removeDog();    // remove the Dog object reference from the cage object.
            Console.WriteLine("Dog {0} is in Cage {1}", theDog.Name, theDog.cageID);
            theDog.adopted = true;
            Dogs.Remove(theDog);                // remove the Dog object from the list of Dogs

        }
        private void selectPet(Animals theAnimals, Cages theCages)
        {
            int cageID;

            if (this.theApplication.AnimalKind == "DOG")
            {
                cageID = selectDog(theAnimals);
                theAnimals.removeDog(cageID, theCages);
            }
            if (this.theApplication.AnimalKind == "CAT")
            {
                cageID = selectCat(theAnimals);
                theAnimals.removeCat(cageID, theCages);
            }
            if (this.theApplication.AnimalKind == "BIRD")
            {
                cageID = selectBird(theAnimals);
                theAnimals.removeBird(cageID, theCages);
            }
        }
        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');
        }
Exemple #6
0
        public void removeBird(int cageID, Cages theCages)
        {

        }
Exemple #7
0
        public void removeCat(int cageID, Cages theCages)
        {

        }