Example #1
0
        private void UIOutingsByType()
        {
            Console.Clear();
            Console.WriteLine("Enter Event Type To Search For\n1. Fishing\n2. Hunting\n3. Trapping\n4. Hiking");
            string input     = Console.ReadLine();
            bool   inputBool = int.TryParse(input, out int evnt);

            if (inputBool == false || evnt > 4 || evnt < 0)
            {
                Console.Clear();
                Console.WriteLine("INVALID RESPONSE");
                Console.ReadKey();
                UIOutingsByType();
            }

            Event eventType = Event.Undefined;

            switch (evnt)
            {
            case 1:
                eventType = Event.Fishing;
                break;

            case 2:
                eventType = Event.Hunting;
                break;

            case 3:
                eventType = Event.Trapping;
                break;

            case 4:
                eventType = Event.Hiking;
                break;

            default:
                Console.WriteLine("Wrong!!!!");
                Console.ReadKey();
                UIAddOuting();
                break;
            }

            Console.WriteLine($"Cost of {eventType} events: ${outingRepo.CostOfOutingsByType(eventType)}");
            Console.ReadKey();
            InitialPrompt();
        }