<%@ Register TagPrefix="uc1" TagName="AdminTabs" Src="AdminTabs.ascx" %>
<%@ Register TagPrefix="TimeTracker" TagName="Banner" Src="Banner.ascx" %>
<%@ Page language="vb" Codebehind="ProjectDetails.aspx.vb" AutoEventWireup="false" Inherits="ASPNET.StarterKit.TimeTracker.Web.ProjectDetails" %>
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>Project Details</title>
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="styles.css" type="text/css" rel="stylesheet">
		<script language="javascript" src="script.js"></script>
	</HEAD>
	<body>
		<form id="ProjectDetails" method="post" runat="server">
			<table cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td vAlign="top" background="images/bars.gif" height="46"><timetracker:banner id="Banner1" runat="server"></timetracker: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">
						<table class="admin-tan-border" cellSpacing="20" cellPadding="0" width="600" border="0">
							<tr height="10">
								<td vAlign="top">
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td class="header-gray">專案組態設定</td>
											<td align="right">
												<asp:button id="SaveButton" runat="server" width="53px" CssClass="standard-text" Text="儲存"></asp:button>
												&nbsp;&nbsp;
												<asp:button id="CancelButton" runat="server" width="53" causesvalidation="False" CssClass="standard-text" Text="取消"></asp:button>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												<asp:button id="DeleteButton" runat="server" Text="刪除" CssClass="standard-text" causesvalidation="False"></asp:button>
											</td>
										</tr>
										<tr>
											<td colSpan="2">
												<asp:label id="ErrorMessage" runat="server" CssClass="standard-text" ForeColor="Red" enableviewstate="False"></asp:label>
												<hr>
												設定專案並指定相關人員。然後增加專案的類別在特定的產品區域。按下<b>儲存</b>按鈕， 儲存相關設定。
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr height="*">
								<td vAlign="top">
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td class="header-lightgray" width="240">專案資訊
											</td>
											<td width="*"><img height="1" src="images/spacer.gif" width="240"></td>
											<td class="header-lightgray" width="240">指定專案成員
											</td>
										</tr>
										<tr>
											<td colSpan="3"><img height="11" src="images/spacer.gif" width="1"></td>
										</tr>
										<tr height="*">
											<td vAlign="top">
												<table cellSpacing="0" cellPadding="0" width="204" border="0">
													<tr>
														<td>專案名稱<br>
															<asp:textbox id="ProjectName" runat="server" cssclass="standard-text" width="194px" MaxLength="50"></asp:textbox></td>
													</tr>
													<tr>
														<td><asp:requiredfieldvalidator id="ProjectNameRequiredfieldvalidator" runat="server" display="Dynamic" ControlToValidate="ProjectName" ErrorMessage="必須填入專案名稱。"></asp:requiredfieldvalidator></td>
													</tr>
													<tr>
														<td><img height="11" src="images/spacer.gif" width="1"></td>
													</tr>
													<tr>
														<td>專案管理員<br>
															<asp:dropdownlist id="Managers" runat="server" cssclass="standard-text" width="193px"></asp:dropdownlist></td>
													</tr>
													<tr>
														<td><asp:requiredfieldvalidator id="ManagerRequiredFieldValidator" runat="server" display="Dynamic" ControlToValidate="Managers" ErrorMessage="您必須選擇管理員。"></asp:requiredfieldvalidator></td>
													</tr>
													<tr>
														<td><img height="11" src="images/spacer.gif" width="1"></td>
													</tr>
													<tr>
														<td><img height="11" src="images/spacer.gif" width="1"></td>
													</tr>
													<tr>
														<td>
															<table cellSpacing="0" cellPadding="0" width="100%" border="0">
																<tr>
																	<td>預計完成日</td>
																	<td>預計區間</td>
																</tr>
																<tr>
																	<td><asp:textbox id="CompletionDate" runat="server" cssclass="standard-text" width="76px" columns="12"></asp:textbox><a href="javascript:OpenCalendar('CompletionDate', true)"><img src="images/icon-calendar.gif" border="0"></a>
																	</td>
																	<td><asp:textbox id="Duration" runat="server" cssclass="standard-text" Width="49px" columns="12"></asp:textbox>hrs
																	</td>
																</tr>
															</table>
														</td>
													</tr>
													<tr>
														<td><asp:comparevalidator id="CompletionDateCompareValidator" runat="server" display="Dynamic" ErrorMessage="日期格式錯誤。" operator="DataTypeCheck" type="Date" controltovalidate="CompletionDate"></asp:comparevalidator><asp:requiredfieldvalidator id="CompletionDateRequiredFieldValidator" runat="server" ControlToValidate="CompletionDate" ErrorMessage="必須填入預計完成日。" Display="Dynamic"></asp:requiredfieldvalidator><asp:comparevalidator id="DurationCompareValidator" runat="server" ControlToValidate="Duration" ErrorMessage="區間必須是數字。" Display="Dynamic" Operator="DataTypeCheck" Type="Integer"></asp:comparevalidator><asp:requiredfieldvalidator id="DurationRequiredFieldValidator" runat="server" ControlToValidate="Duration" ErrorMessage="必須填入區間。" Display="Dynamic"></asp:requiredfieldvalidator>
															<asp:rangevalidator id="RangeValidator1" runat="server" ErrorMessage="區間超出範圍" ControlToValidate="Duration" MaximumValue="99999" MinimumValue="0" Type="Integer"></asp:rangevalidator></td>
													</tr>
													<tr>
														<td><img height="11" src="images/spacer.gif" width="1"></td>
													</tr>
													<tr>
														<td><img height="11" src="images/spacer.gif" width="1"></td>
													</tr>
												</table>
											</td>
											<td vAlign="top">描述<br>
												<asp:textbox id="Description" runat="server" cssclass="standard-text" TextMode="MultiLine" Height="116px" Width="204px" columns="20" rows="8"></asp:textbox></td>
											<td vAlign="top" noWrap>專案成員 (CTRL+左鍵 複選)<br>
												<asp:listbox id="Members" runat="server" cssclass="standard-text" Height="122px" Width="220px" DataValueField="UserID" DataTextField="UserName" SelectionMode="Multiple" rows="9"></asp:listbox></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td vAlign="top">
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td class="header-lightgray" colSpan="3">定義專案管理類別
											</td>
										</tr>
										<tr>
											<td colSpan="3"><img height="11" src="images/spacer.gif" width="1"></td>
										</tr>
										<tr>
											<td colSpan="3">
												您可以使用下列兩種方式，新增類別<br>
												一.按下<b>新增</b>定義名稱，縮寫(最多4個字)，時間和區間， 變更下列的類別。<br>
												二.按下<b>複製</b>類別，可以從其他專案中複製已存在的類別。
											</td>
										</tr>
										<tr>
											<td colSpan="3"><img height="11" src="images/spacer.gif" width="1"></td>
										</tr>
										<tr>
											<td width="410">
												<table cellSpacing="0" cellPadding="0" width="100%" border="0">
													<tr>
														<td>名稱</td>
														<td>縮寫</td>
														<td>區間(hrs)</td>
														<td>&nbsp;</td>
													</tr>
													<tr>
														<td vAlign="top"><asp:textbox id="CategoryName" runat="server" cssclass="standard-text" width="166px" enableviewstate="False" MaxLength="50"></asp:textbox></td>
														<td vAlign="top"><asp:textbox id="Abbrev" runat="server" cssclass="standard-text" width="70px" enableviewstate="False"></asp:textbox></td>
														<td vAlign="top"><asp:textbox id="CatDuration" runat="server" cssclass="standard-text" width="70px" enableviewstate="False"></asp:textbox></td>
														<td vAlign="top" align="right"><asp:button id="AddButton" runat="server" width="46px" CssClass="standard-text" Text="新增"></asp:button></td>
													</tr>
													<tr>
														<td colspan="4">
															<asp:comparevalidator id="CatDurationValidator" runat="server" ControlToValidate="CatDuration" ErrorMessage="類別區間必須是數字。" Display="Dynamic" Operator="DataTypeCheck" Type="Integer"></asp:comparevalidator>
															<asp:customvalidator id="AbbrevCustomValidator" runat="server" ErrorMessage="類別縮寫重複。" display="Dynamic"></asp:customvalidator>
															<asp:rangevalidator id="RangeValidator2" runat="server" ErrorMessage="區間超出範圍。" ControlToValidate="CatDuration" MaximumValue="99999" MinimumValue="0" Type="Integer" display="Dynamic"></asp:rangevalidator>
															<asp:regularexpressionvalidator id="CategoryNameValidator" runat="server" ErrorMessage="類別名稱必須是英文字母或數字。" ControlToValidate="CategoryName" Display="Dynamic" ValidationExpression="[a-zA-Z0-9 ]*"></asp:regularexpressionvalidator>
															<asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" ErrorMessage="類別縮寫必須是英文字母或數字。" ControlToValidate="Abbrev" Display="Dynamic" ValidationExpression="[a-zA-Z0-9 ]*"></asp:regularexpressionvalidator>
														</td>
													</tr>
												</table>
											</td>
											<td class="header-gray" align="middle" width="100">&nbsp;或 &nbsp;</td>
											<td align="right" width="260">
												<table cellSpacing="0" cellPadding="0" width="100%" border="0">
													<tr>
														<td colSpan="2">從其他專案新增類別</td>
													</tr>
													<tr>
														<td><asp:dropdownlist id="Projects" runat="server" cssclass="standard-text" width="190px"></asp:dropdownlist></td>
														<td align="right"><asp:button id="CopyButton" runat="server" width="46" causesvalidation="False" CssClass="standard-text" Text="複製"></asp:button></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td colspan="3"><asp:regularexpressionvalidator id="RegularExpressionValidatorAbbrev" runat="server" ControlToValidate="Abbrev" ErrorMessage="縮寫必須介於 1-4 個字元長度。" Display="Dynamic" ValidationExpression="\S{1,4}"></asp:regularexpressionvalidator>
												<asp:label id="CategoryErrorMessage" runat="server" CssClass="standard-text" enableviewstate="False" ForeColor="Red"></asp:label></td>
										</tr>
										<tr>
											<td colSpan="3"><img height="11" src="images/spacer.gif" width="1"></td>
										</tr>
										<tr>
											<td>專案類別列表<br>
												<asp:datagrid id="CategoriesGrid" runat="server" Width="100%" BorderStyle="None" DataKeyField="CategoryID" OnUpdateCommand="CategoriesGrid_OnUpdate" OnCancelCommand="CategoriesGrid_OnCancel" OnDeleteCommand="CategoriesGrid_OnDelete" OnEditCommand="CategoriesGrid_OnEdit" CellPadding="2" AutoGenerateColumns="False" Font-Name="Verdana" AllowSorting="True" BorderColor="White" font-names="Verdana">
													<HeaderStyle Font-Bold="True" CssClass="grid-header"></HeaderStyle>
													<Columns>
														<asp:TemplateColumn SortExpression="Name" HeaderText="名稱">
															<HeaderStyle HorizontalAlign="Left" CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
															<ItemStyle CssClass="grid-first-item"></ItemStyle>
															<ItemTemplate>
																&nbsp;<%# DataBinder.Eval(Container, "DataItem.Name") %>
															</ItemTemplate>
															<EditItemTemplate>
																<asp:textbox id=EditName Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>' CssClass="Standard-text" MaxLength="50" AutoPostBack="false" Runat="server">
																</asp:textbox>
																<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="必須填入類別名稱" Display="Dynamic" ControlToValidate="EditName"></asp:RequiredFieldValidator>
															</EditItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn SortExpression="Abbrev" HeaderText="縮寫">
															<HeaderStyle HorizontalAlign="Left" Width="70px" CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
															<ItemStyle CssClass="grid-item"></ItemStyle>
															<ItemTemplate>
																&nbsp;<%# DataBinder.Eval(Container, "DataItem.Abbreviation") %>
															</ItemTemplate>
															<EditItemTemplate>
																<asp:textbox id="EditAbbreviation" Text='<%# DataBinder.Eval(Container, "DataItem.Abbreviation") %>' CssClass="Standard-text" width="70px" AutoPostBack="false" Runat="server">
																</asp:textbox>
																<asp:requiredfieldvalidator id="Requiredfieldvalidator4" runat="server" ErrorMessage="必須填入值" ControlToValidate="EditAbbreviation" display="Dynamic"></asp:requiredfieldvalidator>
																<asp:regularexpressionvalidator id="Regularexpressionvalidator3" runat="server" ErrorMessage="縮寫必須介於 1-4 個字元長度。" ControlToValidate="EditAbbreviation" Display="Dynamic" ValidationExpression="\S{1,4}"></asp:regularexpressionvalidator>
															</EditItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn SortExpression="Duration" HeaderText="區間(hrs)">
															<HeaderStyle Wrap="False" HorizontalAlign="Right" Width="100px" CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
															<ItemStyle HorizontalAlign="Right" CssClass="grid-item"></ItemStyle>
															<ItemTemplate>
																&nbsp;<%# DataBinder.Eval(Container, "DataItem.EstDuration") %>
															</ItemTemplate>
															<EditItemTemplate>
																<asp:textbox id=EditDuration Text='<%# DataBinder.Eval(Container, "DataItem.EstDuration") %>' CssClass="Standard-text" width="70px" AutoPostBack="false" Runat="server">
																</asp:textbox>
																<asp:requiredfieldvalidator id="Requiredfieldvalidator5" runat="server" ErrorMessage="必須填入值。" ControlToValidate="EditDuration" display="Dynamic"></asp:requiredfieldvalidator>
																<asp:CompareValidator id="CompareValidator1" runat="server" ErrorMessage="時數必須為數字" ControlToValidate="EditDuration" Display="Dynamic" Type="Integer" Operator="DataTypeCheck"></asp:CompareValidator>
															</EditItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="編輯">
															<HeaderStyle HorizontalAlign="Left" Width="50px" CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" CssClass="grid-edit-column"></ItemStyle>
															<ItemTemplate>
																<asp:imagebutton runat="server" ImageUrl="images/icon-pencil.gif" CommandName="Edit" CausesValidation="false" ID="EditButton"></asp:imagebutton>
																<img src="images/spacer.gif" width="3">
																<asp:imagebutton Runat="server" ImageUrl="images/icon-delete.gif" CommandName="Delete" CausesValidation="False" ID="CatDeleteButton"></asp:imagebutton>
															</ItemTemplate>
															<EditItemTemplate>
																<asp:imagebutton runat="server" ImageUrl="images/icon-floppy.gif" CommandName="Update" CausesValidation="True" ID="UpdateButton"></asp:imagebutton>
																<img src="images/spacer.gif" width="3">
																<asp:imagebutton runat="server" ImageUrl="images/icon-pencil-x.gif" CommandName="Cancel" CausesValidation="false" ID="CatCancelButton"></asp:imagebutton>
															</EditItemTemplate>
														</asp:TemplateColumn>
													</Columns>
												</asp:datagrid>
												<asp:customvalidator id="ProjectsGridCustomValidator" runat="server" display="Dynamic" ErrorMessage="專案至少需要一個類別。" enableviewstate="False"></asp:customvalidator>
											</td>
											<td>&nbsp;</td>
											<td>&nbsp;</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr height="10">
								<td vAlign="top">
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td>
												<hr>
											</td>
										</tr>
										<tr>
											<td align="right">
												<asp:button id="SaveButton2" runat="server" width="53px" CssClass="standard-text" Text="儲存"></asp:button>
												&nbsp;&nbsp;
												<asp:button id="CancelButton2" runat="server" width="53" causesvalidation="False" CssClass="standard-text" Text="取消"></asp:button>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												<asp:button id="DeleteButton2" runat="server" Text="刪除" CssClass="standard-text" causesvalidation="False"></asp:button>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
					<td width="11"><img height="11" src="images/spacer.gif" width="11"></td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
