<%@ Page language="c#" Codebehind="Template.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.Admin.Template" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>Template</title>
		<LINK href="inc/style.css" type="text/css" rel="stylesheet">
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
<table width="100%" height="550" style="border:1px #619ADF solid; border-left:0;margin-top:6px; margin-right:7px;background:#F2F7FD;" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
<div class="top">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><span class="tt">系统管理 &gt;&gt; <asp:label id="lblAction" runat="server"></asp:label></span></td>
		<td class="tm2"><span class="tt"><a href="http://www.wangqi.com" target="_blank"><img src="Images/admin_help.gif" border="0" alt="帮助"></a></span></td>
		<td class="tr"></td>
	</tr>
</table>
</div>
<div class="mframe">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><div class="tt">&nbsp; 添加模板</div></td>
		<td class="tr"></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="ml"></td>
    <td  class="mm" align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#EBF3FE" valign="top" style=" border-right:1px #77ABE5 solid;">
<table width="90%"  cellspacing="0" cellpadding="0">
	<tr>
		<td class="ml1"></td>
		<td class="mm1">
			<% if(this.Request.QueryString["Action"] == "Manage"){%>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" 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="640" 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" CssClass="input" runat="server"></asp:textbox> <asp:button id="btnGetTemInfo" runat="server" CssClass="btn1" 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" CssClass="input" runat="server"></asp:textbox>
										</TD>
								</TR>
                                <TR>
									<TD vAlign="top" align="left">模板缩图：
									</TD>
									<TD vAlign="top" width="180px"><img src="../Template/<%=config.TemplateFolder%>/template.jpg"><br><asp:Label id="lblDescription" runat="server"></asp:Label></TD>
									<TD vAlign="top" align="left"></TD>
								</TR>
								<TR style="display:none;">
									<TD vAlign="top" align="left">模板缩图：
									</TD>
									<TD vAlign="top" width="180px">
										<asp:image id="imgTemplateImage" CssClass="input" runat="server" Width="150"></asp:image></TD>
									<TD></TD>
								</TR>
								<TR>
									<TD align="center" colSpan="3"><BR>
										<asp:button id="btnSave" CssClass="btn" runat="server" Text="保存"></asp:button>&nbsp;&nbsp;
										<asp:button id="btnCancel" runat="server" CssClass="btn" CausesValidation="False" Text="取消"></asp:button></TD>
								</TR>
							</TABLE>
						</div>
					</td>
				</tr>
			</table>
			<%}%>
		</td>
		<td class="mr1"></td>
	</tr>
</table>
</td>
  </tr>
</table>


<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>
</td>
    <td  class="mr"></td>
  </tr>
</table>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>

</div>
    </td>
  </tr>
</table>
		</form>
	</body>
</HTML>
