<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Administrator, HoWaveVGO" title="管理员管理" enableEventValidation="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>
 <table class="adminheading">
   <tr>
      <th  class="user" align="left">管理员管理</th>   
      <td align="right">
          <div style="width:500px; text-align:right">
             <a href="Admin_AdminGroup.aspx">权限组管理</a>&nbsp;|&nbsp;
             <asp:LinkButton ID="LinkButton3" runat="server" PostBackUrl="Admin_AddAdmin.aspx">新增管理员</asp:LinkButton>
          </div>
      </td>                    
   </tr>
</table>

                           
                         <asp:UpdatePanel ID="UpdatePanel2" runat="server" >
                               <ContentTemplate>
                                   <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllAdmin" TypeName="AdminBLL" DeleteMethod="DeleteAdmin">
                                       <DeleteParameters>
                                           <asp:Parameter Name="Admin_ID" Type="Int32" />
                                       </DeleteParameters>
                                   </asp:ObjectDataSource>
                                        <asp:GridView ID="GridView1" CssClass="adminlist" runat="server" Width="100%" AutoGenerateColumns="False" DataKeyNames="Admin_ID" OnRowDataBound="GridView1_RowDataBound" DataSourceID="ObjectDataSource1"  EnableViewState="false">
                                            <Columns>
                                                <asp:BoundField DataField="Admin_ID" HeaderText="管理员ID" InsertVisible="False" ReadOnly="True"
                                                    SortExpression="Admin_ID"/>                               
                                                     <asp:BoundField DataField="UserName" HeaderText="管理员名" SortExpression="UserName"/>                              
                                                    <asp:TemplateField  HeaderText="类型">
<ItemTemplate>
<asp:Literal ID="type" Text='<%# (Convert.ToInt32(Eval("Access"))==1)?"超级管理员":"普通管理员" %>' runat="server" />
 </ItemTemplate>
 <HeaderStyle   />
 </asp:TemplateField>   
  <asp:TemplateField  HeaderText="类型">
<ItemTemplate>
<asp:Literal ID="Disable" Text='<%# (Convert.ToInt32(Eval("Disable"))==1)?"禁用":"启用" %>' runat="server" />
 </ItemTemplate>
 <HeaderStyle   />
 </asp:TemplateField>   
  <asp:BoundField DataField="EndDate" HeaderText="结束日期" 　/>                                
                                                     <asp:BoundField DataField="LoginTimes" HeaderText="登录次数" SortExpression="LoginTimes"/>                                
                                                     <asp:BoundField DataField="LastLogin" HeaderText="最后登录时间" SortExpression="LastLogin"/>                               
                                                     <asp:BoundField DataField="LastLoginIP" HeaderText="最后登录IP" SortExpression="LastLoginIP"/>                               
                                                     <asp:BoundField DataField="AcceptIP" HeaderText="允许登录IP" SortExpression="AcceptIP"/>                                                      
                                                     <asp:HyperLinkField DataTextField="Admin_ID" HeaderText="操作" DataNavigateUrlFields="Admin_ID" 
                                                         DataNavigateUrlFormatString="Admin_AddAdmin.aspx?AdminID={0}"  DataTextFormatString="修改" />
                                                     <asp:TemplateField HeaderText="删除">                                             
                                                        <ItemTemplate>                                                
                                                           <asp:LinkButton id="btnDelete" runat="server" OnClientClick ="return confirm('您真的要删除?')" CommandName='<%# Eval("Admin_ID") %>' Text="删除" OnCommand="DeleteAdmin"/> 
                                                       </ItemTemplate> 
                                                     </asp:TemplateField>  
                                             </Columns>
                       <EmptyDataTemplate>
                       <tr>
				         <th scope="col">管理员ID</th><th scope="col">管理员名</th><th scope="col">类型</th><th scope="col">类型</th><th scope="col">结束日期</th><th scope="col">登录次数</th><th scope="col">最后登录时间</th><th scope="col">最后登录IP</th><th scope="col">允许登录IP</th><th scope="col">操作</th><th scope="col">删除</th>
			           </tr>
			           <tr>
			             <td colspan="11">暂无记录</td>
			           </tr>
                       </EmptyDataTemplate>
                                     <RowStyle HorizontalAlign="Center" />
                                 </asp:GridView>
                             </ContentTemplate>
                         </asp:UpdatePanel>
                                 
                    
    &nbsp;&nbsp;
      
</asp:Content>

