<%@ Page language="c#" Codebehind="UserList.aspx.cs" AutoEventWireup="false" Inherits="ASPNET.StarterKit.TimeTracker.Web.UserList" %>
<%@ Register TagPrefix="uc1" TagName="AdminTabs" Src="AdminTabs.ascx" %>
<%@ Register TagPrefix="TimeTrack" TagName="Banner" Src="Banner.ascx" %>
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>用户列表</title>
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="styles.css" type="text/css" rel="stylesheet">
	</HEAD>
	<body>
		<form id="UserList" method="post" runat="server">
			<table cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td vAlign="top" background="images/bars.gif" height="46"><timetrack:banner id="Banner1" runat="server"></timetrack:banner></td>
				</tr>
				<tr>
					<td class="tab-active" vAlign="top" height="15"><img height="15" src="images/spacer.gif" width="15"></td>
				</tr>
			</table>
			<table cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td width="8"><img height="8" src="images/spacer.gif" width="8"></td>
					<td vAlign="top">
						<uc1:admintabs id="AdminTabs1" runat="server"></uc1:admintabs>
						<table class="admin-tan-border" height="530" cellSpacing="20" cellPadding="0" width="100%"
							border="0">
							<tr>
								<td height="20"><asp:button id="NewUserButton" runat="server" CssClass="standard-text" Text="创建新用户"></asp:button></td>
							</tr>
							<tr vAlign="top">
								<td>
									<asp:datagrid id="Users" runat="server" BorderStyle="None" Width="100%" CellPadding="2" AutoGenerateColumns="False"
										AllowSorting="True" BorderColor="White" AllowPaging="True">
										<headerstyle font-bold="True" cssclass="grid-header"></headerstyle>
										<columns>
											<asp:templatecolumn HeaderText="名称 (点击名称进行修改)" SortExpression="Name">
												<headerstyle horizontalalign="Left" width="80%" cssclass="grid-header" verticalalign="Middle"></headerstyle>
												<itemstyle cssclass="grid-first-item"></itemstyle>
												<itemtemplate>
													&nbsp;<a title="Edit User" class="blacklineheight" href='UserDetail.aspx?UserName=<%# DataBinder.Eval(Container, "DataItem.UserName") %>&index=2'><%# DataBinder.Eval(Container, "DataItem.Name") %>
													</a>
												</itemtemplate>
											</asp:templatecolumn>
											<asp:templatecolumn HeaderText="角色" SortExpression="RoleName">
												<headerstyle horizontalalign="Left" width="20%" cssclass="grid-header" verticalalign="Middle"></headerstyle>
												<itemstyle cssclass="grid-item"></itemstyle>
												<itemtemplate>
													&nbsp;
													<asp:label ID="lblGridRoleName" Text='<%# DataBinder.Eval(Container, "DataItem.RoleName") %>' Runat="server" Visible="true" />
												</itemtemplate>
												<edititemtemplate>
													<asp:DropDownList Width="100px" ID="ddlRoles" CssClass="Standard-text" DataSource='<%# GetRoles() %>' DataTextField="Name" DataValueField="RoleID" Runat="server" />
												</edititemtemplate>
											</asp:templatecolumn>
											<asp:templatecolumn Visible="False" HeaderText="用户ID">
												<itemtemplate>
													&nbsp;
													<asp:label ID="lblGridUserID" Text='<%# DataBinder.Eval(Container, "DataItem.UserID") %>' Runat="server" Visible="true" />
												</itemtemplate>
											</asp:templatecolumn>
											<asp:templatecolumn Visible="False" HeaderText="用户名称">
												<itemtemplate>
													&nbsp;
													<asp:label ID="lblGridUserName" Text='<%# DataBinder.Eval(Container, "DataItem.UserName")  %>' Runat="server" Visible="true" />
												</itemtemplate>
											</asp:templatecolumn>
										</columns>
										<pagerstyle horizontalalign="Center"></pagerstyle>
									</asp:datagrid>
								</td>
							</tr>
							<tr vAlign="top">
								<td colSpan="3" height="12"><img height="1" src="images/spacer.gif" width="1"></td>
							</tr>
						</table>
					</td>
					<td width="11"><img height="11" src="images/spacer.gif" width="11"></td>
				</tr>
				<tr>
					<td vAlign="top" colSpan="5" height="15"><img height="15" src="images/spacer.gif" width="15"></td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
