Exemple #1
0
        public void EditVehicleMake(ViewVehicleMake viewVehicleMake)
        {
            VehicleMake vehicleMakes = Db.VehicleMakes.Find(viewVehicleMake.VehicleMakeId);

            Mapper.Map(viewVehicleMake, vehicleMakes);
            Db.SaveChanges();
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "VehicleMakeId,VehicleMakeName,VehicleMakeAbrv")] ViewVehicleMake vehicleMake)
 {
     if (ModelState.IsValid)
     {
         vehicleService.EditVehicleMake(vehicleMake);
         return(RedirectToAction("Index"));
     }
     return(View(vehicleMake));
 }
Exemple #3
0
        // 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));
        }
Exemple #4
0
 public void CreateVehicleMake(ViewVehicleMake vehicleMake)
 {
     Db.VehicleMakes.Add(Mapper.Map <VehicleMake>(vehicleMake));
     Db.SaveChanges();
 }