<%@ Page language="c#" Codebehind="Template.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.Admin.Template" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
	    <!--#include file="inc/head.inc"-->
		<title>Template</title>
	</HEAD>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="../default.aspx" target="_blank">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />
		    <% if(this.Request.QueryString["Action"] == "Manage"){%>管理模板<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>添加模板<%}%>
		</div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:label id="lblAction" runat="server" CssClass="tableHeaderText"></asp:label></div>
		        <div class="frame_content">
		            <% if(this.Request.QueryString["Action"] == "Manage"){%>
		            <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
			            <tr>
				            <td class="forumRowHighlight" height="23"><asp:datagrid id="dgTemplate" runat="server" HeaderStyle-CssClass="summary-title" HorizontalAlign="Center"
						            Width="100%" DataKeyField="TemplateID" AutoGenerateColumns="False" PagerStyle-Mode="NumericPages" AllowPaging="False">
						            <HeaderStyle Font-Bold="True"></HeaderStyle>
						            <Columns>
							            <asp:TemplateColumn HeaderText="序号">
								            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Left" Width="30px"></ItemStyle>
								            <ItemTemplate>
									            <%# DataBinder.Eval(Container.DataItem, "TemplateID") %>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="文件夹名称">
								            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Center" Width="100px"></ItemStyle>
								            <ItemTemplate>
									            <%# DataBinder.Eval(Container.DataItem, "Folder") %>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="模板名称">
								            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Center"></ItemStyle>
								            <ItemTemplate>
									            <%# DataBinder.Eval(Container.DataItem, "Name") %>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:TemplateColumn HeaderText="是否当前模板">
								            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Center" Width="80px"></ItemStyle>
								            <ItemTemplate>
									            <%# IsCurrentTemplate(DataBinder.Eval(Container.DataItem, "Folder").ToString()) %>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:ButtonColumn ButtonType="LinkButton" Visible="False" ItemStyle-Width="30px" Text="预览" CommandName="Preview"></asp:ButtonColumn>
							            <asp:ButtonColumn ButtonType="LinkButton" ItemStyle-Width="30px" Text="选择" CommandName="Choose"></asp:ButtonColumn>
							            <asp:TemplateColumn>
								            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								            <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								            <ItemTemplate>
									            <a href='Template.aspx?Action=Modify&TemplateID=<%# DataBinder.Eval(Container.DataItem, "TemplateID") %>'>
										            修改</a>
								            </ItemTemplate>
							            </asp:TemplateColumn>
							            <asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
								            CommandName="Delete">
								            <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
							            </asp:ButtonColumn>
						            </Columns>
						            <PagerStyle Mode="NumericPages"></PagerStyle>
					            </asp:datagrid></td>
			            </tr>
		            </table>
		            <%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
		            <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
			            <tr>
				            <td height="23">
					            <table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0"
						            valign="top">
						            <tr>
							            <td align="left" width="100">模板文件夹：
							            </td>
							            <td><asp:textbox id="txtFolder" runat="server"></asp:textbox><asp:button id="btnGetTemInfo" runat="server" Text="获取模板信息" CausesValidation="False"></asp:button></td>
						            </tr>
					            </table>
					            <div <%=IsTemplate%>>
						            <TABLE class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0"
							            valign="top">
							            <TR>
								            <TD vAlign="top" align="left" width="100">模板名称：
								            </TD>
								            <TD vAlign="top" colSpan="2">
									            <asp:textbox id="txtTName" runat="server"></asp:textbox>
									            </TD>
							            </TR>
							            <TR>
								            <TD vAlign="top" align="left">模板缩图：
								            </TD>
								            <TD vAlign="top" width="180px">
									            <asp:image id="imgTemplateImage" runat="server" Width="100"></asp:image></TD>
								            <TD vAlign="top" align="left">
									            <asp:Label id="lblDescription" runat="server"></asp:Label></TD>
							            </TR>
							            <TR>
								            <TD align="center" colSpan="3"><BR>
									            <asp:button id="btnSave" runat="server" Text="保存"></asp:button>
									            <asp:button id="btnCancel" runat="server" CausesValidation="False" Text="取消"></asp:button></TD>
							            </TR>
						            </TABLE>
					            </div>
				            </td>
			            </tr>
		            </table>
		            <%}%>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</HTML>
