Beispiel #1
0
 public override void Audit(Request request)
 {
     if (request.Amount < 10000)
     {
         Console.WriteLine("{0},这个请求可以通过,{1}", request.Name,this.PersonName);
     }
     else
     {
         Console.WriteLine("这个需要领导{0}审核", NextAuditPerson.PersonName);
         NextAuditPerson.Audit(request);
     }
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Request computer = new Request(15000, "电脑");
            Request house = new Request(100000, "房子");

            AuditPerson manager = new Manager("经理");
            AuditPerson vp = new VP("VP");
            AuditPerson boss = new Boss("老板");

            manager.NextAuditPerson = vp;
            vp.NextAuditPerson = boss;

            manager.Audit(computer);
            manager.Audit(house);

            Console.ReadKey();
        }
Beispiel #3
0
 public abstract void Audit(Request request);
Beispiel #4
0
 public override void Audit(Request request)
 {
     if (request.Amount > 50000)
     {
         Console.WriteLine("这个需要开会讨论");
     }
 }