public override void requestProcess(RequestMan requestor) { if (requestor.Amount < 2000) { Console.WriteLine(string.Format("请求者:{0},请求金费{1}.审批人:{2}通过", requestor.Name, requestor.Amount, this.Name)); } else { Console.WriteLine("上级不批准处理"); } }
public override void requestProcess(RequestMan requestor) { if (requestor.Amount < 1500) { Console.WriteLine(string.Format("请求者:{0},请求金费{1}.审批人:{2}通过", requestor.Name, requestor.Amount, this.Name)); } else { Console.WriteLine(string.Format("请求者:{0},请求金费{1}.审批人:{2}请求上级处理", requestor.Name, requestor.Amount, this.Name)); this.nextCHeckMan.requestProcess(requestor); } }
static void Main(string[] args) { RequestMan r = new RequestMan("张三", 18600); CheckMan c1 = new CheckTeacher("李老师"); CheckMan c2 = new CheckMaster("张主任"); CheckMan c3 = new CheckLord("牛老板"); c1.nextCHeckMan = c2; c2.nextCHeckMan = c3; c1.requestProcess(r); Console.ReadKey(); }
public abstract void requestProcess(RequestMan requestor);