Exemplo n.º 1
0
        public static Attendee?ProvideAttendee(List <Attendee> attendees)
        {
            var      isAttendeeInputDone = false;
            Attendee foundAttendee       = null;

            while (isAttendeeInputDone == false)
            {
                Console.WriteLine();
                Console.WriteLine("Molimo vas unesite OIB osobe:");

                var queryPin = Console.ReadLine();
                foundAttendee = AttendeeRepository.GetByPIN(attendees, queryPin);

                if (foundAttendee is Attendee == false)
                {
                    Console.WriteLine($"Osoba sa OIB-om ({queryPin}) nije trenutno prijavljena na odabrani event.");
                    isAttendeeInputDone = (UserDialogDataProvider.IsActionRepeatRequested() == false);
                }
                else
                {
                    isAttendeeInputDone = true;
                }

                Console.WriteLine();
            }

            return(foundAttendee);
        }
Exemplo n.º 2
0
        public static Event?ProvideEvent(Dictionary <Event, List <Attendee> > events)
        {
            var   isEventInputDone = false;
            Event foundEvent       = null;

            while (isEventInputDone == false)
            {
                Console.WriteLine();
                Console.WriteLine("Molimo vas unesite ime eventa:");

                var queryName = Console.ReadLine();
                foundEvent = EventRepository.GetByName(events, queryName);

                if (foundEvent is Event == false)
                {
                    Console.WriteLine($"Event pod imenom {queryName} nije pronađen.");
                    isEventInputDone = (UserDialogDataProvider.IsActionRepeatRequested() == false);
                }
                else
                {
                    isEventInputDone = true;
                }

                Console.WriteLine();
            }

            return(foundEvent);
        }