<%@ page language="C#" masterpagefile="~/HL_Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Passport, HoWaveIMSV5.0" title="通行证管理" debug="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
<script src="Js/Function.js" type="text/javascript"></script> 
<script type="text/javascript">
 
function AddUser(ctlName,action){
  var recdata=false;
  switch (action){
      case "Add":      
      recdata=showModalDialog('Admin_AddPassport.aspx?Action=Add','','dialogWidth:600px; dialogHeight:300px; help: yes; scroll: yes; status: no');
      break;
      case "Modify":
      recdata=showModalDialog('Admin_AddPassport.aspx?Action=Modify&UserID='+document.getElementById(ctlName).value,'','dialogWidth:600px; dialogHeight:300px; help: yes; scroll: yes; status: no');      
      break;
      case "Show":
      recdata=showModalDialog('Admin_AddPassport.aspx?Action=Show&UserID='+document.getElementById(ctlName).value,'','dialogWidth:600px; dialogHeight:300px; help: yes; scroll: yes; status: no');      
      break;
      
  }
       //判断对应的返回值
      if(recdata==true)
      {
         // 刷新当前窗口
         window.location.reload();       
      } 
   
}
</script>
<table class="adminheading" width="100%">                
    <tr>
       <td valign="middle" style="height: 79px; width: 94%;"  >
		  <table class="adminheading" width="100%">
             <tr>
                <th class="user" align="left" style="width: 19%">通行证管理</th>
                <td align="right">搜索会员:</td>                
                <td align="right">
                   <asp:TextBox ID="SearchUserTextBox" runat="server" autocomplete="off"/>                  
                   <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1"
                                  TargetControlID="SearchUserTextBox" 
                                  EnableCaching="true"
                                  ServicePath="AutoCompleteService.asmx" 
                                  ServiceMethod="GetWordList" 
                                  minimumprefixlength="2" 
                                  CompletionInterval="1000"
                                  CompletionSetCount="12" />
                  
                 </td>
                 <td>
                     <asp:DropDownList ID="DDL_SearchType" runat="server">
                         <asp:ListItem Value="-1" Text="请选择查询方式" Selected="True"/>
                         <asp:ListItem Value="0" Text="精确查询" />
                         <asp:ListItem Value="1" Text="模糊查询" />
                     </asp:DropDownList>
                     <asp:Button ID="SearchButton" runat="server" Text="搜索" OnClick="SearchButton_Click" />
                 </td>                
                 <td style="height: 86px">
                    <asp:DropDownList ID="SelectUserType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="SelectUserType_SelectedIndexChanged">
                      <asp:ListItem Value="-1" Text="快速查找会员" />
                      <asp:ListItem value="all" Text="所有会员" />
                      <asp:ListItem value="member" Text="注册会员" />
                      <asp:ListItem value="vip" Text="VIP会员" /> 
                      <asp:ListItem value="uncheck" Text="未验证会员" />                      
                      <asp:ListItem Value="24hourlogin" Text="最近24小时登录会员" />
                      <asp:ListItem Value="24hourreg" Text="最近24小时注册会员" />
                      <asp:ListItem Value="loginmost" Text="登录次数最多会员" />
                      <asp:ListItem Value="coinzero" Text="通行币为0的会员" />                      
                    </asp:DropDownList>                     
                 </td>
             </tr>
          </table>
      </td>
      <td valign="middle" style="height: 79px">
        <a href="javascript:void(0)" id="addNewUser" onClick="AddUser('','Add')"><img src="../Images/Manage/new_f2.png" id="newUser"  runat="server"  border="0"/><br />新增</a>  
      </td>
   </tr>                
</table>

   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
          <fieldset style="margin:5px;"> 
           <legend>
              <asp:Label ID="UserTitle" runat="server" Text="通行证管理" /><br />
           </legend>
              <asp:GridView ID="GridView1" runat="server" allowPaging="True" 
                    autoGenerateColumns="False" DataKeyNames="UserID" DataSourceID="ObjectDataSource1" OnRowDataBound="GridView1_RowDataBound"
                    Width="100%" RowStyle-HorizontalAlign="Center" PageSize="12" CssClass="adminlist" EnableViewState="false">
                    <Columns>
                           <asp:TemplateField>
                            <ItemTemplate>                                        
                                <asp:CheckBox ID="chkSelect" runat="server"/>                                         
                            </ItemTemplate>
                            <HeaderTemplate>
                               <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />                                     
                            </HeaderTemplate>
                               <ItemStyle HorizontalAlign="Left" Width="25px" />
                           </asp:TemplateField>                                                                 
                           <asp:BoundField DataField="UserID" HeaderText="会员编号" InsertVisible="False" ReadOnly="True"
                               SortExpression="UserID"/>
                           <asp:TemplateField HeaderText="会员组">
                              <ItemTemplate>
                                 <asp:Label ID="GroupName" runat="server" Text='<%# Bind("GroupID") %>' />
                              </ItemTemplate>
                           </asp:TemplateField> 
                           <asp:BoundField DataField="UserName" HeaderText="会员名" SortExpression="UserName"/>                                      
                           <asp:BoundField DataField="RegTime" HeaderText="注册时间" SortExpression="RegTime"/>                                      
                           <asp:BoundField DataField="LastLoginTime" HeaderText="最后登录时间" SortExpression="LastLoginTime"/>                                      
                           <asp:BoundField DataField="LastLoginIP" HeaderText="最后登录IP" SortExpression="LastLoginIP"/>                                       
                           <asp:BoundField DataField="LoginTimes" HeaderText="登录次数" SortExpression="LoginTimes"/>                                       
                           <asp:BoundField DataField="GoldCoin" HeaderText="通行币" SortExpression="GoldCoin"/> 
                           <asp:TemplateField HeaderText="状态">
                              <ItemTemplate>
                                 <asp:Label ID="labelIsLocked" runat="server" Text='<%#Bind("IsLocked") %>' />
                              </ItemTemplate>
                           </asp:TemplateField>
                           <asp:TemplateField HeaderText="操作">
                              <ItemTemplate>
                                 <a href="javascript:void(0)" id="UpdateUser" runat="server">修改</a>|<a href="javascript:void(0)" id="Detail" runat="server">查看</a>| 
                                 <asp:HiddenField ID="HiddenUserID" runat="server" Value='<%# Eval("UserID") %>' />
                                 <asp:LinkButton id="btnDelete" runat="server" OnClientClick ="return confirm('确定要删除此用户吗?')" CommandName="Delete" Text="删除"/>               
                              </ItemTemplate>
                           </asp:TemplateField>       
                       </Columns> 
                       <RowStyle HorizontalAlign="Center" />
                       <EmptyDataTemplate>没有你所查找的记录</EmptyDataTemplate>
              </asp:GridView>               
            </fieldset>
          </ContentTemplate> 
           <Triggers>                           
               <asp:AsyncPostBackTrigger ControlID="SelectUserType"  />
               <asp:AsyncPostBackTrigger ControlID="SearchButton"/>
           </Triggers>
         
       </asp:UpdatePanel>
       <div style="text-align:center">                  
          <asp:Button ID="Button2" 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:UpdateProgress ID="UpdateProgress1" runat="server">
   <ProgressTemplate>
       <div class="wait">
         <img src="../Images/wait.gif" align="middle" alt="稍等"/>请稍等...
        </div>
     </ProgressTemplate>
</asp:UpdateProgress>
<!--数据控件-->
 <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
      SelectMethod="SearchUser" TypeName="UserBLL"  OnDataBinding="ObjectDataSource1_DataBinding" OnSelecting="ObjectDataSource1_Selecting" >
                <DeleteParameters>
                    <asp:Parameter Name="UserID" Type="Int32" />
                </DeleteParameters>                        
     <SelectParameters>
         <asp:ControlParameter ControlID="SearchUserTextBox" DefaultValue="" Name="UserName"  PropertyName="Text" Type="String" />
         <asp:Parameter Name="SearchType" Type="String"   DefaultValue="QuickSearch"/>
         <asp:ControlParameter ControlID="DDL_SearchType" Name="DetailSearchType" PropertyName="SelectedValue"
             Type="Int32" />
         <asp:ControlParameter ControlID="SelectUserType" Name="QuickSearchValue" PropertyName="SelectedValue"
             Type="String" />
     </SelectParameters>
</asp:ObjectDataSource>           
</asp:Content>


