@RequestMapping(value = "/management/auditType/upsert", method = RequestMethod.POST) public ModelAndView upsert(@RequestParam(required = false) Long id) { ModelAndView modelView = new ModelAndView("/management/auditType/upsert"); try { auditTypeService.upsert(id, modelView); } catch (Exception ex) { logException.Write(ex, this.getClass(), "upsert", sharedUserService); } return modelView; }
@RequestMapping(value = "/management/auditType/doObsolete", method = RequestMethod.POST) public ResponseMessage doObsolete(@RequestParam(required = true) Long id) { ResponseMessage response = new ResponseMessage(); try { auditTypeService.doObsolete(id, response); } catch (Exception ex) { logException.Write(ex, this.getClass(), "doUpsert", sharedUserService); response.setHasError(true); response.setMessage( "Se presentó un error inesperado. Por favor revise la información e intente de nuevo."); } finally { return response; } }
@RequestMapping(value = "/management/auditType/doUpsert", method = RequestMethod.POST) public ResponseMessage doUpsert(@Valid AuditTypeDto modelNew, BindingResult result) { ResponseMessage response = new ResponseMessage(); try { if (DtoValidator.isValid(result, response) == false) return response; auditTypeService.save(modelNew, response); } catch (Exception ex) { logException.Write(ex, this.getClass(), "doUpsert", sharedUserService); response.setHasError(true); response.setMessage( "Se presentó un error inesperado. Por favor revise la información e intente de nuevo."); } finally { return response; } }