<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page language="c#" Codebehind="ProductAdd_Step2.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.ProductAdd_Step2" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
	<HEAD>
		<title>ProductAdd</title> 
		<!--#include file="../inc/head2.inc"-->
		<script type="text/javascript" src="../inc/multi_popup.js"></script>
		<script type="text/javascript" src="../inc/jquery.easydrag.handler.beta2.js"></script>
		<script type="text/javascript" src="../inc/SearchGoods.js"></script>
		<script type="text/javascript" src="../inc/PageBar.js"></script>
		<script type="text/javascript">
			var cid="<%=product.ProductID==0 ? XpShop.Common.Utils.ReqStrParams("catid","0") : product.CategoryNo %>";
			var pid="<%=XpShop.Common.Utils.ReqStrParams("ProductID","0") %>";
			var propertes=<%=product.ProductID==0 ? "{}" : product.Properties%>;
			var specInfo = "<%=product.ProductID==0 ? "" : product.Spec%>";
			var skuMap=<%=product.ProductID==0 ? "{}" : product.SkuMap%>;
		</script>
		<link type="text/css" rel="stylesheet" href="../style/multi_popup.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="../style/cmxform.css" />
		<script src="../inc/spec.js" type="text/javascript"></script>
		<script src="../../inc/jquery.query.js" type="text/javascript"></script>
		<script src="../../inc/jquery.validate.js" type="text/javascript"></script>
		<script src="../../inc/jquery.metadata.js" type="text/javascript"></script>
		<script src="../../inc/jquery.form.js" type="text/javascript"></script>
		<script src="../../inc/messages_cn.js" type="text/javascript"></script>
		<script type="text/javascript" src="../inc/product_add2.js"></script>
		<style type="text/css">
		    .listresult{}
            .listresult th{width:150px; text-align:center;}
            .listresult td{width:150px; text-align:center;}
		</style>
	</HEAD>
	<body>
		<div id="JsContent" class="hide"></div>
		<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"><%--商品添加--%><asp:label id="lblTitleInfo" Runat="server" CssClass="tableHeaderText">商品添加</asp:label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%--<A href="../ProductAdd_excel.aspx">批量添加</A>--%></div>
            <div class="sub_container_tabs">
	            <div style="float:left;">
		            商品分类：<span id="catname"><%=XpShop.Common.Utils.ReqStrParams("name_string",catpath)%></span>
		            <input type="hidden" id="catpath" value="<%=Request.Form["catpath"]%>" /><input type="hidden" id="cid" name="cid" value="<%=Request.Form["cid"]%>">						
		            <input type="button" id="btnChangeCat" value="编辑分类" class="inputbtn" />
	            </div>
	            <div class="tabmenu">
		            <ul>
			            <li class="menuitem tabon">
			            全部信息</li>
			            <li class="menuitem tabout">
			            基本信息</li>
			            <li class="menuitem tabout">
			            商品属性</li>
			            <li class="menuitem tabout">
			            商品参数</li>
			            <li class="menuitem tabout">
			            商品图片</li>
			            <li class="menuitem tabout">
			            销售信息</li>	
			            <li class="menuitem tabout">
			            关联配件</li>
			            <li class="menuitem tabout">
			            详细描述</li>
			            <li class="menuitem tabout">
			            商品标签</li>
			            <li class="menuitem tabout">
			            SEO优化</li>
			            <li class="menuitem tabout">
			            相关商品</li>
			            <li class="menuitem tabout hide">
			            赠品</li>
		            </ul>
	            </div>
            </div>
            <form class="cmxform" id="form1" enctype="multipart/form-data" runat="server">
            <%if(product.ProductID==0){%>
            <input type="hidden" id="catid" name="catid" value="<%=XpShop.Common.Utils.ReqStrParams("catid","1")%> "/>
            <%}else{%>
            <input type="hidden" id="catid" name="catid" value="<%=product.CategoryNo%> "/>
            <%}%>
            <input type="hidden" name="paras" value=""/>
            <input type="hidden" name="sid" value="<%=product.ProductID==0 ? 0 : product.SupplierID%>"/>
            <input type="hidden" name="action"  id="action" value="<%=(product.ProductID==0 ? "add" : "update")%>"  />
            <div class="sub_container_content" id="container" style="position:relative;">
	            <div class="frame tab">
		            <div class="frame_title">基本信息</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
				            <tr>
					            <th class="tl"><em>*</em>商品名称：</th>
					            <td class="tr">
						            <asp:textbox id="txtName" style="width:400px;float:left;margin-right:10px;" runat="server" Text=""></asp:textbox><span class="input-remark">30个汉字（60个字符）内</span>
					            </td>
				            </tr>
				            <tr>
					            <th class="tl">副 标 题：</th>
					            <td class="tr"><asp:TextBox ID="txtSubName" width="400px" runat="server"></asp:TextBox><br/><span class="input-remark1">请填写商品特色、卖点等信息。 25个汉字（50个字符）内</span></td>
				            </tr>
				            <tr>
					            <th class="tl">商品编码：</th>
					            <td class="tr"><asp:textbox id="txtProductNo" runat="server" Width="150px"></asp:textbox>
						            <asp:CheckBox id="cbxAutoCreate" runat="server" Text="自动生成"></asp:CheckBox></td>
				            </tr>
				            <tr>
					            <th class="tl">商品品牌：</th>
					            <td class="tr">
						            <asp:DropDownList ID="ddlBrand" runat="server"></asp:DropDownList>
					            </td>
				            </tr>				            
				            <tr>
					            <th class="tl">售后服务：</th>
					            <td class="tr">
						            <FTB:FREETEXTBOX id="ftbAfterService" runat="Server" Width="100%" height="200" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
					                <br /><span class="input-remark1">最多允许输入500个汉字（1000个字符）内</span>
					            </td>
				            </tr>
				            <tr>
					            <th class="tl"><em>*</em>计量单位：</th>
					            <td class="tr"><asp:textbox id="txtUnit" runat="server" Text=""></asp:textbox></td>
				            </tr>
				            <tr>
					            <th class="tl"><em>*</em>单位重量：</th>
					            <td class="tr"><asp:textbox id="txtWeight" runat="server">1</asp:textbox>千克</td>
				            </tr>									
			            </table>
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">商品属性</div>
		            <div class="frame_content">
			            <asp:Label ID="lbProps" runat="server" Text=""></asp:Label>
		            </div>
	            </div>
            	
	            <div class="frame tab">
		            <div class="frame_title">商品参数</div>
		            <div class="frame_content">
			            <div id="para">
			            <asp:Label ID="lbParas" runat="server" Text=""></asp:Label>
			            </div>
		            </div>
	            </div>
            	
	            <div class="frame tab" style="zoom:1; position:relative;">
		            <div class="frame_title">商品图片</div>
		            <div class="frame_content">
			            <div class="pic-manager xp-clear">
				            <ul>
				            <%for(int i=1;i<7;i++){%>
					            <%if(dtPdtImg != null && dtPdtImg.Rows.Count>=i){%>
						            <%if(i==1){%>
						            <li class="first support">
						            <%}else if(i==6){%>
						            <li class="last support">
						            <%}else{%>
						            <li class="support">
						            <%}%>
						            <input class="picUrl" type="hidden" value="<%=XpShop.Common.Utils.Parse<string>(dtPdtImg.Rows[i-1]["img"],"")%>" name="picUrl" />
					            <%}else{%>
						            <%if(i==1){%>
						            <li class="first">
						            <%}else if(i==6){%>
						            <li class="last">
						            <%}else{%>
						            <li>
						            <%}%>
						            <input class="picUrl" type="hidden" value="" name="picUrl" />
					            <%}%>
						            <input type="hidden" value="0" name="isDel">
						            <%if(dtPdtImg != null && dtPdtImg.Rows.Count>=i){%>
						            <input type="hidden" value="<%=XpShop.Common.Utils.Parse<byte>(dtPdtImg.Rows[i-1]["sort"],1)%>" name="imgPos">
						            <div class="preview"><img src="<%=webSite%>Upload/ProductImg/<%=XpShop.Common.Utils.Parse<string>(dtPdtImg.Rows[i-1]["imgfolder"],"")%><%=XpShop.Common.Utils.Parse<string>(dtPdtImg.Rows[i-1]["img"],"")%>" /></div>
						            <%}else{%>
						            <input type="hidden" value="<%=i%>" name="imgPos">
						            <div class="preview"></div>
						            <%}%>
						            <div class="upload"><a href="javascript:;"><input class="upic" type="file" name="upic" /></a></div>
						            <div class="act"><span class="moveleft">左移</span><span class="moveright">右移</span><span class="del">删除</span></div>
					            </li>								
				            <%}%>
				            </ul>
			            </div>
			            <hr/>
			            <span class="input-remark1">图片大小请限定在120k(建议800px*800px)以内，jpg或gif格式（不支持中文档名）</span>
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">销售信息</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
			                <tr>
					            <th class="tl"><em>*</em>市场价格：</th>
					            <td class="tr"><asp:textbox id="txtMarketPrice" runat="server"></asp:textbox></td>
				            </tr>
				            <tr>
					            <th class="tl"><em>*</em>会员价格：</th>
					            <td class="tr"><asp:textbox id="txtMemberPrice" runat="server"></asp:textbox></td>
				            </tr>
				            <%if(dtProp1 != null && dtProp1.Rows.Count>0){%>
			                <tr>
				                <th class="tl"><input type="hidden" id="spec1" name="spec1" value="<%=dtProp1.Rows[0]["pname"]%>" /><%=dtProp1.Rows[0]["pname"]%>：</th>
				                <td class="tr">
					                <%for(int i=0;i<dtProp1.Rows.Count;i++){%>
						                <input type="checkbox" class="spec1 checkbox" id="prop_<%=dtProp1.Rows[i]["pid"]%>_<%=dtProp1.Rows[i]["vid"]%>" value="<%=dtProp1.Rows[i]["pid"]%>:<%=dtProp1.Rows[i]["vid"]%>" imageurl="" viewimageurl="" name="cp_<%=dtProp1.Rows[i]["pid"]%>">
						                <label title="<%=dtProp1.Rows[i]["vname"]%>" colorname="" for="prop_<%=dtProp1.Rows[i]["pid"]%>_<%=dtProp1.Rows[i]["vid"]%>"><%=dtProp1.Rows[i]["vname"]%></label>
					                <%}%>
				                <td>
			                </tr>
			                <%}%>
			                <%if(dtProp2 != null && dtProp2.Rows.Count>0){%>
			                <tr>
				                <th class="tl"><input type="hidden" id="spec2" name="spec2" value="<%=dtProp2.Rows[0]["pname"]%>" /><%=dtProp2.Rows[0]["pname"]%>：</th>
				                <td class="tr">
					                <%for(int i=0;i<dtProp2.Rows.Count;i++){%>
						                <input type="checkbox" class="spec2 checkbox" id="prop_<%=dtProp2.Rows[i]["pid"]%>_<%=dtProp2.Rows[i]["vid"]%>" value="<%=dtProp2.Rows[i]["pid"]%>:<%=dtProp2.Rows[i]["vid"]%>" name="cp_<%=dtProp2.Rows[i]["pid"]%>">
						                <label title="<%=dtProp2.Rows[i]["vname"]%>" for="prop_<%=dtProp2.Rows[i]["pid"]%>_<%=dtProp2.Rows[i]["vid"]%>"><%=dtProp2.Rows[i]["vname"]%></label>
						                <%--<input type="text" id="" maxlength="15" data-sku="<%=dtProp2.Rows[i]["pid"]%>:<%=dtProp2.Rows[i]["vid"]%>" value="<%=dtProp2.Rows[i]["vname"]%>" class="text text-short pure-text" name="cpva_<%=dtProp2.Rows[i]["pid"]%>:<%=dtProp2.Rows[i]["vid"]%>" disabled="disabled"> --%>
					                <%}%>
				                <td>
			                </tr>
			                <%}%>
			                <%if(dtProp1 != null && dtProp1.Rows.Count>0){%>
			                <tr>
				                <th class="tl">SKU设置：</th>
				                <td class="tr">
					                <div id="J_sell-table" style="margin-top:10px;display:none;">
						                <table cellspacing="0" cellpadding="0" border="0" class="tb-color">
							                <thead>
								                <tr>
								                    <%if(dtProp1.Rows.Count>0){%>
									                <th><%=dtProp1.Rows[0]["pname"]%></th>
									                <%} %>
									                <%if(dtProp2.Rows.Count>0){%>
									                <th><%=dtProp2.Rows[0]["pname"]%></th>
									                <%} %>
									                <th><em>*</em>价格</th>
									                <th><em>*</em>数量 </th>
									                <th>商家编码</th>
								                </tr>
							                </thead>
							                <tbody id="sell-body">
							                </tbody>
						                </table>
					                </div>
				                </td>
				            </tr>
			                <%} %>
				            <tr id="trstorage">
					            <th class="tl"><em>*</em>库存数量：</th>
					            <td class="tr">
						            <span style='display:<%=Request.QueryString["ProductID"] == null ? "none" : "none"%>;'><asp:Label ID="lblStorage" runat="server" ForeColor="blue" Text="0"></asp:Label></span>
						            <span style='display:<%=Request.QueryString["ProductID"] == null ? "" : ""%>;'><asp:textbox id="txtStorage" runat="server" Width="80px">1</asp:textbox></span>
					            </td>
				            </tr>
				            <% if(config.MarkUnit == 1) {%>
				            <tr>
					            <th class="tl">商品默认赠送积分比例：</th>
					            <td class="tr"><asp:textbox id="txtScoreRate" runat="server">0</asp:textbox></td>
				            </tr>
				            <tr>
					            <th class="tl">购买赠送积分点数：</th>
					            <td class="tr"><asp:textbox id="txtScore" runat="server">0</asp:textbox></td>
				            </tr>
				            <tr>
					            <th class="tl">购买最多可使用积分：</th>
					            <td class="tr"><asp:textbox id="txtUseScore" runat="server">0</asp:textbox></td>
				            </tr>
				            <% }%>
				            <tr>
					            <th class="tl"><em>*</em>最低购买数量：</th>
					            <td class="tr"><asp:textbox id="txtMin" runat="server">1</asp:textbox></td>
				            </tr>
				            <tr>
					            <th class="tl">是否库存警告：</th>
					            <td class="tr">
						            <asp:checkbox id="cbxNeedAlert" runat="server"></asp:checkbox>
						            <SPAN id="mininum" style="DISPLAY: none">警告数量：
						            <asp:textbox id="txtMininum" runat="server" Width="80px">0</asp:textbox></SPAN>
					            </td>
				            </tr>
				            <tr>
					            <th class="tl">是否发布：</th>
					            <td class="tr"><asp:checkbox id="cbxForSale" runat="server" Checked="True"></asp:checkbox><asp:checkbox id="cbxIsCard" runat="server" Visible="False"></asp:checkbox><SPAN id="card" style="DISPLAY: none">虚拟卡管理</SPAN></td>
				            </tr>
				            <tr>
					            <th class="tl">是否允许评论：</th>
					            <td class="tr"><asp:checkbox id="cbxCanReview" runat="server" Checked="True"></asp:checkbox></td>
				            </tr>
				            <tr>
					            <th class="tl">是否参与打折：</th>
					            <td class="tr"><asp:checkbox id="cbxDiscount" runat="server" Checked="True"></asp:checkbox></td>
				            </tr>
				            <asp:HiddenField ID="hiddenSubCategoryID" runat="server" /><!--隐藏控件用于保存店内分类-->
			            </table>
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">关联配件</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
				            <tr>
					            <td colsapn="2" class="mm">	
						            选择商品：										
						            <input type="button" id="btnAddFitting" value="添加配件" name="btnAddFitting" class="inputbtn" />
						            <input type="hidden" id="FitPID_old" name="FitPID_old" /><%--记录数据库中已经存在的附件商品ID--%>
						            <input type="hidden" id="FitPID_curr" name="FitPID_curr" /><%--记录当前页面中存在的附件商品ID--%>
						            <input type="hidden" id="FitPID_new" name="FitPID_new" /><%--记录要添加到数据库中的新ID--%>
						            <input type="hidden" id="FitPID_deleted" name="FitPID_deleted" /><%--记录要从数据库中删除的ID--%>
					            </td>
				            </tr>
				            <tr>
					            <td colspan="2" class="mm">
						            <table id="fitcontent" border="1" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" class="listresult">
							            <tr>
								            <th>操作</th>
								            <th>商品代码</th>
								            <th>商品名称</th>
							            </tr>
							            <asp:Repeater ID="rptFittings" runat="server">
								            <ItemTemplate>
									            <tr>
										            <td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="fitpid" value='<%#DataBinder.Eval(Container.DataItem,"GoodsID") %>'></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"ProductNo") %></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"GoodsName") %></td>
									            </tr>
								            </ItemTemplate>
							            </asp:Repeater>
						            </table>
					            </td>
				            </tr>							
			            </table>								
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">详细描述</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
				            <tr>
					            <th class="tl"><em>*</em>详细描述：</th>
					            <td class="tr">
						            <FTB:FREETEXTBOX id="ftbContent" runat="Server" Width="900" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
					            </td>
				            </tr>
				            <tr>
					            <th class="tl">包装清单：</th>
					            <td class="tr">
						            <FTB:FREETEXTBOX id="ftbPackingList" runat="Server" Width="900" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
					                <br /><span class="input-remark1">最多允许输入250个汉字（500个字符）内</span>
					            </td>
				            </tr>
			            </table>
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">商品标签</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
				            <tr>
					            <th class="tl">
						            已选标签：
					            </th>
					            <td class="tr">
						            <asp:TextBox runat="server" ID="txtKeyword" Width="100%" TextMode="multiLine" Rows="5" Columns="30" MaxLength="50"></asp:TextBox><br/><span class="input-remark1">25个汉字（50个字符）内</span>
					            </td>
				            </tr>
			            </table>
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">SEO优化</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0"  class="ptable">
				            <tr>
					            <th class="tl">页面标题：</th>
					            <td class="tr">
						            <asp:TextBox ID="txtTitle" runat="server" Width="400px"></asp:TextBox><span class="input-remark">25个汉字（50个字符）内</span>
					            </td>
				            </tr>
				            <tr>
					            <th class="tl">meta_keywords：</th>
					            <td class="tr">
						            <asp:TextBox ID="txtMetaKeyword" runat="server" TextMode="multiLine" Rows="5" Width="100%"></asp:TextBox>
					            </td>
				            </tr>
				            <tr>
					            <th class="tl">meta_description：</th>
					            <td class="tr">
						            <asp:TextBox ID="txtMetaDescription" runat="server" TextMode="multiLine" Rows="5" Width="100%"></asp:TextBox>
					            </td>
				            </tr>
			            </table>
		            </div>
	            </div>
	            <div class="frame tab">
		            <div class="frame_title">相关商品</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
				            <tr>
					            <td colspan="2" class="mm">	
						            选择商品：										
						            <input type="button" id="btnAddRelate" name="btnAddRelate" value="添加" class="inputbtn" />
						            <input type="hidden" id="RltPID_old" name="RltPID_old" /><%--记录数据库中已经存在的相关商品ID--%>
						            <input type="hidden" id="RltPID_curr" name="RltPID_curr" /><%--记录当前页面中存在的相关商品ID--%>
						            <input type="hidden" id="RltPID_new" name="RltPID_new" /><%--记录要添加到数据库中的新ID--%>
						            <input type="hidden" id="RltPID_deleted" name="RltPID_deleted" /><%--记录要从数据库中删除的ID--%>
					            </td>
				            </tr>
				            <tr>
					            <td colspan="2" class="mm">
						            <table id="listresult" border="1" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" class="listresult">
							            <tr>
								            <th>操作</th>
								            <th>商品代码</th>
								            <th>商品名称</th>
							            </tr>
							            <asp:Repeater ID="rptRltPdts" runat="server">
								            <ItemTemplate>
									            <tr>
										            <td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="rltpid" value='<%#DataBinder.Eval(Container.DataItem,"ProductID") %>'/></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"ProductNo") %></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"ProductName") %></td>
									            </tr>
								            </ItemTemplate>
							            </asp:Repeater>
						            </table>
					            </td>
				            </tr>								
			            </table>								
		            </div>
	            </div>
	            <div class="hide">
	            <div class="frame tab">
		            <div class="frame_title">赠品</div>
		            <div class="frame_content">
			            <table cellspacing="0" cellpadding="0" class="ptable">
				            <tr>
					            <td class="mm">	
						            选择赠品：
						            <input type="radio" id="rdPresentType_1" name="rdPresentType" value="1" checked="checked" /><label for="rdPresentType_1">从商品中选择</label>
						            <input type="radio" id="rdPresentType_2" name="rdPresentType" value="2" /><label for="rdPresentType_2">从礼品中选择</label>
						            <input type="button" id="btnAddPresent" name="btnAddPresent" value="添加" class="inputbtn" />
						            <input type="hidden" id="PrePID_old" name="PrePID_old" /><%--记录数据库中已经存在的赠送商品ID--%>
						            <input type="hidden" id="PrePID_curr" name="PrePID_curr" /><%--记录当前页面中存在的赠送商品ID--%>
						            <input type="hidden" id="PrePID_new" name="PrePID_new" /><%--记录要添加到数据库中的新ID--%>
						            <input type="hidden" id="PrePID_deleted" name="PrePID_deleted" /><%--记录要从数据库中删除的ID--%>
					            </td>
				            </tr>
				            <tr>
				                <td class="mm">已选商品</td>
				            </tr>
				            <tr>
					            <td class="mm">
						            <table id="presentcontent" border="1" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" class="listresult">
							            <tr>
								            <th>操作</th>
								            <th>商品名称</th>
								            <th>商品编号</th>
								            <th>库存</th>
								            <th>赠送数量</th>
							            </tr>
							            <asp:Repeater ID="rptPrePdts" runat="server">
								            <ItemTemplate>
									            <tr>
										            <td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="prepid" value='<%#DataBinder.Eval(Container.DataItem,"ProductID") %>'/></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"ProductName") %></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"ProductNo") %></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"Storage") %></td>
										            <td><input type="text" name='preNum_pdt' value='<%#DataBinder.Eval(Container.DataItem, "PresentNum")%>' /></td>
									            </tr>
								            </ItemTemplate>
							            </asp:Repeater>
						            </table>
					            </td>
				            </tr>
				            <tr>
				                <td class="mm">已选礼品</td>
				            </tr>
				            <tr>
				                <td class="mm">
						            <input type="hidden" id="PreGID_old" name="PreGID_old" /><%--记录数据库中已经存在的赠送礼品ID--%>
						            <input type="hidden" id="PreGID_curr" name="PreGID_curr" /><%--记录当前页面中存在的赠送礼品ID--%>
						            <input type="hidden" id="PreGID_new" name="PreGID_new" /><%--记录要添加到数据库中的新ID--%>
						            <input type="hidden" id="PreGID_deleted" name="PreGID_deleted" /><%--记录要从数据库中删除的ID--%>
				                    <table id="presentcontent_gifts" border="1" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" class="listresult">
							            <tr>
								            <th>操作</th>
								            <th>礼品名称</th>
								            <th>赠送数量</th>
							            </tr>
							            <asp:Repeater ID="rptPreGifts" runat="server">
								            <ItemTemplate>
									            <tr>
										            <td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="pregid" value='<%#DataBinder.Eval(Container.DataItem,"GiftID") %>'/></td>
										            <td><%#DataBinder.Eval(Container.DataItem,"GiftName") %></td>
										            <td><input type="text" name='preNum_gift' value='<%#DataBinder.Eval(Container.DataItem, "PresentNum")%>' /></td>
									            </tr>
								            </ItemTemplate>
							            </asp:Repeater>
						            </table>
				                </td>
				            </tr>								
			            </table>								
		            </div>
	            </div>
	            </div>
            </div>            					 
            <div class="save">
	            <asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:button>
	            <asp:Button ID="btnSaveAndAdd" runat="server" Text="保存并继续添加同类商品" onclick="btnSaveAndAdd_Click" CssClass="inputbtn"/>
	            <asp:button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CausesValidation="False" CssClass="inputbtn"></asp:button>
            </div>
            </form>
			</div>
		</div>
		<div id="ShowCategory" class="popupContact" style="z-index:2;">
            <div id="SelectCategoryHead" class="popupHead">
                <div class="popupTitle">选择商品分类</div>
                <div class="popupClose" id="SelectCategoryClose" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
            <div style=" padding:10px;">
                <table cellspacing="0" cellpadding="0" class="ptable" style="width:100%">
					<tr>
						<td class="mm">
							<div id="categorys" style="width:96.5%;">
								<ul id="cul"></ul>
							</div>
						</td>
					</tr>
					<tr>
						<td class="mm"><div id="next" class="next disable popupClose"></div></td>
					</tr>
				</table>
            </div>
        </div>		
		<div id="ShowRelate" class="popupContact" style="z-index:2; padding:0px;">
            <div id="RelateHead" class="popupHead">
                <div class="popupTitle">选择商品</div>
                <div class="popupClose" id="RelateClose" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
			<div style="position:relative; padding:0px 5px; text-align:center;">
                <div style="width:98%;">
                    <div id="search_controls">
                        <select id="sel_searchType" name="sel_searchType">
                            <option value="1">商品编号</option>
                            <option value="2">商品名称</option>
                            <option value="3">商品关键词</option>
                        </select>
                        <input type="text" id="txtSearchKeyword" name="txtKeyword" />
                        <input type="button" id="btnSearch" name="btnSearch" value="搜索" class="inputbtn" />
                        <a href="#" id="showadvsearch">高级搜索</a>
                    </div>
                    <div id="advsearch" style="display:none; position:absolute;">
                        <select id="sel_category" name="sel_category" size="10" multiple="multiple">
                            <%=BindCategories() %>
                        </select>
                        <select id="sel_brand" name="sel_brand" size="10" multiple="multiple">
                            <%=BindBrand("0")%>
                        </select>
                    </div>
                    <div class="sub_container_listhead" id="search_result_head" style="padding:0px;">
                        <table cellspacing="0" cellpadding="0" class="llist">
                            <tr id="listhead"><%--id="listhead"不能少--%>
                                <th style="width:5%"><input type="checkbox" id="chkAll" name="chkAll" /></th>
                                <th style="width:30%">商品名称</th>
                                <th style="width:25%">商品代码</th>
                                <th style="width:15%">商品类别</th>
                                <th style="width:15%">商品品牌</th>
                                <th style="width:10%">会员价格</th>         
                            </tr>
                        </table>
                    </div>
                    <div class="sub_container_content" id="search_result_content" style="padding:0px;overflow-x:hidden;overflow-y:scroll;">
	                    <table id="datas" cellspacing="0" cellpadding="0" class="llist">
		                    <tr id="template" style="display:none;"><%--id="template"不能少--%>
			                    <td style="width:5%" id="checkbox" class="ccenter"></td>
			                    <td style="width:30%" id="Name"></td>
			                    <td style="width:25%" id="ProductNo"></td>
			                    <td style="width:15%" id="Category" class="ccenter"></td>
			                    <td style="width:15%" id="Brand" class="ccenter"></td>
			                    <td style="width:10%" id="MemberPrice" class="ccenter"></td>
		                    </tr>
	                    </table>
                    </div>
                    <div class="sub_container_page" id="pageDataList1_Pager" style="position:relative;">
                        <!-- 翻页-->
                        <!-- 翻页结束-->
                    </div>
                    <div id="search_save" style=" text-align:center;">
                        <input type="button" id="btnAddPdt"  class="popupClose inputbtn" value="确认" />
                        <input type="hidden" id="RelatePdtIds" name="RelatePdtIds" value="" /><%--商品的ID--%>
                        
                    </div>
                    <div style="clear:both;"></div>
	            </div>
                <div style="clear:both;"></div>
            </div>
        </div>
        
        <div id="ShowGift" class="popupContact" style="z-index:2; padding:0px;">
            <div id="GiftHead" class="popupHead">
                <div class="popupTitle">选择礼品</div>
                <div class="popupClose" id="CloseGift" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
			<div style="position:relative; padding:0px 5px; text-align:center;">
                <div style="width:98%;">
                    <div id="gift_search_control">
                        <input type="text" id="txtGiftKeyword" /><input type="button" id="btnSearchGift" value="搜索" class="inputbtn" />
                    </div>
                    <div class="sub_container_listhead" id="search_result_head_gift" style="padding:0px;">
                        <table cellspacing="0" cellpadding="0" class="llist">
                            <tr id="gift_listhead"><%--id="listhead"不能少--%>
                                <th style="width:10%"><input type="checkbox" id="chkAll_gift" name="chkAll_gift" /></th>
                                <th style="width:90%">礼品名称</th>
                            </tr>
                        </table>
                    </div>
                    <div class="sub_container_content" id="search_result_content_gift" style="padding:0px;overflow-x:hidden;overflow-y:scroll;">
	                    <table id="datas_gift" cellspacing="0" cellpadding="0" class="llist dataContainer">
		                    <tr id="template_gift" style="display:none;"><%--id="template"不能少--%>
			                    <td style="width:10%" id="checkbox_gift" class="ccenter"></td>
			                    <td style="width:90%" id="giftName"></td>
		                    </tr>
	                    </table>
                    </div>
                    <div class="sub_container_page" id="pageDataList2_Pager" style="position:relative;"></div>
                    
                    <div id="search_save_gift" style=" text-align:center;">
                        <input type="button" id="btnAddGifts"  class="popupClose inputbtn" value="确认" />
                        <input type="hidden" id="GiftIDs" name="GiftIDs" value="" /><%--礼品的ID--%>
                    </div>
                    <div style="clear:both;"></div>
	            </div>
                <div style="clear:both;"></div>
            </div>
        </div>
        
		<div id="backgroundPopup" class="backgroundPopup"></div>
	</body>
</HTML>
