public IActionResult Create(ApartadoVMO vmo) { try { var model = ApartadoAdapterVMO.ConvertToModel(vmo); _serviceApartado.AddElement(model); return(Json(new { success = true, message = "Se ha creado correctamente" })); } catch (Exception ex) { throw ex; } }
public IActionResult Edit(ApartadoVMO vmo) { try { var model = _serviceApartado.GetElementById(vmo.Id); model = ApartadoAdapterVMO.ConvertToModel(vmo, model); _serviceApartado.UpdateElement(model); return(Json(new { success = true, message = "Se ha editado correctamente" })); } catch (Exception ex) { throw ex; } }