<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_Administrator, mallz" title="管理员管理" enableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" CssClass="adminlist" runat="server" AutoGenerateColumns="False" DataKeyNames="Admin_ID" OnRowDataBound="GridView1_RowDataBound"  EnableViewState="false">
       <Columns>
            <asp:BoundField DataField="Admin_ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" HeaderStyle-Width="4%" />                               
            <asp:BoundField DataField="UserName" HeaderText="管理员名"/>                              
            <asp:TemplateField  HeaderText="类型" HeaderStyle-Width="10%">
                <ItemTemplate>
                    <asp:Literal ID="type" Text='<%# (Convert.ToInt32(Eval("Access"))==1)?"超级管理员":"普通管理员" %>' runat="server" />
                </ItemTemplate>
            </asp:TemplateField>   
            <asp:TemplateField  HeaderText="状态" HeaderStyle-Width="8%">
                <ItemTemplate>
                    <asp:Literal ID="Disable" Text='<%# (Convert.ToInt32(Eval("Disable"))==1)?"禁用":"启用" %>' runat="server" />
                </ItemTemplate>
            </asp:TemplateField>   
            <asp:BoundField DataField="EndDate" HeaderText="结束日期" HeaderStyle-Width="15%"/>                                
            <asp:BoundField DataField="LoginTimes" HeaderText="登录次数" HeaderStyle-Width="8%" />                                
            <asp:BoundField DataField="LastLogin" HeaderText="最后登录时间" HeaderStyle-Width="15%"/>                               
            <asp:BoundField DataField="LastLoginIP" HeaderText="最后登录IP" HeaderStyle-Width="12%" />                                            
            <asp:TemplateField HeaderText="操作" HeaderStyle-Width="10%">
                <ItemTemplate>
                    <asp:HyperLink ID="modifybtn" NavigateUrl='<%#"Admin_AddAdmin.aspx?AdminID="+Eval("Admin_ID")%>' runat="server" Text="修改" />  
                    <asp:LinkButton id="btnDelete" runat="server" OnClientClick ="return confirm('您真的要删除?')" CommandName='<%# Eval("Admin_ID") %>' Text="删除" OnCommand="DeleteAdmin"/> 
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
             <div>暂无记录</div>
        </EmptyDataTemplate>
 </asp:GridView>
</asp:Content>

