@Action(value = "save") public void save() throws Exception { SuccessOrFailure result = SuccessOrFailure.SUCCESS; try { purchaseItemService.saveOrModify(item); } catch (Exception e) { result = SuccessOrFailure.FAILURE; e.printStackTrace(); } HttpUtils.write(JsonUtils.toJsonString(result)); }
@Action(value = "delete") public void delete() throws Exception { SuccessOrFailure result = SuccessOrFailure.SUCCESS; try { String id = getParameterFromRequest("id"); purchaseItemService.delete(id); } catch (Exception e) { result = SuccessOrFailure.FAILURE; e.printStackTrace(); } HttpUtils.write(JsonUtils.toJsonString(result)); }