コード例 #1
0
ファイル: Rent.cs プロジェクト: danyelaristizabal/RentCars
        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");
            }
        }
コード例 #2
0
 public UserFacade(Costumer costumer)
 {
     Costumer = costumer;
 }
コード例 #3
0
        public Rent CreateNewRent(Car rentedcar, Costumer costumerrenting, Interval rentedinterval)
        {
            var NewRent = new Rent(rentedcar, costumerrenting, rentedinterval);

            return(NewRent);
        }