Пример #1
0
 static void Main(string[] args)
 {
     while (true) // Used to loop back to sweepstakesFactory to select another manager type if needed.
     {
         SweepstakesFactory sweepstakesFactory = new SweepstakesFactory();
         MarketingFirm      newFirm            = new MarketingFirm(sweepstakesFactory.DetermineManager(UserInterface.GetManagerType()));
         newFirm.DetermineMarketFirmAction();
     }
 }
Пример #2
0
 static void Main(string[] args)
 {
     while (true)
     {
         SweepstakesFactory sweepstakesFactory = new SweepstakesFactory();
         MarketingFirm      newFirm            = new MarketingFirm(sweepstakesFactory.DetermineManager(UserInterface.GetManagerType()));
         newFirm.DetermineMarketFirmAction();
     }
 }
Пример #3
0
        static void Main(string[] args)
        {
            SweepstakesFactory  factory   = new SweepstakesFactory();
            string              userInput = UI.SelectSweepstakesType();
            ISweepstakesManager manager   = factory.SetSweepstakesDataStructure(userInput);

            MarketingFirm marketingFirm = new MarketingFirm(manager);

            marketingFirm.StartProgram();
        }
Пример #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("type stack or queue");
            string input = Console.ReadLine();
            ISweepstakesManager manager       = SweepstakesFactory.CreateSweepstakesManager(input);
            MarketingFirm       marketingfirm = new MarketingFirm(manager);
            string      name        = Console.ReadLine();
            Sweepstakes sweepstakes = new Sweepstakes(name);

            marketingfirm.manager.InsertSweepstakes(sweepstakes);
        }
Пример #5
0
        public static void ChooseDataStructure()
        {
            Console.WriteLine("Please type if you would like to pull sweepstakes from a stack or queue.");
            string userInput = Console.ReadLine().ToLower();

            switch (userInput)
            {
            case "stack":
                SweepstakeStackManager newStack = SweepstakesFactory.CreateStack();
                break;

            case "queue":
                SweepstakeQueueManager newQueue = SweepstakesFactory.CreateQueue();
                break;

            default:
                Console.WriteLine("incorrect input, please try again.");
                ChooseDataStructure();
                break;
            }
        }
Пример #6
0
 public void ManagerSelection()
 {
     UserInterface.GetSweepstakesManager();
     sweepstakesFactory = new SweepstakesFactory();
     sweepstakesFactory.GetManagerToUse();
 }
Пример #7
0
        public void CreateMarketingFirmManager(SweepstakesFactory factory)
        {
            MarketingFirm marketingFirm = new MarketingFirm(factory.ChooseSweepstakesManager(UserInterface.GetUserInputFor("Would you like a Queue or a Stack to manage your Sweepstakes?")));

            marketingFirm.CreateSweepstakes();
        }