<%@ Page language="c#" Codebehind="Specs.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.Specs" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
		<title>ProductField</title> 
		<!--#include file="../inc/head2.inc"-->
		<script type="text/javascript" src="../inc/commond.js"></script>
		<script type="text/javascript" src="../inc/SpecAdd.js"></script>
	</HEAD>
	<body>
		<div class="container">
			<div class="sub_container">
				<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height="9" width="8" 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">
						<% if(this.Request.QueryString["Action"] == "Manage"){%>
						<div class="frame">
							<div class="frame_title">规格管理 <a href='Specs.aspx?Action=Add'>添加规格</a></div>
							<div class="frame_content">
								<table class="tableBorder" cellSpacing="1" cellPadding="1" width="100%" align="center"
									border="0" id="Table2">
									<tr>
										<td class="forumRowHighlight">
											<asp:datagrid id="dgSpec" runat="server" Width="100%" HeaderStyle-CssClass="summary-title" HorizontalAlign="Left"
												DataKeyField="SpecID" AutoGenerateColumns="False" PagerStyle-Mode="NumericPages" AllowPaging="False">
												<HeaderStyle CssClass="summary-title"></HeaderStyle>
												<Columns>
													<asp:TemplateColumn HeaderText="规格名称">
														<HeaderStyle HorizontalAlign="Left" Width="80px"></HeaderStyle>
														<ItemStyle HorizontalAlign="Left" Width="80px"></ItemStyle>
														<ItemTemplate>
															<%# DataBinder.Eval(Container.DataItem, "SpecName") %>
														</ItemTemplate>
														<EditItemTemplate>
															<asp:TextBox ID="SpecName" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SpecName") %>' Width="80px">
															</asp:TextBox>
														</EditItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="预设值">
														<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
														<ItemStyle HorizontalAlign="Left"></ItemStyle>
														<ItemTemplate>
															<%# DataBinder.Eval(Container.DataItem, "SpecValue") %>
														</ItemTemplate>
														<EditItemTemplate>
															<asp:TextBox ID="SpecValue" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SpecValue") %>' TextMode="MultiLine" Width="240px">
															</asp:TextBox>
														</EditItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="管理">
														<HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
														<ItemTemplate>
															<a href='Specs.aspx?Action=Add&SpecID=<%# DataBinder.Eval(Container.DataItem, "SpecID") %>'>
																修改</a>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('真的要删除吗？')&quot;&gt;删除&lt;/div&gt;"
														HeaderText="删除" CommandName="Delete">
														<HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
													</asp:ButtonColumn>
												</Columns>
												<PagerStyle Mode="NumericPages"></PagerStyle>
											</asp:datagrid></td>
									</tr>
								</table>
							</div>
						</div>
						<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
						<div class="frame">
							<div class="frame_title">规格添加</div>
							<div class="frame_content">
								<table class="tableBorder" cellSpacing="0" cellPadding="0" width="50%" border="1">
									<tr>
										<td align="right" width="21%">规格名称：
										</td>
										<td style="padding:10px;">
											<asp:textbox id="txtSpecName" Width="150px" Runat="server"></asp:textbox><div style="display:none;"><asp:CheckBox ID="chkIsMain" runat="server" Text="主规格（用此规格来设置不同的商品，限一种）"></asp:CheckBox></div>
										</td>
									</tr>
									<tr>
										<td colspan="2" style="text-align:center;padding:10px;">
											<table cellSpacing="1" cellPadding="1" width="350" align="center" border="1" id="spec">
												<thead id="spec_head">
													<tr>
														<td>预设值</td>
														<td>操作</td>
													</tr>
												</thead>
												<tbody id="spec_body"></tbody>
											</table>
											<input type='button' id="btnAddFile" value='增加预设值' style="margin-top:10px;" class="inputbtn">
										</td>
									</tr>
								</table>
								<table class="tableBorder" cellSpacing="0" cellPadding="0" width="50%">
									<tr>
										<td height="30"></td>
									<tr>
										<td align="center" width="100%">
											<asp:button id="btnSubmit" OnClick="btnSubmit_Click" runat="server" Text="提交" CssClass="inputbtn"></asp:button><FONT face="宋体">&nbsp;</FONT>
											<asp:button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CssClass="inputbtn"></asp:button>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<%}%>
					</form>
				</div>
			</div>
		</div>
	</body>
</HTML>