Пример #1
0
  // 生成修改文章的文章html代码
  public String generateAdminArticleUpdateHtml(List<TArticle> articles) {
    String listHtml = "";
    int size = articles.size();
    for (int i = 0; i < size; i++) {
      TArticle article = articles.get(i);
      String item = "";

      item += "<tr id='" + article.getArticle_ID() + "' class='noteItem'>";
      item += "	<td>" + article.getArticle_ID() + "</td>";
      item += "	<td>" + article.getArticle_Title() + "</td>";
      item += "	<td>" + article.getSort_Name() + "</td>";
      item += "	<td>" + article.getRecommend_Num() + "</td>";
      item += "	<td>" + article.getRead_Num() + "</td>";
      item += "	<td>" + article.getArticle_Date() + "</td>";
      item += "	<td>";
      item +=
          "		<a class='update' onclick='update("
              + article.getArticle_ID()
              + ")' href='javascript:void(0)'>修改</a>";
      item += "	</td>";
      item += "</tr>";

      listHtml += item;
    }
    return listHtml;
  }
Пример #2
0
  // 生成删除文章的文章html代码
  public String generateAdminArticleDelHtml(List<TArticle> articles) {
    String listHtml = "";
    int size = articles.size();
    for (int i = 0; i < size; i++) {
      TArticle article = articles.get(i);
      String item = "";

      item += "<tr id='" + article.getArticle_ID() + "' class='noteItem'>";
      item += "	<td>";
      item += "		<div class='checker'>";
      item += "			<span>";
      item += "				<input class='checkboxes' type='checkbox' value='1'>";
      item += "			</span>";
      item += "		</div>";
      item += "	</td>";
      item += "	<td>" + article.getArticle_ID() + "</td>";
      item += "	<td>" + article.getArticle_Title() + "</td>";
      item += "	<td>" + article.getSort_Name() + "</td>";
      item += "	<td>" + article.getRecommend_Num() + "</td>";
      item += "	<td>" + article.getRead_Num() + "</td>";
      item += "	<td>" + article.getArticle_Date() + "</td>";
      item += "	<td>";
      item +=
          "		<a class='delete' onclick='oneDel("
              + article.getArticle_ID()
              + ")' href='javascript:void(0)'>删除</a>";
      item += "	</td>";
      item += "</tr>";

      listHtml += item;
    }
    return listHtml;
  }