Exemple #1
0
        public void ViewMenu(string viewMenu)
        {
            var tracker = new PlantTracker();

            while (viewMenu != "all" && viewMenu != "locations" && viewMenu != "water" && viewMenu != "need")
            {
                Console.WriteLine("Invalid input. Please input (ALL), (LOCATIONS), (WATER) or (NEED)");
                viewMenu = Console.ReadLine().ToLower();
            }
            //displays all the plants by locations
            if (viewMenu == "all")
            {
                tracker.ViewAll();
            }
            else if (viewMenu == "water")
            {
                tracker.NotWatered();
            }
            else if (viewMenu == "locations")
            {
                Console.WriteLine("What location do you want to check?");
                var plantLocation = Console.ReadLine().ToLower();
                tracker.Locations(plantLocation);
            }
            else if (viewMenu == "need")
            {
                tracker.NeedWater();
            }
        }
Exemple #2
0
        public void WaterPlantInput()
        {
            var tracker = new PlantTracker();

            tracker.ViewAll();
            Console.WriteLine("What plant do you want to water? Please select by Id number");
            var plantId = int.Parse(Console.ReadLine());

            tracker.WaterPlant(plantId);
        }
Exemple #3
0
        public string Menu(string choice)
        {
            var tracker = new PlantTracker();

            while (choice != "view" && choice != "remove" && choice != "plant" && choice != "water" && choice != "quit")
            {
                Console.WriteLine("Invalid input. Please input (PLANT), (REMOVE), (VIEW), (WATER) or (QUIT)");
                choice = Console.ReadLine().ToLower();
            }
            return(choice);
        }
Exemple #4
0
        //adds plants
        public void NewPlantInput()
        {
            var tracker = new PlantTracker();

            Console.WriteLine("What kind of plant?");
            var species = Console.ReadLine().ToLower();

            Console.WriteLine("Where did you plant it?");
            var locatedPlant = Console.ReadLine().ToLower();

            Console.WriteLine("When did you plant it?");
            var plantedDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("When was it last watered?");
            var lastWateredDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("How often should it be watered?");
            var waterNeeded = double.Parse(Console.ReadLine());

            Console.WriteLine("How much sunlight does it need per day?");
            var lightNeeded = double.Parse(Console.ReadLine());

            tracker.PlantNewPlant(species, locatedPlant, plantedDate, lastWateredDate, waterNeeded, lightNeeded);
        }