<%@ Page CodeFileBaseClass="IlgharCMS.Lib.AdminPageBase" %>
<!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>
<ilghar:List ID="Discount" Object="Discount" />
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<base target="_self" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="Mon,1 Fab 1979 23:36:05 GMT" />
<title>设置规格会员价</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ilghar:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ilghar:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<style type="text/css">
.Block TBODY TD{text-align:center}
</style>
<script language="c#" runat="server">
protected object _amount;
protected bool Exists(object roleInnerID)
{
	DataRow[] rows = Discount.Select(Alias.Discount.RoleInnerID + "=" + roleInnerID);
	if (rows.Length > 0)
	{
		_amount = rows[0][Alias.Discount.Amount];
		return true;
	}
	else
	{
		_amount = null;
		return false;
	}
}
</script>
<script type="text/javascript">
var _page = "goods_spec_member_price";
var _lang = "<%=ContentLang%>";
var _webPath = "<%=WebPath%>";
var _imagePath = "<%=ImagePath%>";
var _index = <%=Request.QueryString["Index"]%>;
var _price = "<%=Request.QueryString["Price"]%>";
var _lang_working = "正在操作...";
var _lang_operation_fail = "操作失败！";
var _lang_operation_success = "操作成功！";
var _lang_price_incorrect = "价格不正确！";

var _memberPrice = null;
if (_index != 0)
{
	if (g_browser == "IE")
		_memberPrice = window.dialogArguments.GetSpecMemberPrice(_index);
	else
		_memberPrice = window.opener.GetSpecMemberPrice(_index);
}
else
{
	_memberPrice = new Array();
}

<%If Request.QueryString["ID"] != null%>
	<ilghar:List Object="MemberPrice" Condition="GoodsSpecID=Request.QueryString['ID']">
		<ilghar:Record>
			_memberPrice[_memberPrice.length] = new Object();
			_memberPrice[_memberPrice.length - 1].RoleInnerID = "<%=RoleInnerID%>";
			_memberPrice[_memberPrice.length - 1].Price = "<%=Price%>";
		</ilghar:Record>
	</ilghar:List>
<%EndIf%>
</script>
</head>
<body>
<div class="Block">
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle">设置规格会员价</li>
		<li class="Right"></li>
	</ul>
	<table border="0" cellpadding="4" cellspacing="1">
		<thead>
			<tr>
				<th>会员群组</th>
				<th>价格</th>
				<th>留空默认</th>
			</tr>
		</thead>
		<tbody>
			<ilghar:List Mark="System" Object="Role">
				<ilghar:Record>
					<tr>
						<td class="<%=ContentLang%>Font"><%=Name%></td>
						<td>
							<%If Exists(InnerID)%>
								<input type="text" id="MG<%=InnerID%>" size="10" maxlength="10" amount="<%=_amount%>" class="Text" />
							<%Else%>
								<input type="text" id="MG<%=InnerID%>" size="10" maxlength="10" amount="100" class="Text" />
							<%EndIf%>
						</td>
						<td><span id="Span<%=InnerID%>"></span></td>
					</tr>
				</ilghar:Record>
			</ilghar:List>
		</tbody>
	</table>
</div>
<button id="Ok" style="margin:5px;padding:10px" onclick="OnOk()">确 定</button>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=JsPath%>shop.js"></script>
</body>
</html>