示例#1
0
 public void ApplyCarRentalRequest(RentCarRequest request)
 {
     if (ApproveRequest(request))
     {
         Console.WriteLine("Request for car rental was accepted!");
         Logger.Instance.LogOk("Request " + request.RequestNumber + " processed succesfully by " + this.GetType().Name + "!");
     }
     else if (ServiceWorker != null)
     {
         Logger.Instance.LogOk("Car sent to another worker.");
         ServiceWorker.ApplyCarRentalRequest(request);
     }
 }
示例#2
0
 protected bool ApproveRequest(RentCarRequest request)
 {
     return(request.GetNumberOfDays() <= GetMaxDaysCanApprove());
 }