Example #1
0
        static void Main(string[] args)
        {
            Manager       manager       = new Manager();
            VisePresident visePresident = new VisePresident();
            President     president     = new President();

            manager.SetSuccessor(visePresident);
            visePresident.SetSuccessor(president);

            Expense expense = new Expense {
                Amount = 110, Detail = "Fuel expense"
            };

            manager.HandleExpense(expense);

            Console.Read();
        }
Example #2
0
        static void Main(string[] args)
        {
            Manager       manager       = new Manager();
            VisePresident visePresident = new VisePresident();

            President president = new President();

            manager.SetSuccesor(visePresident);
            visePresident.SetSuccesor(president);

            Expense expense = new Expense {
                Detail = "Training", Amount = 1001
            };

            manager.HandleExpense(expense);

            Console.ReadLine();
        }