public override void ProcessRequest(LeaveAskRequest request) { if (request.Days < 3) { Console.WriteLine("{0}审批了你的假单", Name); } else if (NextApprover != null) { NextApprover.ProcessRequest(request); } }
public override void ProcessRequest(LeaveAskRequest request) { if (request.Days < 10) { Console.WriteLine("{0}审批了你的假单", this.Name); } else { Console.WriteLine("不能超过10天的假期"); } }
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(); }
public abstract void ProcessRequest(LeaveAskRequest request);