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);
        }
예제 #2
0
        public VehicleVoucherViewModel toViewModel(Vehicle vehicle)
        {
            VehicleVoucherViewModel model = new VehicleVoucherViewModel
            {
                id               = vehicle.Id,
                VoucherID        = voucherId(),
                RegNr            = vehicle.RegNr,
                VehicleTypeName  = VehicleTypeName,
                Color            = vehicle.Color,
                ParkingLotNo     = vehicle.ParkingLotNo,
                VehicleLength    = vehicle.VehicleLength,
                ParkingStartTime = vehicle.ParkingStartTime,
                ParkingStopTime  = DateTime.Now,
                NoOfTyres        = vehicle.NoOfTyres,
                Model            = vehicle.Model,
                Fabricate        = vehicle.Fabricate,
                Duration         = parkingHelper.getDuration(vehicle.ParkingStartTime),
                PaymentAmount    = parkingHelper.getCost(vehicle.ParkingStartTime)
            };

            return(model);
        }