<%@ 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&MenuName=&#x4F1A;&#x5458;&FileName=&#x6DFB;&#x52A0;&#x901A;&#x884C;&#x8BC1;" 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:40%">
              <asp:DropDownList ID="DDL_MemberTypeSearch" runat="server" AutoPostBack="true" 
                  onselectedindexchanged="DDL_MemberTypeSearch_SelectedIndexChanged">
               </asp:DropDownList>
               <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:30%">
                  <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:TemplateField HeaderText="货币">
                       <ItemTemplate>
                          <%-- <asp:Label ID="Balance" runat="server" Text='<%# Eval("Balance") %>'></asp:Label>--%>
                          <%#Eval("Balance")%>
                       </ItemTemplate>
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="积分">
                       <ItemTemplate>
                           <asp:Label ID="TotalCountEP" runat="server" Text='<%#Eval("UserEP") %>'></asp:Label>
                       </ItemTemplate>
                   </asp:TemplateField>
                   <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&MenuName=&#x4F1A;&#x5458;&FileName=&#x67E5;&#x770B;&#x901A;&#x884C;&#x8BC1;&UserID="+Eval("UserID")%>' >查看</a> 
                         <a href='<%#"Admin_AddPassport.aspx?Action=Modify&MenuName=&#x4F1A;&#x5458;&FileName=&#x4FEE;&#x6539;&#x901A;&#x884C;&#x8BC1;&UserID="+Eval("UserID")%>' id='modifybut' >修改</a> 
                         <a href='<%#"Admin_UserDetail.aspx?MenuName=&#x4F1A;&#x5458;&FileName=&#x7528;&#x6237;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&UserID="+Eval("UserID") %>'>详细</a>
                         <a target="_blank" title="以此会员的身份进入" href='<%#UserLogUrl(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>


