public void EditVehicleMake(ViewVehicleMake viewVehicleMake) { VehicleMake vehicleMakes = Db.VehicleMakes.Find(viewVehicleMake.VehicleMakeId); Mapper.Map(viewVehicleMake, vehicleMakes); Db.SaveChanges(); }
public ActionResult Edit([Bind(Include = "VehicleMakeId,VehicleMakeName,VehicleMakeAbrv")] ViewVehicleMake vehicleMake) { if (ModelState.IsValid) { vehicleService.EditVehicleMake(vehicleMake); return(RedirectToAction("Index")); } return(View(vehicleMake)); }
// GET: VehicleMakes/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ViewVehicleMake vehicleMake = vehicleService.FindVehicleMake(id); if (vehicleMake == null) { return(HttpNotFound()); } return(View(vehicleMake)); }
public void CreateVehicleMake(ViewVehicleMake vehicleMake) { Db.VehicleMakes.Add(Mapper.Map <VehicleMake>(vehicleMake)); Db.SaveChanges(); }