예제 #1
0
 public override void ProcessRequest(LeaveAskRequest request)
 {
     if (request.Days < 3)
     {
         Console.WriteLine("{0}审批了你的假单", Name);
     }
     else if (NextApprover != null)
     {
         NextApprover.ProcessRequest(request);
     }
 }
예제 #2
0
 public override void ProcessRequest(LeaveAskRequest request)
 {
     if (request.Days < 10)
     {
         Console.WriteLine("{0}审批了你的假单", this.Name);
     }
     else
     {
         Console.WriteLine("不能超过10天的假期");
     }
 }
예제 #3
0
        static void Main(string[] args)
        {
            LeaveAskRequest ask           = new LeaveAskRequest("Test", 4);
            Approver        manager       = new Manager("经理");
            Approver        vicePresident = new VicePresident("副总");
            Approver        president     = new President("总经理");


            manager.NextApprover       = vicePresident;
            vicePresident.NextApprover = president;

            manager.ProcessRequest(ask);
            Console.ReadLine();
        }
예제 #4
0
 public abstract void ProcessRequest(LeaveAskRequest request);