<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderAjax.aspx.cs" Inherits="SocoShop.Web.Admin.OrderAjax" %>
<%@ Import Namespace="SocoShop.Business" %>
<%@ Import Namespace="SocoShop.Common" %>
<%@ Import Namespace="SocoShop.Entity" %>
<%@ Import Namespace="SkyCES.EntLib" %>
<div class="add">
    <ul>
		<li class="orderBlock">商品信息</li>
	</ul>	
	<table cellpadding="0" cellspacing="0" border="0" width="100%"  class="tableList">
        <tr class="tableHead">
	        <td style="width:10%;">商品</td>
	        <td style="width:45%">单价</td>        
	        <td style="width:10%">单价</td>        
	        <td style="width:10%">赠送积分</td>
	        <td style="width:10%">重量</td>
	        <td style="width:10%">购买数量</td>
	        <td style="width:5%">管理</td>
	    </tr>
	    <% foreach (OrderGiftPackVirtualInfo orderGiftPackVirtual in orderGiftPackVirtualList){ %>
        <tr class="tableMain">
	        <td style="width:10%;"><img  src="<%=orderGiftPackVirtual.GiftPackPhoto.Replace("Original","150-60")%>"  onload="photoLoad(this,60,60)" /></td>
	        <td style="width:45%; text-align:left;text-indent:8px;">
	             <%=orderGiftPackVirtual.GiftPackName %>
	            <div style="border:#DBEDFE 1px solid; overflow:hidden;background-color:#F5FAFE; margin-top:5px;">
                    <%  foreach(OrderDetailInfo orderDetail in orderGiftPackVirtual.OrderDetailList){
                        ProductInfo product = ProductBLL.ReadProductByProductList(productList, orderDetail.ProductID);
                    %>
                    <div>
		                <img  src="<%=product.Photo.Replace("Original","60-60")%>"  onload="photoLoad(this,30,30)" style=" vertical-align:middle"/> <%=orderDetail.ProductName%>；重量：<%=orderDetail.ProductWeight%>克；赠送积分：<%=orderDetail.SendPoint%>
		            </div>
	                <%} %>
	            </div>
	        </td>
	        <td style="width:10%"><%=orderGiftPackVirtual.TotalPrice%> 元</td>     
	        <td style="width:10%"><%=orderGiftPackVirtual.TotalSendPoint%></td>
	        <td style="width:10%"><%=orderGiftPackVirtual.TotalProductWeight%> 克</td>
	        <% if (canEdit){ %>
	        <td style="width:10%"><input type="text" value="<%=orderGiftPackVirtual.GiftPackBuyCount%>" class="input" style="width:30px" onblur="changeOrderProductBuyCount('<%=orderGiftPackVirtual.StrOrderDetailID %>',this.value,'<%=orderGiftPackVirtual.StrProductID %>',<%=orderGiftPackVirtual.GiftPackBuyCount%>)" /></td>
	        <td style="width:5%"><a href='javascript:void(0)' onclick="deleteOrderProduct('<%=orderGiftPackVirtual.StrOrderDetailID %>','<%=orderGiftPackVirtual.StrProductID %>',<%=orderGiftPackVirtual.GiftPackBuyCount%>)"><img src="Style/Images/delete.gif" alt="删除" title="删除" /></a></td>
	        <%}else{ %>
	        <td style="width:10%"><%=orderGiftPackVirtual.GiftPackBuyCount%></td>
	        <td style="width:5%">--</td>
	        <%} %>
	    </tr>	    
	    <%} %>
	    
	    <% foreach (OrderCommonProductVirtualInfo orderCommonProductVirtual in orderCommonProductVirtualList){
            ProductInfo product = ProductBLL.ReadProductByProductList(productList, orderCommonProductVirtual.FatherOrderDetail.ProductID);
        %>
	    <tr class="tableMain">
	        <td style="width:10%;"><img  src="<%=product.Photo.Replace("Original","60-60")%>"  onload="photoLoad(this,60,60)" /></td>
	        <td style="width:45%;text-align:left;text-indent:8px;">
	            <%=orderCommonProductVirtual.FatherOrderDetail.ProductName%>
	            <%if(orderCommonProductVirtual.ChildOrderDetailList.Count>0){ %>
	            <div style="border:#DBEDFE 1px solid; overflow:hidden;background-color:#F5FAFE; margin-top:5px;">
                    <%  foreach(OrderDetailInfo orderDetail in orderCommonProductVirtual.ChildOrderDetailList){
                        ProductInfo childProduct = ProductBLL.ReadProductByProductList(productList, orderDetail.ProductID);
                    %>
                    <div>
		                <span style="color:#BF0000">[ 配件 ]</span><img  src="<%=childProduct.Photo.Replace("Original","60-60")%>"   onload="photoLoad(this,30,30)" style=" vertical-align:middle"/> <%=orderDetail.ProductName%>
		            </div>
	                <%} %>
	            </div>
	            <%} %>
	        </td>    	    
	        <td style="width:10%"><%=orderCommonProductVirtual.FatherOrderDetail.ProductPrice%> 元</td>    	    
	        <td style="width:10%"><%=orderCommonProductVirtual.FatherOrderDetail.SendPoint%></td>
	        <td style="width:10%"><%=orderCommonProductVirtual.FatherOrderDetail.ProductWeight%> 克</td>
	        <% if (canEdit){ %>
	        <td style="width:10%"><input type="text" value="<%=orderCommonProductVirtual.FatherOrderDetail.BuyCount%>" class="input" style="width:30px" onblur="changeOrderProductBuyCount('<%=orderCommonProductVirtual.StrOrderDetailID %>',this.value,'<%=orderCommonProductVirtual.StrProductID %>',<%=orderCommonProductVirtual.FatherOrderDetail.BuyCount%>)" /></td>
	        <td style="width:5%"><a href='javascript:void(0)' onclick="deleteOrderProduct('<%=orderCommonProductVirtual.StrOrderDetailID %>','<%=orderCommonProductVirtual.StrProductID %>','<%=orderCommonProductVirtual.FatherOrderDetail.BuyCount %>')"><img src="Style/Images/delete.gif" alt="删除" title="删除" /></a></td>
	        <%}else{ %>
	        <td style="width:10%"><%=orderCommonProductVirtual.FatherOrderDetail.BuyCount%></td>
	        <td style="width:5%">--</td>
	        <%} %>
	    </tr>
	    <%} %>
	    <tr><td colspan="9" style="text-align:right; padding-right:15px"><span title="不包含商品配件数量">产品数量合计</span>：<span class="orderMoney"><%=totalProductCount%></span>；价格合计：<span class="orderMoney"><%=order.ProductMoney%></span> 元；重量合计：<span class="orderMoney"><%=totalWeight %></span>克 ；赠送积分合计：<span class="orderMoney"><%=totalPoint%></span></td></tr>
	</table>	
</div>
<div class="add">
    <ul>
		<li class="orderBlock">费用信息 
		    <% if (canEdit){ %><a href="javascript:pop('OrderAdd.aspx?ID=<%=order.ID %>&Action=Money',600,380,'费用信息修改','OrderAdd<%=order.ID%>')"><img src="Style/Images/edit.gif" alt="费用信息修改" title="费用信息修改" /></a><%} %>
		    <a href="javascript:popPageOnly('UserAccountRecord.aspx?UserID=<%=order.UserID%>',800,600,'帐户明细','UserAccountRecord<%=order.UserID %>')"><img src="Style/Images/passport.gif" alt="帐户明细" title="帐户明细" /></a> 
		</li>
	</ul>
	<ul>
	    <li class="left">订单总金额：</li>
		<li>产品金额：<%=order.ProductMoney %> 元 - <span title="享受优惠活动减免的费用">优惠金额</span>：<%=order.FavorableMoney %> 元 + 物流费用：<%=order.ShippingMoney %> 元 + <span title="后台调节订单费用项，“+”表示增加订单费用，“-”表示减去订单费用">其它费用</span>：<%=order.OtherMoney %> 元 = 订单总金额：<span class="orderMoney"><%=OrderBLL.ReadOrderMoney(order) %></span> 元</li>
	</ul>
	<ul>
	    <li class="left">已付金额：</li>
		<li>余额：<%=order.Balance %> 元 <% if(userCoupon.ID>0){ %> + <%if(userCoupon.Coupon.UseMinAmount<=order.ProductMoney){ %> 优惠券（编号：<%=userCoupon.Number %>）：<%=order.CouponMoney %> 元<%}else{ %><span class="orderMoney" title="该订单的产品金额未能达到该优惠券规定的最低金额，请修改优惠券"> 优惠券（编号：<%=userCoupon.Number %>）：<%=order.CouponMoney %> 元</span><%} %><%} %>  = 已付金额：<span class="orderMoney"><%=OrderBLL.ReadHasPaidMoney(order) %></span> 元</li>
	</ul>
	<ul>
	    <li class="left">需支付金额：</li>
		<li>订单总金额：<%=OrderBLL.ReadOrderMoney(order)%> 元 - 已付金额：<%=OrderBLL.ReadHasPaidMoney(order)%> 元 = 需支付金额：<span class="orderMoney"><%=OrderBLL.ReadNoPayMoney(order)%></span> 元</li>
	</ul>
	<%if(favorableActivity.ID>0){ %>
	<ul>
		<li style="padding-left:50px; ">
		<p style=" border:1px dashed #D50000;line-height:22px; padding:3px 100px 3px 100px">
		当前订单可以享受优惠活动：<span class="orderMoney" style="cursor:pointer" onclick="javascript:popPageOnly('FavorableActivityAdd.aspx?ID=<%=favorableActivity.ID %>',800,600,'优惠活动','FavorableActivity')"><%=favorableActivity.Name %></span><br />
		<%if (favorableActivity.GiftID!=string.Empty){ %>
		<span style="font-weight:bold">赠送的礼物：</span><%=GiftBLL.ReadGift(order.GiftID).Name%> <% if (canEdit){ %><span style="cursor:pointer" onclick="javascript:pop('OrderAdd.aspx?ID=<%=order.ID %>&Action=Gift',600,240,'礼品信息修改','OrderAdd')"><img src="Style/Images/edit.gif" alt="礼品信息修改" title="礼品信息修改" /></span><%} %>
		<%} %>
		<%if(order.FavorableMoney>0){ %>
		<span style="font-weight:bold">优惠的费用：</span><%=order.FavorableMoney%> 元
		<%} %>
		</p>
		</li>
	</ul>
	<%} %>
</div>
