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); } }
protected bool ApproveRequest(RentCarRequest request) { return(request.GetNumberOfDays() <= GetMaxDaysCanApprove()); }