Ejemplo n.º 1
0
        public Contestant RunSweepstakes()
        {
            Sweepstakes sweepstakes = _Manager.GetSweepstakes();
            Contestant  Winner;

            Int32.TryParse(usetInterface.GetUserInputFor("contestant maximum?"), out int ContestanrMaximum);
            int Contestant = 0;

            do
            {
                Contestant NewContestant;
                sweepstakes.RegisterContestant(NewContestant = new Contestant(usetInterface.GetUserInputFor("Enter First Name: "), usetInterface.GetUserInputFor("Enter Last Name: "), usetInterface.GetUserInputFor("Enter Email: ")));
                sweepstakes.PrintInfo(NewContestant);
                Contestant++;
            }while (ContestanrMaximum != Contestant);
            Winner = sweepstakes.PickWinner();
            sweepstakes.EmailContestantsForPrizeOrNot(Winner, sweepstakes);
            return(Winner);
        }
Ejemplo n.º 2
0
 public void RegisterContestant(Contestant contestant)
 {
     contestant.RegistrationNumber = (contestants.Count) + 1;
     contestants.Add(contestant.RegistrationNumber, contestant);
 }