



























































































































































































































































































<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Admin_Users" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
function SelectAll(tempControl)
{
var theBox=tempControl;
xState=theBox.checked;
elem=theBox.form.elements;
for(i=0;i<elem.length;i++)
{
if(elem[i].type=="checkbox" && elem[i].id!=theBox.id)
{
if(elem[i].checked!=xState)
{
elem[i].click();
}
}
}
}
function ChangeColor(a,b)
{
var theBox=a;
var tr=document.getElementById(b);
if (theBox.checked)
{
tr.style.backgroundColor="red";
}
else
tr.style.backgroundColor="#cccccc"
}
</script>
<table border="0" cellpadding="0" cellspacing="0" style="width:600px; height: 182px">
<tr>
<td style="width: 622px">
欢迎<asp:Label ID="Label1" runat="server" Width="33px"></asp:Label>登陆</td>
</tr>
<tr>
<td style="text-align: right; width: 622px; height: 156px;" >
<asp:GridView ID="GridView1" runat="server" Height="100%" Width="100%" AutoGenerateColumns="False" DataKeyNames="UserID" OnRowDataBound="GridView1_RowDataBound" OnRowDeleting="GridView1_RowDeleting" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" HorizontalAlign="Center" >
<Columns>
<asp:BoundField DataField="UserID" HeaderText="ID" >
<ControlStyle Width="20px" />
</asp:BoundField>
<asp:TemplateField HeaderText="用户名">
<ItemTemplate>
<%#Eval("username") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="UserName" runat="server" Text='<%#Eval("username") %>' Width="100px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="密码">
<ItemTemplate>
<%#Eval("UserPwd") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="UserPwd" runat="server" Text='<%#Eval("UserPwd") %>' Width="100px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="RegisterDate" HeaderText="添加日期" >
<ControlStyle Width="100px" />
</asp:BoundField>
<asp:TemplateField HeaderText="权限">
<ItemTemplate>
<%#Eval("Grade") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="Grade" runat="server" Text='<%#Eval("Grade") %>' Width="30px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" />
<asp:CommandField ShowDeleteButton="True" />
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="CheckBox2" runat="server" onclick="javascript:SelectAll(this);"/>
</HeaderTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
<asp:Label ID="Label2" runat="server" Width="150px"></asp:Label>
<asp:Label ID="Label3" runat="server" Width="71px"></asp:Label>
<asp:Label ID="Label4" runat="server" Width="77px"></asp:Label>
<asp:Button
ID="Button1" runat="server" Text="删除" Width="45px" OnClick="Button1_Click" CausesValidation="False" /></td>
</tr>
<tr>
<td style="height: 160px; width: 622px;" >
<br />
<table border="1" cellpadding="0" cellspacing="0" style="width: 317px; height: 136px">
<tr>
<td colspan="2" style="background-color: #c9c9c9; height: 26px;">
添加管理员</td>
</tr>
<tr>
<td style="width: 100px; text-align: right; height: 47px;">
管理员:</td>
<td style="text-align: left; width: 213px; height: 47px;" >
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="**"></asp:RequiredFieldValidator><br />
<asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="用户名已存在!" Font-Size="12px" OnServerValidate="CustomValidator1_ServerValidate"
Width="84px"></asp:CustomValidator></td>
</tr>
<tr>
<td style="text-align: right; height: 47px;" >
密 码:</td>
<td style="text-align: left; width: 213px; height: 47px;" >
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2"
ErrorMessage="**"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="height: 46px; text-align: right" >
权 限:</td>
<td style="width: 213px; height: 46px; text-align: left" >
<asp:RadioButtonList ID="RadioButtonList1" runat="server" Font-Size="Smaller" RepeatDirection="Horizontal"
TextAlign="Left" Width="189px">
<asp:ListItem Value="0" Selected>一般管理员</asp:ListItem>
<asp:ListItem Value="1">超级管理员</asp:ListItem>
</asp:RadioButtonList></td>
</tr>
<tr>
<td colspan="2" style="height: 36px">
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="添加" Width="45px" /></td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Content>