Пример #1
0
        static void Main(string[] args)
        {
            MarketingFirm firm = new MarketingFirm(SweepstakeManagerFactory.CreateManager());

            firm.RunSweepstakes();
            firm.FinishSweepstakes();
        }
Пример #2
0
        static void Main(string[] args)
        {
            ISweepstakesManager manager = SweepstakeManagerFactory.ChooseStackOrQueue();

            Sweepstakes sweepstake = new Sweepstakes(" Fortnite battlepass!");

            Contestant contestant = new Contestant();

            contestant.SetFirstName("Uma");
            contestant.SetLastName("Bob");
            contestant.SetEmailAdress("*****@*****.**");

            sweepstake.RegisterContestant(contestant);

            Contestant contestant2 = new Contestant();

            contestant2.SetFirstName("Billy");
            contestant2.SetLastName("Bob");
            contestant2.SetEmailAdress("*****@*****.**");

            sweepstake.RegisterContestant(contestant2);

            manager.InsertSweepstakes(sweepstake);

            MarketingFirm firm = new MarketingFirm(manager);

            Console.WriteLine(manager.GetSweepstakes().PickWinner());
            Console.ReadLine();
        }