public OverviewViewModel(Models.ParkedVehicle vehicle) { var parkedVehiclesController = new Controllers.ParkedVehiclesController(); Id = vehicle.Id; RegNo = vehicle.RegNo; VehicleType = vehicle.VehicleType.Name; Owner = vehicle.Member.FullName; TimeParked = parkedVehiclesController.TimeParkedLongString(vehicle.CheckInTime, DateTime.Now); }
public DetailedOverviewViewModel(Models.ParkedVehicle vehicle, double pricePerHour) { var parkedVehiclesController = new Controllers.ParkedVehiclesController(); Id = vehicle.Id; RegNo = vehicle.RegNo; VehicleType = vehicle.VehicleType.Name; OwnerId = vehicle.MemberId; Owner = vehicle.Member.FullName; TimeParked = parkedVehiclesController.TimeParkedShortString(vehicle.CheckInTime, DateTime.Now); CheckInTime = vehicle.CheckInTime; CheckOutTime = vehicle.CheckOutTime; Color = vehicle.Color; Brand = vehicle.Brand; Model = vehicle.Model; NumberOfWheels = vehicle.NumberOfWheels; TotalPrice = parkedVehiclesController.TotalPriceString(vehicle.CheckInTime, DateTime.Now, pricePerHour); }