<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:List ID="Categories" Mark="Goods" Object="GoodsCategory" />
<script language="c#" runat="server">
protected string Condition()
{
	StringBuilder condition = new StringBuilder();
	
	string[] nos = Request.QueryString["Nos"].Split('|');
	for (int i = 0; i < nos.Length; i++)
	{
		if (i > 0)
			condition.Append(" OR ");

		condition.Append("(" + AliShop.GoodsModule.Alias.Goods.No + "='" + nos[i] + "' OR " + AliShop.GoodsModule.Alias.Goods.Spec + " LIKE '%" + nos[i] + "%')");
	}
	
	return condition.ToString();
}

protected string GetParentChain(object categoryId)
{
	DataRow[] rows = Categories.Select(AliShop.GoodsModule.Alias.GoodsCategory.ID + "='" + categoryId + "'");
	return rows[0][AliShop.GoodsModule.Alias.GoodsCategory.ParentChain].ToString();
}
</script>
[
	<ali:List Mark="Goods" Object="Goods" Condition="Condition()">
			<ali:Record>
				{"no":"<%=No%>","spec":"<%=Manager.Escape(Spec)%>","categoryName":"<%=CategoryName%>","categoryId":"<%=CategoryID%>","categoryParentChain":"<%=GetParentChain(CategoryID)%>"}
				<ali:Separator>,</ali:Separator>
			</ali:Record>
	</ali:List>
]
