Ejemplo n.º 1
0
 public override void ProcessRequest(Purchase purchase)
 {
     if (purchase.Amount > 1000 && purchase.Amount < 9999)
     {
         Console.WriteLine("Directory will be approver");
     }
     else
     {
         base._successor.ProcessRequest(purchase);
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var aa = new Director();
            var bb = new VicePresident();
            var cc = new President();

            aa.SetSuccessor(bb);
            bb.SetSuccessor(cc);

            var purchase = new Purchase(1, 150000, "test");
            aa.ProcessRequest(purchase);
            Console.Read();
        }
Ejemplo n.º 3
0
 public override void ProcessRequest(Purchase purchase)
 {
     if (purchase.Amount > 100000 && purchase.Amount < 999999)
     {
         Console.WriteLine("President will be approver");
     }
     else
     {
         if (this._successor != null)
         {
             base._successor.ProcessRequest(purchase);
         }
     }
 }
Ejemplo n.º 4
0
 public abstract void ProcessRequest(Purchase purchase);