Пример #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Abrv")] VehicleMakeViewModel vehicleMakeViewModel)
 {
     if (ModelState.IsValid)
     {
         _service.Edit(vehicleMakeViewModel);
         return(RedirectToAction("Index"));
     }
     return(View(vehicleMakeViewModel));
 }
Пример #2
0
        public ActionResult Edit(int id)
        {
            BaseMakeVehicleService makeToEdit = new VehicleMakeService();
            var vehicleMakeToEdit             = makeToEdit.Edit(id);

            if (vehicleMakeToEdit == null)
            {
                return(HttpNotFound());
            }

            return(View("VehicleMakeForm", vehicleMakeToEdit));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Abrv")] VehicleMakeView makes)
 {
     try
     {
         if (ModelState.IsValid)
         {
             make.Edit(Mapper.Map <VehicleMake>(makes));
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException) { }
     return(RedirectToAction("Edit", makes.Id));
 }