<%@ Page CodeFileBaseClass="IlgharCMS.Lib.AdminPageBase" %>
<%@ Register TagPrefix="IlgharUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="IlgharUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!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>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ilghar:Get ID="Order" Object="Order" InnerID="Request.QueryString['ID']" />
<ilghar:List ID="Unit" Object="Unit" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查看</title>
<ilghar:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ilghar:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<script type="text/javascript" src="<%=CommonPath%>ajax.js"></script>
<script type="text/javascript" src="<%=JsPath%>common.js"></script>
<ilgharUC:Ime Ime="true" Eot="true" runat="server" />
<style type="text/css">
TD TABLE{background:#FFF}
TD TABLE TH{width:100px}
#DetailTable TH{width:auto;text-align:center}
#DetailTable TD{text-align:center}
</style>
<script language="c#" runat="server">
protected string GetUnitName(object unitID)
{
	if (Guid.Equals(unitID, Guid.Empty))
		return String.Empty;

	DataRow[] rows = Unit.Select(Alias.Unit.ID + "='" + unitID + "'");
	if (rows.Length == 0)
		return String.Empty;
	else
		return rows[0][Alias.Unit.Name].ToString();
}
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" onclick="OpenCloseLeftFrame()" /></div>
	<div class="Title"><a href="list.aspx?Lang=<%=ContentLang%>">订单列表</a> → <span class="<%=ContentLang%>Font"><%=Order[Number]%></span></div>
	<div class="Right"></div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left Selected"></li>
		<li class="Middle Selected">查看</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="payment.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">收款单</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="refund.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">退款单</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="delivery.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">发货单</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="return.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">退货单</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="feedback.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">反馈</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<table border="0" cellpadding="4" cellspacing="1">
		<tbody>
			<tr>
				<th>订单号：</th>
				<td><%=Order[Number]%></td>
			</tr>
			<tr>
				<th>订单状态：</th>
				<td>
					<%If Int32.Equals(Order[IsPayed], 1)%>
						未付款
					<%ElseIf Int32.Equals(Order[IsPayed], 2)%>
						部分付款
					<%ElseIf Int32.Equals(Order[IsPayed], 3)%>
						已付款
					<%ElseIf Int32.Equals(Order[IsPayed], 4)%>
						部分退款
					<%ElseIf Int32.Equals(Order[IsPayed], 5)%>
						已退款
					<%EndIf%>
					，
					<%If Int32.Equals(Order[IsDelivered], 1)%>
						未发货
					<%ElseIf Int32.Equals(Order[IsDelivered], 2)%>
						部分发货
					<%ElseIf Int32.Equals(Order[IsDelivered], 3)%>
						已发货
					<%ElseIf Int32.Equals(Order[IsDelivered], 4)%>
						部分退货
					<%ElseIf Int32.Equals(Order[IsDelivered], 5)%>
						已退货
					<%EndIf%>				
				</td>
			</tr>
			<tr>
				<th>订单金额：</th>
				<td><%=Order[Sum]%></td>
			</tr>
			<tr>
				<th>已付金额：</th>
				<td><%=Order[HasPayed]%></td>
			</tr>
			<tr>
				<th>会员：</th>
				<td class="<%=ContentLang%>Font"><%=Order[Member]%></td>
			</tr>
			<tr>
				<th>发票：</th>
				<td>
					<table border="0" cellpadding="4" cellspacing="1">
						<tr>
							<th>是否需要：</th>
							<td>
								<%If Convert.ToBoolean(Order[NeedInvoice])%>
									是
								<%Else%>
									否
								<%EndIf%>
							</td>
						</tr>
						<tr>
							<th>税率：</th>
							<td><%=Order[TaxRate]%>%</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<th>折扣或涨价：</th>
				<td><%=Order[PriceAdjustment]%></td>
			</tr>
			<tr>
				<th>备注：</th>
				<td class="<%=ContentLang%>Font"><%=Order[Memo]%></td>
			</tr>
			<tr>
				<td colspan="2">
					<table id="DetailTable" border="0" cellpadding="4" cellspacing="1">
						<thead>
							<tr>
								<th style="width:120px">货号</th>
								<th>名称</th>
								<th style="width:60px">价格</th>
								<th style="width:60px">数量</th>
								<th style="width:60px">已发</th>
							</tr>
						</thead>
						<tbody>
							<ilghar:List Object="Order.Detail" Condition="OrderID=Order[ID] and ParentID IS NULL">
								<ilghar:Record>
									<tr>
										<td><%=ProductNumber%></td>
										<td class="<%=ContentLang%>Font" style="text-align:left">
											<%=Name%>
											<%If Convert.ToBoolean(OnTrial)%>
												，试用中
											<%EndIf%>
											<%If !Convert.IsDBNull(ExpiredTime)%>
												，过期时间：<%=ExpiredTime%>
											<%EndIf%>
											<ilghar:List Object="Order.Detail" Condition="OrderID=Order[ID] and ParentID=ID">
												<ilghar:Record>
													<blockquote style="margin:0 0 0 20px">
													+ <%=Name%> - <%=Amount%> <%=GetUnitName(UnitID)%>
													<%If Convert.ToBoolean(OnTrial)%>
														，试用中
													<%EndIf%>
													<%If !Convert.IsDBNull(ExpiredTime)%>
														，过期时间：<%=ExpiredTime%>
													<%EndIf%>													
													</blockquote>
												</ilghar:Record>
											</ilghar:List>
										</td>
										<td><%=Price%></td>
										<td><%=Amount%> <%=GetUnitName(UnitID)%></td>
										<td><%=DeliveredAmount%> <%=GetUnitName(UnitID)%></td>
									</tr>
								</ilghar:Record>
							</ilghar:List>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>
	<div class="Footer"></div>
</div>
<script type="text/javascript">
HandleFake404();
</script>
</body>
</html>