<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page language="c#" Codebehind="ProductAdd.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.ProductAdd" validateRequest="false" %>
<!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>ProductAdd</title>
		<script type="text/javascript" src="inc/ProductAdd.js"></script>
	</HEAD>
	<body>
	    <div id="JsContent" style="display:none;"></div>

	    <div class="container">	   
		<div class="sub_container">
		<form id="Form1" method="post" runat="server">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px 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 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">SEO优化</li>
			        <li class="menuitem tabout">相关商品</li>			        
			    </ul>
			</div>
		</div>
		<div class="sub_container_content">					
	        <div class="frame tab">
		        <div class="frame_title">基本信息</div>
		        <div class="frame_content">	
			        <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
			            <tr>
			                <td>
			                    <table width="100%">
			                        <tr>
			                            <td align="left">商品名称：</td>
			                            <td><asp:textbox id="txtName" runat="server"></asp:textbox><font color="red">*</font></td>
			                        </tr>
			                        <tr>
					                    <td align="left" width="100" height="18">商品编码：</td>
					                    <td height="18"><asp:textbox id="txtProductNo" runat="server" Width="80pt"></asp:textbox>
									<asp:CheckBox id="cbxAutoCreate" runat="server" Text="自动生成"></asp:CheckBox></td>
				                    </tr>
				                    <tr>
					                    <td align="left" width="100">商品品牌：</td>
					                    <td>
					                        <select id="ddlBrand" name="ddlBrand">
					                            <%=GetBrandByCatID() %>
					                        </select>
					                    </td>
				                    </tr>
				                    <tr>
					                    <td align="left" width="100">简单描述：</td>
					                    <td><asp:textbox id="txtShortDesc" runat="server" Width="200px"></asp:textbox></td>
				                    </tr>
				                    <tr>
					                    <td align="left" width="100">计量单位：</td>
					                    <td><asp:textbox id="txtUnit" runat="server"></asp:textbox><FONT color="red">*</FONT></td>
				                    </tr>
				                    <tr>
					                    <td align="left" width="100" height="17">单位重量：</td>
					                    <td height="17"><asp:textbox id="txtWeight" runat="server">0</asp:textbox>克</td>
				                    </tr>
				                    <% if(config.MarkUnit == 1) {%>
				                    <tr>
					                    <td align="left" width="100" height="18">积分点数：</td>
					                    <td height="18"><asp:textbox id="txtScore" runat="server">0</asp:textbox><FONT color="red"></FONT></td>
				                    </tr>
				                    <% }%>
				                    <tr>
					                    <td align="left" width="100" height="19">市场价格：</td>
					                    <td height="19"><asp:textbox id="txtMarketPrice" runat="server">0</asp:textbox><FONT color="red">*</FONT></td>
				                    </tr>
				                    <tr>
					                    <td align="left" width="100">会员价格：</td>
					                    <td><asp:textbox id="txtMemberPrice" runat="server">0</asp:textbox><FONT color="red">*</FONT></td>
				                    </tr>
				                    <tr>
					                    <td align="left" width="100">最低购买数量：</td>
					                    <td><asp:textbox id="txtMin" runat="server">1</asp:textbox><FONT color="red">*</FONT></td>
				                    </tr>
			                    </table>
			                </td>
			                <td valign="top">
			                     <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				                    <tr>
					                    <td vAlign="top" align="left">所属分类：<br />
						                    （按住Ctrl可多选）
					                    </td>
					                </tr>
					                <tr>    
					                    <td vAlign="top" width="150"><asp:listbox id="lbxCategories" runat="server" SelectionMode="Multiple" Rows="10" AutoPostBack="false"></asp:listbox><FONT face="宋体"><BR>
						                    </FONT>
					                    </td>
				                    </tr>
			                    </table>
			                </td>
			                <td valign="top" style="width:50%;">
			                    <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				                    <tr>
				                        <td align="center">扩展属性</td>
				                    </tr>
				                </table>    
			                    <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="1" id="tb_productfield"><%--id="tb_productfield" 不能掉--%>
				                    <asp:Repeater ID="rptProductFields" runat="server">
			                            <ItemTemplate>
				                            <tr id="prdocutfieldselect_<%# Container.ItemIndex %>">
					                            <td align="left"><%# DataBinder.Eval(Container.DataItem, "FieldName") %>：</td>
					                            <td>
					                                <%# GetProductFiledSelect((int)Container.ItemIndex,(int)DataBinder.Eval(Container.DataItem, "FieldID"),DataBinder.Eval(Container.DataItem, "FieldValues").ToString()) %>
						                            <span id='span_fieldvalue_<%# Container.ItemIndex %>' style="DISPLAY: none">
						                            <input type="text" id="txtFieldValue_<%# Container.ItemIndex %>" name="txtFieldValue_<%# Container.ItemIndex %>" value='<%# DataBinder.Eval(Container.DataItem, "FieldValues") %>'/>
							                        （<font color="red">请勿使用符号“|”</font>）</span>
							                    </td>
				                            </tr>
			                            </ItemTemplate>
		                            </asp:Repeater>
            				        
		                            <asp:Repeater ID="rptChoice" runat="server">
		                                <ItemTemplate>
		                                    <tr>
				                                <td align="left"><%# DataBinder.Eval(Container.DataItem, "FieldName") %>：</td>
					                            <td><%# GetCustomChoice(int.Parse(DataBinder.Eval(Container.DataItem, "ChoiceIndex").ToString()))%></td>
		                                    </tr>
		                                </ItemTemplate>
		                            </asp:Repeater>
			                    </table>
			                </td>
			            </tr>
			        </table>
	            <input type="hidden" id="customselectCount" name="customselectCount" value="0" /><%--扩展属性Select的个数--%>
	            <input type="hidden" id="customchoiceCount" name="customchoiceCount" value="0" /><%--扩展属性CheckBox的个数--%>
		        </div>
	        </div>
	        
		    <div class="frame tab">
		        <div class="frame_title">商品图片</div>		
		        <div class="frame_content">
	                <table cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
	                    <tr>
		                    <td align="left" valign="middle" style="white-space:normal; width:60px;">添加水印：</td>
		                    <td height="30" valign="middle">
			                    <table  style="width:450px;">
				                    <tr>
					                    <td valign="bottom"><asp:radiobutton id="rbNoWatermark" runat="server" GroupName="watermark" Text="不添加水印" Checked="True"></asp:radiobutton><asp:radiobutton id="rbPicWatermark" runat="server" Text="添加图片水印" GroupName="watermark"></asp:radiobutton>
					                    <asp:radiobutton id="rbFontWatermark" runat="server" Text="添加文字水印" GroupName="watermark"></asp:radiobutton> <font color=red>(文字水印只支持JPG格式图片)</font></td>
					                    <td valign="bottom"></td>
				                    </tr>
			                    </table>
		                    </td>								
	                    </tr>
	                    <tr>
		                    <td align="left">商品大图：</td>
		                    <td><input id="File2" type="file" name="file2" runat="server" /></td>
							
	                    </tr>
	                    <tr>
		                    <td align="left">商品缩略图：</td>
		                    <td><span id="ThumbnailPic" style="DISPLAY: none"><input id="File1" type="file" name="file2" runat="server" /></span><asp:checkbox id="cbxFromBigPic" runat="server"></asp:checkbox>自动生成宽度为<asp:textbox id="txtPicWidth" runat="server" Width="30px">90</asp:textbox>象素的缩略图
		                    </td>
	                    </tr>
	                    <tr>
		                    <td align="left">商品多图：</td>
		                    <td>
			                    <P id="FileCollection"><input type="file" name="File" /></P>
		                    </td>
	                    </tr>
	                    <tr>
		                    <td>&nbsp;</td>
		                    <td><input type="button" id="btnAddFile" value="增加(File)" /></td>
	                    </tr>
	                    <tr>
		                    <td align="left" colspan="2">
		                        <asp:datagrid id="dgRelatedImgs" runat="server" Width="50%" DataKeyField="img" AutoGenerateColumns="False"
				                    HeaderStyle-CssClass="summary-title">
				                    <Columns>
					                    <asp:TemplateColumn HeaderText="商品多图图片">
						                    <ItemTemplate>
							                    <a href='../upload/relatedImgs/<%# DataBinder.Eval(Container.DataItem, "img") %>' target="_blank">
								                    <%# DataBinder.Eval(Container.DataItem, "img") %>
							                    </a>
						                    </ItemTemplate>
					                    </asp:TemplateColumn>
					                    <asp:ButtonColumn ButtonType="LinkButton" HeaderText="删除" Text="删除" CommandName="Delete"></asp:ButtonColumn>
				                    </Columns>
			                    </asp:datagrid></td>
	                    </tr>
                    </table>
			        
		        </div>
	        </div>
	        
	        <div class="frame tab">
		        <div class="frame_title">商品状态</div>
		        <div class="frame_content">
		            <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				        <tr>
					        <td>库存数量：</td>
					        <td width="50"><asp:Label ID="lblStorage" runat="server" ForeColor="blue" Text="0"></asp:Label></td>
					        <td align="left" width="100" height="21">最新入库：</td>
					        <td><asp:textbox id="txtStorage" runat="server" Width="80px">0</asp:textbox></td>
				        </tr>
				        <tr>
					        <td align="left" width="100">是否库存警告：</td>
					        <td colspan="3">
					        <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>
					        <td align="left" width="100">是否发布：
					        </td>
					        <td colSpan="3"><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>
					        <td align="left" width="100">是否推荐：
					        </td>
					        <td colSpan="3"><asp:checkbox id="cbxCommend" runat="server" Checked="True"></asp:checkbox></td>
				        </tr>
				        <tr>
					        <td align="left" width="100">是否特价：
					        </td>
					        <td colSpan="3"><asp:checkbox id="cbxSpecialOffer" runat="server" Checked="True"></asp:checkbox></td>
				        </tr>
				        <tr>
					        <td align="left" width="100">是否热卖：
					        </td>
					        <td colSpan="3"><asp:checkbox id="cbxHot" runat="server" Checked="True"></asp:checkbox></td>
				        </tr>
				        <tr>
					        <td align="left" width="100">是否允许评论：
					        </td>
					        <td colSpan="3"><asp:checkbox id="cbxCanReview" runat="server" Checked="True"></asp:checkbox></td>
				        </tr>
				        <tr>
					        <td align="left" width="100">是否参与打折：
					        </td>
					        <td colSpan="3"><asp:checkbox id="cbxDiscount" runat="server" Checked="True"></asp:checkbox></td>
				        </tr>
			        </table>
		        </div>
	        </div>
	      
	        <div class="frame tab">
		        <div class="frame_title">附件</div>
		        <div class="frame_content">
		            <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				        <tr>
					        <td align="left" width="100"><b>附件：</b></td>
					        <td colSpan="3">更多属性可通过<b><asp:label id="lblCustomField" Runat="server"></asp:label></b>进行设置</td>
				        </tr>
			        </table>
		        </div>
	        </div>
	        
	        <div class="frame tab">
		        <div class="frame_title">详细描述</div>
		        <div class="frame_content">
		            <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				        <tr>
					        <td align="left" width="100">详细描述：
					        </td>
					        <td colSpan="3"><FTB:FREETEXTBOX id="ftbContent" runat="Server" Width="520" ButtonOverImage="True" ButtonDownImage="True"
							        ButtonPath="images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX></td>
				        </tr>
			        </table>
		        </div>
	        </div>
	        <div class="frame tab">
		        <div class="frame_title">SEO优化</div>		
		        <div class="frame_content">
					 <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				        <tr>
					        <td align="left" width="100">页面标题：</td>
					        <td><asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox></td>
					    </tr>
					    <tr>
					        <td align="left" width="100">META_KEYWORDS：</td>
					        <td><asp:TextBox ID="txtMetaKeyword" runat="server" TextMode="multiLine" Rows="3" Width="300px"></asp:TextBox></td>
					    </tr>
					    <tr>
					        <td align="left" width="100">META_DESCRIPTION：</td>
					        <td><asp:TextBox ID="txtMetaDescription" runat="server" TextMode="multiLine" Rows="3" Width="300px"></asp:TextBox></td>
					    </tr>
					 </table>
		         </div>
	        </div>
	        <div class="frame tab">
		        <div class="frame_title">相关商品</div>
		        <div class="frame_content">
		            <table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="0">
				        <tr>
					        <td align="left" width="100">相关商品：
					        </td>
					        <td>
					            <asp:datagrid id="dgAbout" runat="server" Width="40%" DataKeyField="ProductID" AutoGenerateColumns="False"
							        HeaderStyle-CssClass="summary-title" PageSize="15" PagerStyle-Mode="NumericPages" HorizontalAlign="left">
							        <HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
							        <Columns>
								        <asp:TemplateColumn>
									        <HeaderTemplate>
										        <input type="checkbox" id="chkAll_list" name="chkAll_list" checked="checked" />
									        </HeaderTemplate>
									        <ItemTemplate>
									            <input type="checkbox" name="chkItem_list" checked="checked" value='<%# DataBinder.Eval(Container.DataItem, "ProductID") %>' />
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="商品名称">
									        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Name") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="商品代码">
									        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="80px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "ProductNo") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
							        </Columns>
							        <PagerStyle Mode="NumericPages"></PagerStyle>
						        </asp:datagrid>
						        
						        <asp:textbox id="txtAboutKey" runat="server"></asp:textbox><asp:button id="btnAbout" OnClick="btnAbout_Click" runat="server" Text="搜索相关商品"></asp:button>
					        </td>
				        </tr>
				        <tr>
				            <td></td>
					        <td align="left">
					            <br />
					            搜索结果<br />
					            <table style="border:1px solid #eeeeee;border-collapse:collapse;">
					                <tr id="search_result_head" style="display:none;"><%-- id="search_result_head" 不能掉 --%>
					                    <td><input type="checkbox" id="chkAll_search" name="chkAll_search" /></td>
					                    <th>商品名称</th>
					                    <th>商品代码</th>
					                </tr>
					            </table>
						     </td>
				        </tr>
			        </table>
		        </div>
	        </div>		
		</div>				
		<div class="save">
		    <asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存"></asp:button>
		    <asp:button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CausesValidation="False"></asp:button>
	    </div>
	    </form>
	   </div>
	</div>
	
</body>
</HTML>
