示例#1
0
 public void Verify() {
   String ID = $V("ID");
   String Type = $V("Type");
   String IDs = $V("IDs");
   if ((XString.isNotEmpty(ID)) && (XString.isEmpty(IDs))) {
     ZCCommentSchema comment = new ZCCommentSchema();
     comment.setID(ID);
     comment.fill();
     if (Type.equals("Pass")) comment.setVerifyFlag("Y");
     else if (Type.equals("NoPass")) {
       comment.setVerifyFlag("N");
     }
     comment.setVerifyUser(User.getUserName());
     comment.setVerifyTime(new Date());
     if (comment.update()) this.response.setLogInfo(1, "审核成功");
     else this.response.setLogInfo(0, "审核失败");
   } else if ((XString.isNotEmpty(IDs)) && (XString.isEmpty(ID))) {
     ZCCommentSchema comment = new ZCCommentSchema();
     ZCCommentSet set = comment.query(new QueryBuilder("where ID in (" + IDs + ")"));
     Transaction trans = new Transaction();
     for (int i = 0; i < set.size(); i++) {
       comment = set.get(i);
       if (Type.equals("Pass")) comment.setVerifyFlag("Y");
       else if (Type.equals("NoPass")) {
         comment.setVerifyFlag("N");
       }
       comment.setVerifyUser(User.getUserName());
       comment.setVerifyTime(new Date());
       trans.add(comment, OperateType.UPDATE);
     }
     if (trans.commit()) this.response.setLogInfo(1, "审核成功");
     else this.response.setLogInfo(0, "审核失败");
   }
 }
示例#2
0
 public void del() {
   String ids = $V("IDs");
   if ((ids.indexOf("\"") >= 0) || (ids.indexOf("'") >= 0)) {
     this.response.setLogInfo(0, "传入ID时发生错误");
     return;
   }
   Transaction trans = new Transaction();
   ZCCommentSchema task = new ZCCommentSchema();
   ZCCommentSet set = task.query(new QueryBuilder("where id in (" + ids + ")"));
   trans.add(set, OperateType.DELETE_AND_BACKUP);
   if (trans.commit()) this.response.setLogInfo(1, "删除评论成功");
   else this.response.setLogInfo(0, "删除评论失败");
 }