Exemplo n.º 1
0
 @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));
 }
Exemplo n.º 2
0
 @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));
 }