Ejemplo n.º 1
0
 public ActionResult Edit(AddVehicule addVehicule)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var vehiculo = new Vehiculo()
             {
                 ID          = addVehicule.ID,
                 IDMecanico  = addVehicule.SelectedMecanico,
                 IDModelo    = addVehicule.SelectedModelo,
                 IDProveedor = addVehicule.SelectedProveedor,
                 Precio      = addVehicule.Precio
             };
             var vehiculoInsertar = Mapper.Map <DATOS.Vehiculo>(vehiculo);
             veh.ActualizarVehiculo(vehiculoInsertar);
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(RedirectToAction("Index"));
     }
 }