Beispiel #1
0
 public void FromTO(TOVehicle toVehicle, RentACar rentACar)
 {
     Brand            = toVehicle.Brand;
     IsOnSale         = toVehicle.IsOnSale;
     Location         = toVehicle.Location;
     NumOfSeats       = toVehicle.NumOfSeats;
     PricePerDay      = toVehicle.PricePerDay;
     Rating           = toVehicle.Rating;
     RentACar         = rentACar;
     Type             = toVehicle.Type;
     UnavailableDates = new List <UnavailableDate>();
     toVehicle.UnavailableDates.ToList().ForEach(date =>
     {
         DateTime newDate = DateTime.Parse(date.Value.ToString());
         UnavailableDates.Add(new UnavailableDate()
         {
             DateId  = 0,
             Date    = newDate,
             Vehicle = this
         });
     });
     VehicleId = toVehicle.VehicleId;
     Year      = toVehicle.Year;
     Version   = toVehicle.Version;
 }
        public void FromTO(TOVehicleReservation toVehicleReservation)
        {
            FromDate      = DateTime.Parse(toVehicleReservation.FromDate);
            FromLocation  = toVehicleReservation.FromLocation;
            NumOfDays     = toVehicleReservation.NumOfDays;
            Price         = toVehicleReservation.Price;
            ReservationId = toVehicleReservation.ReservationId;
            ToDate        = DateTime.Parse(toVehicleReservation.ToDate);
            ToLocation    = toVehicleReservation.ToLocation;
            Type          = toVehicleReservation.Type;
            Vehicle  vehicle  = new Vehicle();
            RentACar rentACar = new RentACar();

            rentACar.FromTO(toVehicleReservation.RentACar);
            //vehicle.FromTO(toVehicleReservation.Vehicle, rentACar);
            VehicleId       = toVehicleReservation.VehicleId;
            UserName        = toVehicleReservation.UserName;
            CreationDate    = DateTime.Now;
            IsVehicleRated  = toVehicleReservation.IsVehicleRated;
            IsRentACarRated = toVehicleReservation.IsRentACarRated;
        }