Beispiel #1
0
        public Rentalinformation RentRequest(int TCNumber, int vehicleId, int howManyDays)
        {
            Customer           customer = customerDal.Get(x => x.TCNumber == TCNumber);
            VehicleInformation vehicle  = vehicleDal.Get(x => x.Id == vehicleId);

            Rentalinformation rental = new Rentalinformation();

            rental.CustomerID  = customer.Id;
            rental.VehicleID   = vehicleId;
            rental.HowManyDays = howManyDays;
            rental.Payment     = vehicle.DailyRentalPrice * howManyDays;
            rental.StartKm     = vehicle.DailyBorderKm;
            rental.IsRequest   = true;
            rental.IsActive    = false;

            rentDal.Add(rental);

            return(rental);
        }
Beispiel #2
0
 public VehicleInformation Get(int vehicleId)
 {
     return(vehicleDal.Get(x => x.Id == vehicleId));
 }