<%@ Page language="vb" Codebehind="UserList.aspx.vb" 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>User List</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 SortExpression="Name" HeaderText="名稱 (按下名稱-編輯)">
												<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 SortExpression="RoleName" HeaderText="角色">
												<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="UserID">
												<ItemTemplate>
													&nbsp;
													<asp:label ID="lblGridUserID" Text='<%# DataBinder.Eval(Container, "DataItem.UserID") %>' Runat="server" Visible="true" />
												</ItemTemplate>
											</asp:TemplateColumn>
											<asp:TemplateColumn Visible="False" HeaderText="UserID">
												<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>
