コード例 #1
0
        public static void SecondDemo()
        {
            Approver teamLead = new TeamLead();
            Approver vp       = new VicePrezicent();
            Approver ceo      = new President();

            teamLead.SetSuccessor(vp);
            vp.SetSuccessor(ceo);
            teamLead.ProcessRequest(new Purchase(2033, 9999));
            teamLead.ProcessRequest(new Purchase(2034, 350.00));
            teamLead.ProcessRequest(new Purchase(2035, 24000));
            teamLead.ProcessRequest(new Purchase(2036, 50000));
            teamLead.ProcessRequest(new Purchase(2037, 500000));
        }
コード例 #2
0
        internal static void Main()
        {
            Approver teamLead = new TeamLead();
            Approver vicePresident = new VicePresident();
            Approver president = new President();

            teamLead.SetSuccessor(vicePresident);
            vicePresident.SetSuccessor(president);

            var purchase = new Purchase(2034, 350.00);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(2035, 32590.10);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(2036, 122100.00);
            teamLead.ProcessRequest(purchase);
        }
コード例 #3
0
        public static void Main()
        {
            Approver teamLead = new TeamLead();
            Approver vp = new VicePresident();
            Approver ceo = new President();

            teamLead.SetSuccessor(vp);
            vp.SetSuccessor(ceo);

            var purchase = new Purchase(2034, 350.00);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(2035, 32590.10);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(2036, 122100.00);
            teamLead.ProcessRequest(purchase);
        }
コード例 #4
0
        public static void Main()
        {
            Approver teamLead = new TeamLead();
            Approver vp       = new VicePresident();
            Approver ceo      = new President();

            teamLead.SetSuccessor(vp);
            vp.SetSuccessor(ceo);

            var purchase = new Purchase(2034, 350.00);

            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(2035, 32590.10);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(2036, 122100.00);
            teamLead.ProcessRequest(purchase);
        }
コード例 #5
0
        public static void Main()
        {
            Approver teamLead = new TeamLead();
            Approver vicePresident = new VicePresident();
            Approver president = new President();

            teamLead.SetSuccessor(vicePresident);
            vicePresident.SetSuccessor(president);

            Purchase purchase = new Purchase(2019, 90000.00);
            teamLead.ProcessRequest(purchase);
        }
コード例 #6
0
        public static void Main()
        {
            Approver teamLead      = new TeamLead();
            Approver vicePresident = new VicePresident();
            Approver president     = new President();

            teamLead.SetNext(vicePresident);
            vicePresident.SetNext(president);

            var purchase = new Purchase(350, 1);

            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(24000, 2);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(32590, 3);
            teamLead.ProcessRequest(purchase);

            purchase = new Purchase(100001, 4);
            teamLead.ProcessRequest(purchase);
        }
コード例 #7
0
        static void Main(string[] args)
        {
            Approver temaLead      = new TeamLead();
            Approver vicePresident = new VicePresident();
            Approver president     = new President();

            temaLead.SetSuccessor(vicePresident);
            vicePresident.SetSuccessor(president);

            var purchase = new Purchase(350, 1);

            temaLead.ProcessRequest(purchase);

            purchase = new Purchase(24000, 2);
            temaLead.ProcessRequest(purchase);

            purchase = new Purchase(32590, 3);
            temaLead.ProcessRequest(purchase);

            purchase = new Purchase(100001, 4);
            temaLead.ProcessRequest(purchase);
        }