<%@ Page language="c#" AutoEventWireup="false" EnableViewState="false" Inherits="SocoShop.Page.CartAjax" %>
<%@ Import namespace="SocoShop.Entity" %>
<%@ Import namespace="SocoShop.Business" %>
<%@ Import namespace="SocoShop.Common" %>
<%@ Import namespace="SkyCES.EntLib" %>
<%@ Import namespace="System.Diagnostics" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
	/* 
		本页面代码由天易模板生成于 2011/3/6 19:11:38.
	*/
	Stopwatch sw = new Stopwatch();
	sw.Start();
	base.OnInit(e);
	sw.Stop();
	 decimal processTime=Convert.ToDecimal(sw.ElapsedMilliseconds) / 1000;
	StringBuilder document = new StringBuilder();
	document.Append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n");
	document.Append("    <tr class=\"cartHead\">\r\n");
	document.Append("        <td style=\"width:80px\">商品</td>\r\n");
	document.Append("        <td style=\"width:460px\">名称</td>\r\n");
	document.Append("        <td style=\"width:80px\">赠送积分</td>\r\n");
	document.Append("        <td style=\"width:80px\">单价</td>\r\n");
	document.Append("        <td style=\"width:80px\">数量</td>\r\n");
	document.Append("        <td style=\"width:80px\">小计</td>\r\n");
	document.Append("        <td>操作</td>\r\n");
	document.Append("    </tr>\r\n");
	foreach(CartGiftPackVirtualInfo cartGiftPackVirtual in cartGiftPackVirtualList)
{
	document.Append("    <tr class=\"cartMain\" valign=\"middle\">\r\n");
	document.Append("        <td style=\"width:80px\" class=\"photo\"><a href=\"/GiftPackDetail-I"+cartGiftPackVirtual.GiftPackID+".aspx\" target=\"_blank\"><img src=\""+cartGiftPackVirtual.GiftPackPhoto.Replace("Original","150-60")+"\"  onload=\"photoLoad(this,60,60)\" /></a></td>\r\n");
	document.Append("        <td style=\"width:460px; text-align:left; text-indent:8px;\">"+cartGiftPackVirtual.GiftPackName+"\r\n");
	document.Append("            <div class=\"smallBox\">\r\n");
	foreach(CartInfo cart in cartGiftPackVirtual.CartList)
{
	ProductInfo product = ProductBLL.ReadProductByProductList(productList, cart.ProductID);
	document.Append("                <div><img  src=\""+product.Photo.Replace("Original","60-60")+"\"  onload=\"photoLoad(this,30,30)\" style=\" vertical-align:middle\"/> "+cart.ProductName+"</div>\r\n");
	}
	document.Append("            </div>\r\n");
	document.Append("        </td>\r\n");
	document.Append("        <td style=\"width:80px\">"+cartGiftPackVirtual.TotalSendPoint+"</td>\r\n");
	document.Append("        <td style=\"width:80px\">￥"+cartGiftPackVirtual.TotalPrice+"</td>\r\n");
	document.Append("        <td style=\"width:80px\"><input  type=\"text\" class=\"text\" value=\""+cartGiftPackVirtual.GiftPackBuyCount+"\"  onblur=\"changeOrderProductBuyCount('"+cartGiftPackVirtual.StrCartID+"',this,"+cartGiftPackVirtual.GiftPackBuyCount+","+cartGiftPackVirtual.TotalPrice+","+cartGiftPackVirtual.CartList.Count+","+cartGiftPackVirtual.LeftStorageCount+")\"/></td>\r\n");
	document.Append("        <td style=\"width:80px\">￥"+cartGiftPackVirtual.GiftPackBuyCount*cartGiftPackVirtual.TotalPrice+"</td>\r\n");
	document.Append("        <td><a href='javascript:void(0)' onclick=\"deleteOrderProduct('"+cartGiftPackVirtual.StrCartID+"',"+cartGiftPackVirtual.GiftPackBuyCount+","+cartGiftPackVirtual.TotalPrice+","+cartGiftPackVirtual.CartList.Count+")\">删除</a></td>\r\n");
	document.Append("    </tr>\r\n");
	}
	foreach(CartCommonProductVirtualInfo cartCommonProductVirtual in cartCommonProductVirtualList)
{
	ProductInfo product = ProductBLL.ReadProductByProductList(productList, cartCommonProductVirtual.FatherCart.ProductID);
	document.Append("    <tr class=\"cartMain\">\r\n");
	document.Append("        <td style=\"width:80px\" class=\"photo\"><a href=\"/ProductDetail-I"+product.ID+".aspx\" target=\"_blank\"><img  src=\""+product.Photo.Replace("Original","60-60")+"\"  onload=\"photoLoad(this,60,60)\"/></a></td>\r\n");
	document.Append("        <td style=\"width:460px; text-align:left; text-indent:8px;\">\r\n");
	document.Append("            "+cartCommonProductVirtual.FatherCart.ProductName+"\r\n");
	if(cartCommonProductVirtual.ChildCartList.Count>0)
{
	document.Append("            <div class=\"smallBox\">\r\n");
	foreach(CartInfo cart in cartCommonProductVirtual.ChildCartList)
{
	ProductInfo childProduct = ProductBLL.ReadProductByProductList(productList, cart.ProductID);
	document.Append("                <div><span style=\"color:#BF0000\">[ 配件 ]</span><img  src=\""+childProduct.Photo.Replace("Original","60-60")+"\"   onload=\"photoLoad(this,30,30)\" style=\" vertical-align:middle\"/> "+cart.ProductName+"</div>\r\n");
	}
	document.Append("            </div>\r\n");
	 }
	document.Append("        </td>\r\n");
	document.Append("        <td style=\"width:80px\">"+cartCommonProductVirtual.FatherCart.SendPoint+"</td>\r\n");
	document.Append("        <td style=\"width:80px\">￥"+cartCommonProductVirtual.FatherCart.ProductPrice+"</td>\r\n");
	document.Append("        <td style=\"width:80px\"><input  type=\"text\" class=\"text\" value=\""+cartCommonProductVirtual.FatherCart.BuyCount+"\" onblur=\"changeOrderProductBuyCount('"+cartCommonProductVirtual.StrCartID+"',this,"+cartCommonProductVirtual.FatherCart.BuyCount+","+cartCommonProductVirtual.FatherCart.ProductPrice+",1,"+cartCommonProductVirtual.FatherCart.LeftStorageCount+")\" /></td>\r\n");
	document.Append("        <td style=\"width:80px\">￥"+cartCommonProductVirtual.FatherCart.ProductPrice*cartCommonProductVirtual.FatherCart.BuyCount+"</td>\r\n");
	document.Append("        <td><a href='javascript:void(0)' onclick=\"deleteOrderProduct('"+cartCommonProductVirtual.StrCartID+"',"+cartCommonProductVirtual.FatherCart.BuyCount+","+cartCommonProductVirtual.FatherCart.ProductPrice+",1)\">删除</a></td>\r\n");
	document.Append("    </tr>\r\n");
	}
	document.Append("</table>\r\n");
	document.Append("<div class=\"height10\"></div>  \r\n");
	document.Append("<div class=\"totalMoney\">商品总金额：<span>￥"+Sessions.ProductTotalPrice+"</span></div> \r\n");
	document.Append("<div class=\"height10\"></div>  \r\n");
	Response.Write(document.ToString());
}
</script>