Exemplo n.º 1
0
 // GET: VehicleMaintenance/Edit/5
 public ActionResult Edit(int id)
 {
     try
     {
         Domain.VehicleMaintenance.VehicleMaintenance vehiclemaintenance = _vehiclemaintenanceService.GetVehicleMaintenanceById(id);
         VehicleMaintenanceViewModel model = Mapper.Map <VehicleMaintenanceViewModel>(vehiclemaintenance);
         return(View(model));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 2
0
        public ActionResult Edit(int id, VehicleMaintenanceViewModel model)
        {
            try
            {
                Domain.VehicleMaintenance.VehicleMaintenance vechicle = _vehiclemaintenanceService.GetVehicleMaintenanceById(id);
                vechicle = Mapper.Map <VehicleMaintenance>(model);
                _vehiclemaintenanceService.EditVehicleMaintenance(id, vechicle);

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index"));
            }
        }
 public void EditVehicleMaintenance(int id, Domain.VehicleMaintenance.VehicleMaintenance vehicleMaintenance)
 {
     _vehiclemaintenanceRepository.EditVehicleMaintenance(id, vehicleMaintenance);
 }
 public void SaveVehicleMaintenance(Domain.VehicleMaintenance.VehicleMaintenance vehicleMaintenance)
 {
     _vehiclemaintenanceRepository.SaveVehicleMaintenance(vehicleMaintenance);
 }