public override void ProcessRequest(Purchase purchase)
 {
     if (purchase.Amount < 100000.0)
       {
     Console.WriteLine("{0} approved request# {1}", this.GetType().Name, purchase.Number);
       }
       else
       {
     Console.WriteLine("Request# {0} requires an executive meeting!", purchase.Number);
       }
 }
 public override void ProcessRequest(Purchase purchase)
 {
     if (purchase.Amount < 10000.0)
       {
     Console.WriteLine("{0} approved request# {1}", this.GetType().Name, purchase.Number);
       }
       else if (successor != null)
       {
     successor.ProcessRequest(purchase);
       }
 }
 public abstract void ProcessRequest(Purchase purchase);
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        private static void Main()
        {
            // Setup Chain of Responsibility
              Approver larry = new Director();
              Approver sam = new VicePresident();
              Approver tammy = new President();

              larry.SetSuccessor(sam);
              sam.SetSuccessor(tammy);

              // Generate and process purchase requests
              Purchase p = new Purchase(2034, 350.00, "Assets");
              larry.ProcessRequest(p);

              p = new Purchase(2035, 32590.10, "Project X");
              larry.ProcessRequest(p);

              p = new Purchase(2036, 122100.00, "Project Y");
              larry.ProcessRequest(p);

              // Wait for user
              Console.ReadKey();
        }