public async Task <IActionResult> Details(int id)
        {
            var returnUrl = Request.Headers["Referer"].ToString();

            var vehicleType = await _vehicleTypeRepo.GetVehicleType(id);

            VehicleTypeViewModel vehicleTypeVM = VehicleTypeViewModelFactory.Details(vehicleType, returnUrl);

            return(View("Edit", vehicleTypeVM));
        }
        public IActionResult GetVType(int id)
        {
            var vehicleType = _VTypeRepo.GetVehicleType(id);

            if (vehicleType == null)
            {
                return(NotFound());
            }

            return(Ok(vehicleType));
        }
Exemple #3
0
        public VehicleTypeDTO GetVehicleType(int vehicleTypeId)
        {
            try
            {
                //Requires.NotNegative("vehicleTypeId", vehicleTypeId);

                log.Debug("vehicleTypeId: " + vehicleTypeId + " ");

                // get
                R_VehicleType t = Repository.GetVehicleType(vehicleTypeId);

                VehicleTypeDTO dto = new VehicleTypeDTO(t);

                log.Debug(VehicleTypeDTO.FormatVehicleTypeDTO(dto));

                return(dto);
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }