public void RegisterContestant(Contestant contestant)
        {
            contestant.FirstName = UserInterface.GetFirstName();
            UserInterface.NewLine();
            contestant.LastName = UserInterface.GetLastName();
            UserInterface.NewLine();
            contestant.EmailAddress = UserInterface.GetEmail();
            UserInterface.NewLine();
            contestant.RegistrationNum = UserInterface.GetRegisterNum();
            UserInterface.NewLine();

            Console.WriteLine("Is all of the following information valid? y/n.");
            PrintContestantInfo(contestant);

            if (ValidateInfo())
            {
                Console.WriteLine("Great! Press enter so that the next contestant may enter.");
                Console.ReadLine();
                Console.Clear();
            }
            else
            {
                UserInterface.ReduceRegisterNum();
                RegisterContestant(contestant);
            }
        }
Exemple #2
0
        public void SetupSweepstake(Sweepstakes sweepstake)
        {
            for (int i = 0; i < sweepstake.maxNumber; i++)
            {
                Contestant newContestant = new Contestant();

                UserInterface.NewLine();
                Console.WriteLine("Welcome to the " + sweepstake.name + " Sweepstakes!");
                UserInterface.NewLine();

                Console.WriteLine("Contestant #" + (i + 1) + ", Please enter your name and email address.");
                sweepstake.RegisterContestant(newContestant);
                sweepstake.contestNameDict.Add(newContestant.RegistrationNum, (newContestant.FirstName + " " + newContestant.LastName));
                sweepstake.contestEmailDict.Add(newContestant.RegistrationNum, newContestant.EmailAddress);
            }
        }