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(); } }
static void Main(string[] args) { while (true) { SweepstakesFactory sweepstakesFactory = new SweepstakesFactory(); MarketingFirm newFirm = new MarketingFirm(sweepstakesFactory.DetermineManager(UserInterface.GetManagerType())); newFirm.DetermineMarketFirmAction(); } }
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(); }
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); }
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; } }
public void ManagerSelection() { UserInterface.GetSweepstakesManager(); sweepstakesFactory = new SweepstakesFactory(); sweepstakesFactory.GetManagerToUse(); }
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(); }