<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ListComment, WebApp_deploy" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="nick">
        <tr>
            <td class="tit">
                <img style="border: 0px;" src="tpl/img/ico/search.png" />输入评论内容：
                <asp:TextBox  ID="TextBox_Content" runat="server" Width="150px"></asp:TextBox>
                &nbsp;&nbsp;
                <asp:Button ID="Button_Search" runat="server" Text=" 查 询 " 
                    onclick="Button_Search_Click" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 状态：
                <asp:DropDownList ID="DropDownList_State" AutoPostBack="true" runat="server" 
                    onselectedindexchanged="DropDownList_State_SelectedIndexChanged">
                    <asp:ListItem Text="全部" Value="2"></asp:ListItem>
                    <asp:ListItem Text="显示" Value="1"></asp:ListItem>
                    <asp:ListItem Text="隐藏" Value="0"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    
    <div id="product_history">
        <asp:GridView ID="GridView_Comment" runat="server" AutoGenerateColumns="False"
            CssClass="adminlist" onrowcommand="GridView_Comment_RowCommand">
            <Columns>
                     <asp:TemplateField ControlStyle-Width="50px">
                    <ItemTemplate>                                        
                         <input name='id' type='checkbox'  onclick='unselectall()' id='id' value='<%# Eval("Id") %>'>                                 
                    </ItemTemplate>
                    <HeaderTemplate >
                       <input name='chkAll' type='checkbox'  id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>                                     
                    </HeaderTemplate>
                       <HeaderStyle Width="4%" />
                   </asp:TemplateField>    
                <asp:TemplateField HeaderText="编号">
                    <ItemTemplate>
                        <asp:Label ID="Label_Name" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评论用户">
                    <ItemTemplate>
                        <asp:Label ID="Label_Type" runat="server" Text='<%# Eval("UserName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评论对象">
                    <ItemTemplate>
                        <asp:Label ID="Label_Methods" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评论时间" ControlStyle-Width="100">
                    <ItemTemplate>
                        <asp:Label ID="Label_Value" runat="server" Text='<%# Eval("DateTime") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                                <asp:TemplateField HeaderText="评价等级">
                    <ItemTemplate>
                        <asp:Label ID="Label_Sort" runat="server" Text='<%# Eval("Level") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="状态">
                    <ItemTemplate>
                        <asp:Label ID="Label_State" runat="server" Text='<%# Convert.ToBoolean(Eval("State"))==true?"显示":"隐藏"%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink_Search" runat="server" Text="查看详情" NavigateUrl='<%# "Admin_EditComment.aspx?Id="+Eval("Id") %>' />|<asp:LinkButton ID="LinkButton_Delete" OnClientClick="return confirm('确定要删除么?')"
                           Width="50px"  CommandName="_Delete" CommandArgument='<%# Eval("Id") %>' runat="server" Text="删除" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
                           <EmptyDataTemplate>
	               <tr>
	                 <td colspan="8">找不到相关数据！</td>
	               </tr>
               </EmptyDataTemplate>
        </asp:GridView>
    </div>
                 <div align="center">
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                        CurrentPageButtonPosition="Center" CustomInfoHTML="第 %CurrentPageIndex% 页，共%PageCount%页，每页%PageSize%条"
                        FirstPageText="首页" LastPageText="尾页" LayoutType="Table" NextPageText="下一页" PageIndexBoxType="DropDownList"
                        PagingButtonLayoutType="Span" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        SubmitButtonText="Go" TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到">
                    </webdiyer:AspNetPager>
             </div>
           <div class="div_btm">                  
          <asp:Button ID="Button_Delete"　OnClientClick="return confirm('您确定要删除吗?')" 
                   runat="server" Text="删除评论" CommandName="_Delete" 
                   oncommand="UserButtonOnCommon" />
          <asp:Button ID="Button_Success" runat="server" Text="通过审核" CommandName="_Success" oncommand="UserButtonOnCommon"  />
          <asp:Button ID="Button_Error" runat="server" Text="拒绝审核" CommandName="_Error" oncommand="UserButtonOnCommon"  />
      </div>
    
    <script type="text/javascript">
function unselectall(){
    if(document.myform.chkAll.checked){
        document.myform.chkAll.checked = document.myform.chkAll.checked&0;
       
    }
}
function CheckAll(form){
    for (var i=0;i<form.elements.length;i++){
        var e = form.elements[i];

        if (e.Name != 'chkAll'&&e.disabled==false)
        e.checked = form.chkAll.checked;
    }
}
 </script>
 
</asp:Content>
