Пример #1
0
        // GET: VehicleMake/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VehicleMake vehicleMake = await _vehicleService.GetMakeById(id);

            VehicleMakeViewModel viewModel = _mapper.Map <VehicleMakeViewModel>(vehicleMake);

            if (vehicleMake == null)
            {
                return(HttpNotFound());
            }
            return(View(viewModel));
        }
Пример #2
0
        public ActionResult LoadVMake(Guid?makeId = null)
        {
            var model = new Vmake()
            {
                EntityVMake = makeId == null ? new VehicleMake() : vmakeService.GetMakeById((Guid)makeId)
            };

            ViewBag.Action = makeId == null ? "SaveVehicleMake" : "EditVehicleMake";
            return(View(model));
        }