public VehicleDeleteViewModel toViewModel(Vehicle vehicle) { VehicleDeleteViewModel model = new VehicleDeleteViewModel { Id = vehicle.Id, RegNr = vehicle.RegNr, VehicleTypeName = VehicleTypeName, Color = vehicle.Color, ParkingLotNo = vehicle.ParkingLotNumber, ParkingStartTime = vehicle.ParkingStartTime, ParkingStopTime = DateTime.Now, NoOfTyres = vehicle.NumberOfTyres, Model = vehicle.Modell, Fabricate = vehicle.Brand, Duration = ParkingHelper.GetDuration(vehicle.ParkingStartTime), PaymentAmount = ParkingHelper.GetCost(vehicle.ParkingStartTime) }; return(model); }
public VehicleVoucherViewModel toViewModel(Vehicle vehicle, Member member) { VehicleVoucherViewModel model = new VehicleVoucherViewModel { VoucherID = voucherId(), MemberId = member.MemberId, MemberName = member.FullName, RegNr = vehicle.RegNr, VehicleTypeName = VehicleTypeName, Color = vehicle.Color, ParkingLotNo = vehicle.ParkingLotNumber, ParkingStartTime = vehicle.ParkingStartTime, ParkingStopTime = DateTime.Now, NoOfTyres = vehicle.NumberOfTyres, Modell = vehicle.Modell, Brand = vehicle.Brand, Duration = ParkingHelper.GetDuration(vehicle.ParkingStartTime), PaymentAmount = ParkingHelper.GetCost(vehicle.ParkingStartTime) }; return(model); }