Exemple #1
0
        public Rent(Car rentedcar, Costumer costumerrenting, Interval rentedinterval)
        {
            RentedCar       = rentedcar;
            CostumerRenting = costumerrenting;
            RentedInterval  = rentedinterval;

            if (RentedCar.Disponibility(RentedInterval) & RentedCar.CheckMaintenance())
            {
                CostumerRenting.Rents.Add(RentedInterval);
                CostumerRenting.RentHistory.Add(RentedCar.Id);
                RentedCar.RentCounter++;
            }
            if (RentedCar.CheckMaintenance() == false)
            {
                RentedCar.DoMaintenance(RentedInterval);
                Console.WriteLine("Cannot rent this car is going to Maintenance");
            }
            else
            {
                Console.WriteLine("Can not rent this car, it is going to Maintenance");
            }
        }
Exemple #2
0
 public UserFacade(Costumer costumer)
 {
     Costumer = costumer;
 }
Exemple #3
0
        public Rent CreateNewRent(Car rentedcar, Costumer costumerrenting, Interval rentedinterval)
        {
            var NewRent = new Rent(rentedcar, costumerrenting, rentedinterval);

            return(NewRent);
        }