Example #1
0
 public void update() {
   SysRolesModel role = getModelWithOutModelName(SysRolesModel.class, true);
   if (role.get("id") != null && role.update()) {
     setAttr(RESULT, true);
     setAttr(MESSAGE, "更新成功!");
     DisplayTool.removeCache(DisplayTool.ROLE_KEY);
   } else {
     setAttr(RESULT, false);
     setAttr(MESSAGE, "更新失败!");
   }
   renderJson();
 }
Example #2
0
 public void add() {
   SysRolesModel menu = getModelWithOutModelName(SysRolesModel.class, true);
   if (menu.save()) {
     setAttr(MESSAGE, "新增成功!");
     setAttr("id", menu.get("id"));
     setAttr(RESULT, true);
     DisplayTool.removeCache(DisplayTool.ROLE_KEY);
   } else {
     setAttr(RESULT, false);
     setAttr(MESSAGE, "新增失败!");
   }
   renderJson();
 }