Ejemplo n.º 1
0
 public static void dg1DataBind(DataGridAction dga) {
   DataTable dt =
       new QueryBuilder("select * from ZDMemberField order by AddTime desc")
           .executePagedDataTable(dga.getPageSize(), dga.getPageIndex());
   dt.decodeColumn("InputType", InputTypeMap);
   dt.decodeColumn("VerifyType", VerifyTypeMap);
   dga.bindData(dt);
 }
Ejemplo n.º 2
0
  public static void dg1DataBind(DataListAction dla) {
    String CatalogID = dla.getParam("CatalogID");
    String CatalogType = dla.getParam("CatalogType");
    String VerifyStatus = dla.getParam("VerifyStatus");
    QueryBuilder qb =
        new QueryBuilder(
            "select ZCComment.*,(select Name from zccatalog where zccatalog.ID=ZCComment.CatalogID) as CatalogName,");

    if (XString.isEmpty(CatalogType)) {
      CatalogType = "1";
    }
    if (XString.isEmpty(VerifyStatus)) {
      VerifyStatus = "X";
    }
    if (CatalogType.equals("1"))
      qb.append("(select Title from ZCArticle where ZCArticle.ID = ZCComment.RelaID) as Name");
    else if (CatalogType.equals("4"))
      qb.append("(select Name from ZCImage where ZCImage.ID = ZCComment.RelaID) as Name");
    else if (CatalogType.equals("5"))
      qb.append("(select Name from ZCVideo where ZCVideo.ID = ZCComment.RelaID) as Name");
    else if (CatalogType.equals("6"))
      qb.append("(select Name from ZCAudio where ZCAudio.ID = ZCComment.RelaID) as Name");
    else if (CatalogType.equals("7")) {
      qb.append("(select Name from ZCAttachment where ZCAttachment.ID = ZCComment.RelaID) as Name");
    }
    qb.append(" from ZCComment where SiteID=?", ApplicationPage.getCurrentSiteID());
    qb.append(" and CatalogType=?", CatalogType);
    if (XString.isNotEmpty(CatalogID)) {
      qb.append(" and CatalogID=?", CatalogID);
    }
    if (!VerifyStatus.equals("All")) {
      qb.append(" and VerifyFlag=?", VerifyStatus);
    }
    qb.append(" order by VerifyFlag asc, ID desc");
    dla.setTotal(qb);
    DataTable dt = qb.executePagedDataTable(dla.getPageSize(), dla.getPageIndex());
    dt.insertColumn("PreLink");
    dt.insertColumn("FlagColor");
    for (int i = 0; i < dt.getRowCount(); i++) {
      if (dt.getString(i, "CatalogType").equals("1"))
        dt.set(i, "PreLink", "../Document/Preview.jsp?ArticleID=" + dt.getString(i, "RelaID"));
      else {
        dt.set(i, "PreLink", "#;");
      }
      if (dt.getString(i, "VerifyFlag").equals("Y")) dt.set(i, "FlagColor", "#00ff00");
      else if (dt.getString(i, "VerifyFlag").equals("X")) dt.set(i, "FlagColor", "#ff7700");
      else {
        dt.set(i, "FlagColor", "#ff0000");
      }
    }
    dt.decodeColumn("VerifyFlag", CacheManager.getMapx("Code", "Comment.Status"));
    if (dt.getRowCount() == 0) {
      // dt.insertRow(null);
      dt.set(0, "ID", "0");
    }
    dla.bindData(dt);
  }
Ejemplo n.º 3
0
 public static void dg1DataBind(DataGridAction dga) {
   DataTable dt =
       new QueryBuilder(
               "select * from ZCFullText where siteid=?", ApplicationPage.getCurrentSiteID())
           .executeDataTable();
   Mapx map = new Mapx();
   map.put("Article", "文章检索");
   map.put("Image", "图片检索");
   map.put("Video", "视频检索");
   map.put("Radio", "音频检索");
   dt.decodeColumn("Type", map);
   dga.bindData(dt);
 }