// GET: VehicleImageController
        public ActionResult Index(int vehicleId)
        {
            SetVehicleToViewBag(vehicleId);
            var items = VehicleImageService.GetByVehicle(vehicleId);

            return(View(items));
        }
Example #2
0
        private void SetVehicleDetailToViewBag(int id)
        {
            VehicleDetailViewModel vehicleDetail = new VehicleDetailViewModel();

            vehicleDetail.Vehicle             = VehicleService.GetDetail(id);
            vehicleDetail.VehicleImages       = VehicleImageService.GetByVehicle(id);
            vehicleDetail.VehicleRentalPrices = VehicleRentalPriceService.Get(new VehicleRentalPriceFilter(id, DateTime.Today));
            ViewBag.VehicleDetail             = vehicleDetail;
        }
        public IActionResult Detail(int id)
        {
            VehicleDetailViewModel vehicleDetail = new VehicleDetailViewModel();

            vehicleDetail.Vehicle             = VehicleService.GetDetail(id);
            vehicleDetail.VehicleImages       = VehicleImageService.GetByVehicle(id);
            vehicleDetail.VehicleRentalPrices = VehicleRentalPriceService.Get(new VehicleRentalPriceFilter(id, DateTime.Today));
            ViewBag.VehicleDetail             = vehicleDetail;
            return(View());
        }