Пример #1
0
 public override void HandleRequest(LeaveNode leave)
 {
     if (leave.LeaveDays <= 15)
     {
         Console.WriteLine("校长 {0} 批准了 {1} 同学的请假,请假天数为 {2} 天。", Name, leave.PersonName, leave.LeaveDays);
     }
     else
     {
         Console.WriteLine("你请假的天数过长,不能批准....");
     }
 }
Пример #2
0
 public override void HandleRequest(LeaveNode leave)
 {
     if (leave.LeaveDays <= 3)
     {
         Console.WriteLine("辅导员 {0} 批准了 {1} 同学的请假,请假天数为 {2} 天。", Name, leave.PersonName, leave.LeaveDays);
     }
     else
     {
         if (successor != null)
         {
             successor.HandleRequest(leave);
         }
     }
 }
Пример #3
0
 public override void HandleRequest(LeaveNode leave)
 {
     if (leave.LeaveDays <=3)
     {
         Console.WriteLine("辅导员 {0} 批准了 {1} 同学的请假,请假天数为 {2} 天。",Name,leave.PersonName,leave.LeaveDays);
     }
     else
     {
         if (successor != null)
         {
             successor.HandleRequest(leave);
         }
     }
 }
Пример #4
0
        public static void Test()
        {
            Leader instructor     = new Instructor("王辅导员");
            Leader departmentHead = new DepartmentHead("李主任");
            Leader president      = new President("张校长");

            instructor.Successor     = departmentHead;
            departmentHead.Successor = president;

            LeaveNode day3  = new LeaveNode(3, "赵阳");
            LeaveNode day7  = new LeaveNode(7, "王辉");
            LeaveNode day20 = new LeaveNode(20, "张晓");

            instructor.HandleRequest(day3);
            instructor.HandleRequest(day7);
            instructor.HandleRequest(day20);
        }
Пример #5
0
        public static void Test()
        {
            Leader instructor = new Instructor("王辅导员");
            Leader departmentHead = new DepartmentHead("李主任");
            Leader president = new President("张校长");

            instructor.Successor = departmentHead;
            departmentHead.Successor = president;

            LeaveNode day3 = new LeaveNode(3, "赵阳");
            LeaveNode day7 = new LeaveNode(7, "王辉");
            LeaveNode day20 = new LeaveNode(20, "张晓");

            instructor.HandleRequest(day3);
            instructor.HandleRequest(day7);
            instructor.HandleRequest(day20);
        }
Пример #6
0
 public abstract void HandleRequest(LeaveNode leave);
Пример #7
0
 public override void HandleRequest(LeaveNode leave)
 {
     if (leave.LeaveDays <=15)
     {
         Console.WriteLine("校长 {0} 批准了 {1} 同学的请假,请假天数为 {2} 天。", Name, leave.PersonName, leave.LeaveDays);
     }
     else
     {
         Console.WriteLine("你请假的天数过长,不能批准....");
     }
 }
Пример #8
0
 public abstract void HandleRequest(LeaveNode leave);