Esempio n. 1
0
  public void editSave() {
    Transaction trans = new Transaction();
    ZCAdminGroupSchema manageGroup = new ZCAdminGroupSchema();
    manageGroup.setGroupID($V("GroupID"));
    manageGroup.fill();
    manageGroup.setValue(this.Request);
    manageGroup.setAllowEditUser($V("AllowEditUser"));

    trans.add(manageGroup, 2);
    if (trans.commit()) this.Response.setLogInfo(1, "设置成功!");
    else this.Response.setLogInfo(0, "操作失败!");
  }
Esempio n. 2
0
 public void del() {
   String ids = $V("IDs");
   String[] arr = ids.split("\\,");
   Transaction tran = new Transaction();
   for (int i = 0; i < arr.length; ++i) {
     tran.add(
         new QueryBuilder(
             "delete from ZCDatabase where SiteID=? and ID=?",
             Application.getCurrentSiteID(),
             arr[i]));
   }
   if (tran.commit()) this.Response.setMessage("删除数据库连接成功");
   else this.Response.setError("发生错误,删除数据库连接失败");
 }
Esempio n. 3
0
  public void del() {
    String ids = $V("IDs");
    if (!StringUtil.checkID(ids)) {
      this.Response.setLogInfo(0, "传入ID时发生错误");
      return;
    }
    Transaction trans = new Transaction();

    ZCMessageSchema message = new ZCMessageSchema();
    ZCMessageSet set = message.query(new QueryBuilder("where id in (" + ids + ")"));
    trans.add(set, 5);

    if (trans.commit()) {
      MessageCache.removeIDs(set);
      QueryBuilder qb =
          new QueryBuilder(
              "select count(1) from ZCMessage where ReadFlag=0 and ToUser=?", User.getUserName());
      CacheManager.set("Message", "Count", User.getUserName(), qb.executeInt());
      this.Response.setLogInfo(1, "删除成功");
    } else {
      this.Response.setLogInfo(0, "删除失败");
    }
  }