<%@ page language="C#" enableeventvalidation="false" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Passport, WebApp_deploy" title="通行证管理" debug="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/Function.js" type="text/javascript"></script>


      <table class="adminheading">
         <tr>
            <th class="user" align="left" style="width: 19%">通行证管理</th>
            <td align="right">
            <div style="width:100px"><a href="Admin_AddPassport.aspx?Action=Add" id="addNewUser" >添加用户</a></div>
            </td>
            <td class="rtdw"></td>
         </tr>
      </table>
   

      <table class="nick">
        <tr><td colspan="4" class="tit">快速查找</td></tr>
        <tr><td class="ltd">搜索会员：</td><td class="rtd" style="width:35%">
               <asp:TextBox ID="SearchUserTextBox" runat="server" AutoPostBack="false"/>           
                 <asp:DropDownList ID="DDL_SearchType" runat="server">
                     <asp:ListItem Value="1" Text="模糊查询" />
                     <asp:ListItem Value="0" Text="精确查询" />
                 </asp:DropDownList>
                 <asp:Button ID="SearchButton" runat="server" Text="搜索" OnClick="SearchButton_Click" />
            </td>
            <td class="ltd">快速搜索：</td>
            <td class="rtd" style="width:35%">
                 <asp:DropDownList ID="SelectUserType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="SelectUserType_SelectedIndexChanged">
                 <asp:ListItem value="all" Text="所有会员" />                       
                  <asp:ListItem Value="24hourlogin" Text="最近24小时登录会员" />
                  <asp:ListItem Value="24hourreg" Text="最近24小时注册会员" />
                  <asp:ListItem Value="loginmost" Text="登录次数升序" />
                  <asp:ListItem Value="balanceasc" Text="货币升序" />
                </asp:DropDownList>
           </td>
        </tr>
      </table>
     
      <asp:GridView ID="GridView1" runat="server" autoGenerateColumns="False" DataKeyNames="UserID" OnRowDataBound="GridView1_RowDataBound" PageSize="15" RowStyle-HorizontalAlign="Center" CssClass="adminlist" EnableViewState="false">
            <Columns>
                   <asp:TemplateField>
                    <ItemTemplate>                                        
                        <input name="chkSelect" type="checkbox" value='<%# Eval("Userid") %>'/>                                         
                    </ItemTemplate>
                    <HeaderTemplate >
                       <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />                                     
                    </HeaderTemplate>
                       <HeaderStyle Width="4%" />
                   </asp:TemplateField>                                                                 
                   <asp:BoundField DataField="UserID" HeaderText="ID" InsertVisible="False" ReadOnly="True"  SortExpression="UserID"/>
                   <asp:BoundField DataField="UserName" HeaderText="会员名" SortExpression="UserName"/>  
                   <asp:TemplateField HeaderText="会员组">
                      <ItemTemplate>
                         <asp:Label ID="GroupName" runat="server" Text='<%# Bind("GroupName") %>' />
                      </ItemTemplate>
                   </asp:TemplateField>                                     
                   <asp:BoundField DataField="RegTime" HeaderText="注册时间" SortExpression="RegTime"/>                                      
                   <asp:BoundField DataField="LastLoginTime" HeaderText="最后登录" SortExpression="LastLoginTime"/> 
                   <asp:BoundField DataField="LoginTimes" HeaderText="登录次数" SortExpression="LoginTimes" >
                      <HeaderStyle Width="8%" />
                   </asp:BoundField>                                       
                   <asp:BoundField DataField="Balance" HeaderText="货币" SortExpression="Balance"/>
                   <asp:BoundField DataField="UserEP" HeaderText="积分" SortExpression="UserEP"/>
                   <asp:TemplateField HeaderText="状态">
                      <ItemTemplate>
                         <asp:Label ID="labelIsLocked" runat="server" Text='<%#Bind("IsLocked") %>' />
                      </ItemTemplate>
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="操作">
                      <ItemTemplate>
                         <a href='<%#"Admin_AddPassport.aspx?Action=Show&UserID="+Eval("UserID")%>' >查看</a> 
                         <a href='<%#"Admin_AddPassport.aspx?Action=Modify&UserID="+Eval("UserID")%>' id='modifybut' >修改</a> 
                         <a href='<%#"Admin_UserDetail.aspx?UserID="+Eval("UserID") %>'>详细</a>
                         <a target="_blank" title="以此会员的身份进入" href='<%#"UserLogin.aspx?UserID="+Eval("UserID") %>'>登录</a>
                      </ItemTemplate>
                       <ItemStyle Width="20%"/>
                   </asp:TemplateField>       
               </Columns> 
               <RowStyle HorizontalAlign="Center" />
               <EmptyDataTemplate>
	               <tr>
	                 <td colspan="10">找不到相关数据！</td>
	               </tr>
               </EmptyDataTemplate>
      </asp:GridView>    
      
      <div class="page">           
            <asp:Label runat="server" ID="PagePanel" />
      </div>

       <div class="div_btm">                  
          <asp:Button ID="Button2"　OnClientClick="return confirm('您确定要删除吗？此操作将删除所有跟删除通行证用户相关联的数据，并且删除后不能恢复?')"　　　　 runat="server" Text="删除用户" CommandName="Delete" OnCommand="UserButtonOnCommon"/>
          <asp:Button ID="Button3" runat="server" Text="锁定用户" CommandName="Lock" OnCommand="UserButtonOnCommon"/>
          <asp:Button ID="Button4" runat="server" Text="取消锁定" CommandName="CancleLock" OnCommand="UserButtonOnCommon"/>
      </div>
      
</asp:Content>


