<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="articlecommentlist.aspx.cs" Inherits="QiZhanBang.Web.backend.articlecommentlist" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章评论管理</title>
<link href="images/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body { padding:10px }
-->
</style>
<script language="javascript" type="text/javascript">
    function SelectAll(theBox) {
        var elm = document.Form1.elements;
        for (i = 0; i < elm.length; i++)
            if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
                elm[i].checked = theBox.checked;
            }
    }

    function CheckDeleteHandle(btn) {
        var elm = document.Form1.elements;
        var flag = false;
        for (i = 0; i < elm.length; i++)
            if (elm[i].type == "checkbox") {
                if (elm[i].checked) {
                    flag = true;
                    break;
                }
            }

        if (flag) {
            return confirm('是否要删除选择的评论？');
        }
        else {
            alert("你没有选择任何评论，请选择！");
            return false;
        }
    }
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3 class="boxtitle">后台管理 &gt;&gt; 文章评论</h3>
<asp:DataGrid runat="server" ID="dgArticleComment" AutoGenerateColumns="false" 
            BorderWidth="1" HorizontalAlign="Center" CellPadding="3" CellSpacing="1" 
            CssClass="boxtd" HeaderStyle-CssClass="title_bg" 
            FooterStyle-BackColor="#ffffff" FooterStyle-HorizontalAlign="Center" FooterStyle-Height="33"
            UseAccessibleHeader="true" ShowFooter="false" ShowHeader="true" 
            DataKeyField="commentid" onitemcommand="dgArticleComment_ItemCommand" 
        onitemcreated="dgArticleComment_ItemCreated" AllowPaging="True" 
        onpageindexchanged="dgArticleComment_PageIndexChanged">
<FooterStyle HorizontalAlign="Center" BackColor="White" Height="33px"></FooterStyle>
      <PagerStyle Mode="NumericPages" />
     <Columns>
        <asp:TemplateColumn HeaderText="选择" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <asp:CheckBox runat="server" ID="chkIsSelect" CssClass="input" />
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="评论内容" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <a href="/show.aspx?aid=<%# DataBinder.Eval(Container.DataItem, "articleid")%>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "content")%></a> 
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="审核情况" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate> 
             <%# (bool)DataBinder.Eval(Container.DataItem, "ischecked") ? "已审" : "<font color='red'>未审</font>"%>  
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="评论时间" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "createdate")%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="操作" ItemStyle-HorizontalAlign="Center">
             <ItemTemplate>
                <asp:LinkButton runat="server" ID="lnkCheck" CommandArgument="CheckInfo" Text="审核/反审" />
                <asp:LinkButton runat="server" ID="lnkDelete" CommandArgument="DeleteInfo" Text="删除" />
             </ItemTemplate>
        </asp:TemplateColumn>
     </Columns>

<HeaderStyle CssClass="title_bg"></HeaderStyle>
  </asp:DataGrid> 
    <table border="0" align="center" cellpadding="3" cellspacing="1" class="boxtd">
  <tr>
    <td colspan="9" class="tdbg" align="center">
    <asp:CheckBox runat="server" ID="chkSelectAll" ToolTip="全选/否选" />全选/否选 
        <asp:Button runat="server" ID="btnBatchDelete" Text="删除所选评论" 
            onclick="btnBatchDelete_Click" /> 
     </td>
  </tr>
  </table>
</form>
</body>
</html>
