示例#1
0
        //variables

        //constructor

        //method
        public void CreateMarketingFirmWithManager()
        {
            ISweepstakesManager stack         = new SweepstakesStackManager();
            ISweepstakesManager queue         = new SweepstakesQueueManager();
            MarketingFirm       marketingFirm = new MarketingFirm(queue);
            MarketingFirm       marketing     = new MarketingFirm(stack);
        }
示例#2
0
 public Factory()
 {
     stackManager = new SweepstakesStackManager();
     queueManager = new SweepstakesQueueManager();
     sweepstakes  = new Sweepstakes();
     firm         = new MarketingFirm();
 }
示例#3
0
        public MarketingFirm SelectManagerType()
        {
            String Selected_Manager;

            Console.WriteLine("Welcome.\n");
here:
            Console.WriteLine("How would you like to manage your data: \n1) {0} \n2) {1}", "STACK data type", "QUEUE data type");
            Console.WriteLine();
            Selected_Manager = Console.ReadLine();
            Console.Clear();
            if (Selected_Manager == "1")
            {
                marketing = new MarketingFirm(Stack_Type);
                return(marketing);
            }
            if (Selected_Manager == "2")
            {
                marketing = new MarketingFirm(Queue_Type);
                return(marketing);
            }
            else
            {
                Console.WriteLine("Sorry, invalid entry!");
                Console.ReadLine();
                Console.Clear();
                goto here;
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            ISweepStakesManager manager       = FactoryDesignPattern.WhichDataStructureIsWanted();
            MarketingFirm       marketingfirm = new MarketingFirm(manager);

            Console.ReadLine();
        }
示例#5
0
        public void CreateMarketingFirmWithManager()
        {
            bool isAValidInput = false;

            do
            {
                switch (UserInterface.TakeUserInput().ToLower())
                {
                case "1":
                case "queue":
                    newFirm       = new MarketingFirm(queue);
                    isAValidInput = true;
                    break;

                case "2":
                case "stack":
                    newFirm       = new MarketingFirm(stack);
                    isAValidInput = true;
                    break;

                default:
                    UserInterface.DisplayMessage("Not a valid input, please choose stack or queue.");
                    break;
                }
            }while (isAValidInput == false);
        }
示例#6
0
        static void Main(string[] args)
        {
            SweepstakesManagerFactory smf = new SweepstakesManagerFactory();

            //var manager = smf.WhichManager("queue");
            UserInterface.WhichManagerQuestion();
            MarketingFirm thing    = new MarketingFirm(smf.WhichManager(UserInterface.GetResponse()));
            Sweepstakes   gotmilk  = new Sweepstakes("got milk");
            Sweepstakes   gotmilk1 = new Sweepstakes("got milk1");
            Sweepstakes   gotmilk2 = new Sweepstakes("got milk2");
            Sweepstakes   gotmilk3 = new Sweepstakes("got milk3");
            Contestant    shawn    = new Contestant();
            Contestant    domino   = new Contestant();
            Contestant    ender    = new Contestant();
            Contestant    bre      = new Contestant();

            thing.manager.InsertSweepstakes(gotmilk);
            thing.manager.InsertSweepstakes(gotmilk1);
            thing.manager.InsertSweepstakes(gotmilk2);
            gotmilk2.RegisterContestant(shawn);
            thing.manager.InsertSweepstakes(gotmilk3);
            thing.manager.InsertSweepstakes(gotmilk2);
            Sweepstakes s = thing.manager.GetSweepstakes();

            Console.ReadLine();
        }
        public void RunSimulation()
        {
            ISweepStakeManager manager = WhichManager();

            marketingFirm = new MarketingFirm(manager);
            marketingFirm.CreateSweepStakes();
            Console.ReadLine();
        }
示例#8
0
        static void Main(string[] args)
        {
            ISweepstakesManager manager       = SweepstakesFactory.ChooseYourSweepstakesManagerStyle();
            MarketingFirm       marketingFirm = new MarketingFirm(manager);

            marketingFirm.CreateSweepstakes();
            marketingFirm.RunSweepstakes();
        }
示例#9
0
 public void CreateMarketingFirmWithManager()
 {
     string              _manager;
     ManagerFactory      managerFactory = new ManagerFactory();
     ISweepStakesManager manager        = managerFactory.GetManager("Queue");
     int           age           = 32;
     MarketingFirm marketingFirm = new MarketingFirm(manager);
 }
示例#10
0
        public void CreateMarketingFirmWithManager()
        {
            ISweepstakesManager sweepstakesManager;

            sweepstakesManager = IUserInterface.PickManager();
            MarketingFirm marketingFirm = new MarketingFirm(sweepstakesManager);

            marketingFirm.CreateSweepStakes();
        }
示例#11
0
        static void Main(string[] args)
        {
            // instantiate marketing firm
            ISweepstakesManager sweepstakesManagerQueue = new SweepstakesQueueManager();
            ISweepstakesManager sweepstakesManagerStack = new SweepstakesStackManager();

            // marketting does functionality upon injection
            MarketingFirm marketingFirm = new MarketingFirm(UserInterface.StackOrQueuePrompt());;  // interchangable with sweepstakesManagerStack depending on the user's choice
        }
示例#12
0
        static void Main(string[] args)
        {
            string sweepstakesManagerType = UserInterface.DetermineSweepStakesManagerType();
            SweepstakesManagerFactory sweepstakesManagerFactory = new SweepstakesManagerFactory();
            MarketingFirm             marketingFirm             = new MarketingFirm(sweepstakesManagerFactory.DetermineSweepstakesManager(sweepstakesManagerType));

            marketingFirm.DetermineMarketingFirmAction();
            Console.ReadLine();
        }
示例#13
0
        public void CreateMarketingFirm()

        {
            Console.WriteLine("Do you want a stack or queue?");
            string userInput = Console.ReadLine();
            ISweepstakesManager chosenManager = ManagerFactory(userInput);
            MarketingFirm       marketingFirm = new MarketingFirm(chosenManager);

            marketingFirm.CreateSweepstakes();
        }
示例#14
0
        public void CreateMarketingFirmWithManager()
        {
            string              sweepstakesName    = Userinterface.GetNewSweepstakesName();
            string              userInput          = Userinterface.ChooseStackOrQueue();
            SweepstakesFactory  factory            = new SweepstakesFactory();
            ISweepstakesManager sweepstakesManager = factory.CreateFactory(userInput);
            MarketingFirm       marketingFirm      = new MarketingFirm(sweepstakesManager, sweepstakesName);

            marketingFirm.CreateSweepStakes();
        }
示例#15
0
        static void Main(string[] args)
        {
            CreateSweepstakesManager newManager = new CreateSweepstakesManager();
            ISweepstakesManager      manager    = newManager.CreateManager();
            MarketingFirm            firm       = new MarketingFirm(manager);


            firm.CreateSweepstakes();

            firm.CreateSweepstakes();
            firm.CreateSweepstakes();
            firm.GetSweepstakes();
        }
示例#16
0
        static void Main(string[] args)
        {
            MarketingFirm marketingFirm;

            SweepstakesQueueManager sweepstakesQueueManager = new SweepstakesQueueManager();
            SweepStakesStackManager sweepStakesStackManager = new SweepStakesStackManager();


            Contestant firstContestant  = new Contestant();
            Contestant secondContestant = new Contestant();
            Contestant thirdContestant  = new Contestant();

            SweepStakes sweepStakes1 = new SweepStakes("Bucks");
            SweepStakes sweepStakes2 = new SweepStakes("Packers");

            sweepStakes1.RegisterContestant(firstContestant);
            sweepStakes1.RegisterContestant(secondContestant);
            sweepStakes1.RegisterContestant(thirdContestant);
            sweepStakes1.PrintContestantInfo();


            sweepStakes2.RegisterContestant(firstContestant);
            sweepStakes2.RegisterContestant(secondContestant);
            sweepStakes2.PrintContestantInfo();

            string input = UserInterfacecs.GetString("Do you want to use queue or stack manager?");

            input.ToLower();
            switch (input)
            {
            case "queue":
                sweepstakesQueueManager.InsertSweepStakes(sweepStakes1);
                sweepstakesQueueManager.InsertSweepStakes(sweepStakes2);
                marketingFirm = new MarketingFirm(sweepstakesQueueManager);
                break;

            case "stack":
                sweepStakesStackManager.InsertSweepStakes(sweepStakes1);
                sweepStakesStackManager.InsertSweepStakes(sweepStakes2);
                marketingFirm = new MarketingFirm(sweepStakesStackManager);
                break;

            default:
                break;
            }
        }
示例#17
0
        static void Main(string[] args)
        {
            //Contestant alex = new Contestant();

            //alex.email = "*****@*****.**";
            //alex.isWinner = true;
            //alex.NotifyContestant();



            SweepstakesFactory  factory = new SweepstakesFactory();
            string              style   = UI.GetManagerStyle();
            ISweepstakesManager manager = factory.CreateSweepstakesManager(style);
            MarketingFirm       firm    = new MarketingFirm(manager);

            firm.Menu();
        }
        void CreateMarketingFirmWithManager()
        {
            ISweepStakesManaager manager;

            switch (UserInterface.GetUserInput("Choose Your Manager: Stack or Queue.").ToLower())
            {
            case "stack":
                manager = new SweepStakesStackManager();
                MarketingFirm Mf = new MarketingFirm(manager);
                break;

            case "queue":
                manager = new SweepStakesQueueManager();
                Mf      = new MarketingFirm(manager);
                break;

            default:
                CreateMarketingFirmWithManager();
                break;
            }
        }
示例#19
0
        public void CreateMarketingFirmWithManager()
        {
            bool firmIsDeciding = true;

            do
            {
                switch (UserInterface.TakeUserInput().ToLower())
                {
                case "1":
                case "queue":
                    newFirm        = new MarketingFirm(queue, random);
                    firmIsDeciding = false;
                    break;

                case "2":
                case "stack":
                    newFirm        = new MarketingFirm(stack, random);
                    firmIsDeciding = false;
                    break;
                }
            }while (firmIsDeciding == true);
        }
示例#20
0
        static void Main(string[] args)
        {
            Console.WriteLine("would you like to use a stack or queue to store your sweepstakes?");
            string userInput = Console.ReadLine();
            ISweepstakesManager sweepStakesManager;


            switch (userInput)
            {
            case "queue":
                sweepStakesManager = new SweepstakesQueueManager();
                MarketingFirm MFQ = new MarketingFirm(sweepStakesManager);
                break;

            case "stack":
                sweepStakesManager = new SweepstakesStackManager();
                MarketingFirm MFS = new MarketingFirm(sweepStakesManager);
                break;

            default:
                break;
            }
        }
示例#21
0
        public void CreateMarketingFirm()
        {
            int input;

            Console.WriteLine("Press 1 for Stack management type. ");
            Console.WriteLine("Press 2 for Queue management style. ");
            input = int.Parse(Console.ReadLine());
            ISweepStakesManager manager = null;

            if (input == 1)
            {
                manager = new SweepStakesStackManager();
            }
            else if (input == 2)
            {
                manager = new SweepStakesQueueManager();
            }
            else
            {
                Console.WriteLine("Please enter a valid input. ");
                CreateMarketingFirm();
            }
            MarketingFirm marketingFirm = new MarketingFirm(manager);
        }
示例#22
0
 public void CreateMarketingFirmWithManager()
 {
     var queueOrStack = UserInterface.QueueOrStack();
     MarketingFirm marketingFirm = new MarketingFirm(queueOrStack);
 }
示例#23
0
 static void Main(string[] args)
 {
     MarketingFirm theRightChoice = new MarketingFirm();
 }
示例#24
0
 static void Main(string[] args)
 {
     MarketingFirm thing = new MarketingFirm();
 }
示例#25
0
        //member variables


        //constructor


        //member methods
        public void CreateMarketingFirmWithManager()
        {
            ISweepStakesManager sweepStakesManager = UserInterface.GetChoiceOfManager();
            MarketingFirm       marketingFirm      = new MarketingFirm(sweepStakesManager);
        }
示例#26
0
        static void Main(string[] args)
        {
            MarketingFirm marketingFirm = new MarketingFirm();

            marketingFirm.ChooseQueueOrStack();
        }
示例#27
0
 public void RunSim()
 {
     ISweepstakesManager sweepstakesChoice = ManagerFactory.Factory(GetInput());
     MarketingFirm       marketingFirm     = new MarketingFirm(sweepstakesChoice);
 }
示例#28
0
 public static void Main(string[] args)
 {
     ISweepstakesManager manager       = UserInterface.GetManager();
     MarketingFirm       marketingFirm = new MarketingFirm(manager);
 }