<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.PointSetting.List"  CodePage="65001" PathLevel="1" PageFileFlag="PointSetting_List" PageFileTitle="购买/赠送点配置" DataBindingType="1" PageFlagId="1" %>

<%@ Register TagPrefix="Site" TagName="Menu" Src="../WUC/Site_Menu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<Site:Menu id="menu_headtitle" runat="server" Flag="HeadTitle" CurrentPageTitle = "购买/赠送点配置" />
<Site:Menu id="menu_headjs" runat="server" Flag="HeadJs" PathLevel="1" />
<Site:Menu id="menu_headcss" runat="server" Flag="HeadCss" PathLevel="1" />

<%
if(RuleType==0){PageFileTitle="充值配置";}
else if(RuleType==1){PageFileTitle="赠送配置";}
else {PageFileTitle="购买/赠送配置";}
%>


<script>


//增加
function Edit_Info(id)
{	
//访问类型,AJAX路径,数据JSON,弹出框ID,弹出框标题,等执行的函数名;
var _url="update.aspx?IsAdd=0&RuleType=<%=RuleType%>";
var _data = {"id":id};	
Common.EditFunction("POST",_url,_data,"<%=PageFileFlag%>","<%=PageFileTitle%>:编辑","UpdateData");	
//将本行设置为选中颜色
SetActive(id);	
}


//删除
function Del_Info(id,isSave){
if(isSave==1){alert("系统保留项，禁止删除。");return false;}	
//弹出框ID,标题，内容，删除程序执行路径，参数表
var _url =  "Update.aspx?IsAdd=3&RuleType=<%=RuleType%>";
var _data ={"id":id};
Common.ConfirmDelete2 ("POST",_url,_data,"<%=PageFileFlag%>","删除确认","");
SetActive(id);		
}


</script>


</head>
<body>


<Site:Menu id="menu_topmenu" runat="server" Flag="TopMenu"  />
<div class1="wrap" id="wrap">
	<Site:Menu id="Wuc_LeftMenu" runat="server" Flag="LeftMenu" PageFileFlag="Menu_A_300_306" PathLevel="1" />	
	<div class1="mainbox" class="MainBox W1100 ">

		<div class="PGTitle LH30 ">
			<div class="W200 FL MGL10 FWB FS12"><%=PageFileTitle%></div>
			<div class="ChileMenu1 FL FS12">

			</div>
			<div class="Clear"></div>
		</div>

		<div class="ContBox MGT10 " >

<table class="Table FS12 ">

<tr style="height:30px;	font-weight: bold;">
<TH style="width:30px">内编</TH>
<TH style="width:40px">编号*</TH>
<TH style="width:120px">名称</TH>
<TH style="width:220px"><%=WinLibClass.Config.Global.WebSiteConfig.PointName_1%>：类型 / <%=(RuleType==0?"所需金额 / ":"")%>额度值 </TH>

<TH style="width:150px"><%=WinLibClass.Config.Global.WebSiteConfig.PointName_2%>：类型 / 额度值</TH>

<TH style="width:150px"><%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%>：类型 / 额度值</TH>

<TH >积分：类型 <!--/ 所需金额--> / 额度值</TH>

<TH style="width:60px">状态</TH>
<TH style="width:130px">操作</TH>
</tr>

<asp:Repeater id="rpList" runat="server">
<ItemTemplate>

<tr id="tr_<%#Eval("id")%>">
		<td><%#Eval("id")%></TD>
		<td><%#Eval("pid")%></TD>
		<TD ><%#Eval("name")%></td>
		<td> <%#GetPointType(Eval("PointType1"))%> / <%#(RuleType==0?WinLibClass.Common.Utils2.SetMoneyFormat( Eval("PointPrice"))+" / ":"")%><%#Eval("Point1")%><%#GetPre(Eval("PointType1"))%> </td>
		<td><%#GetPointType(Eval("PointType2"))%> / <%#Eval("Point2")%><%#GetPre(Eval("PointType2"))%> </td>
		<td><%#GetPointType(Eval("PointType3"))%> / <%#Eval("Point3")%><%#GetPre(Eval("PointType3"))%> </td>
		
		<td> <%#GetPointType(Eval("CreditsType1"))%> <!--/ <%# WinLibClass.Common.Utils2.SetMoneyFormat( Eval("CreditsPrice"))%> -->/ <%#Eval("Credits")%><%#GetPre(Eval("CreditsType1"))%> </td>
		
		<td ><%#Eval("IsChecked").Equals(1)?"<font color='green'>启用</font>":"<font color='red'>停用</font>"%></td>
		<td>
			<a onclick="Edit_Info('<%#Eval("id")%>');" >编辑</a>
			<%#(Eval("isreserve").ToString()=="0"?"	<a onclick=\"Del_Info('" +Eval("id")+"',0);\" >删除</a>":"<font style='color:red;display:inline-block;width:25px;'></font>")%>
		</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>


<script language="C#" runat="server">

public string GetPre(object o)
{
	if(o==null) return "";
	string s = o.ToString();
	if(s=="0" || s=="10" || s=="20")	return "点";
	else if(s=="1" || s=="11" || s=="21")	return "%";
	else return "";
		
}

public string GetPointType(object o)
{
	if(o==null) return "";
	string s = o.ToString();
	if(s=="0" || s=="1")
	{
		return "购买";
	}
	else if(s=="10" || s=="11")
	{
		return "赠送";
	}
	else if(s=="20" || s=="21")
	{
		return "返还";
	}
	else 
	{
		return "未知";
	}
}

</script>


		</div>
		<div class="ContBox" >
			<div class="page" style="margin-left:-13px;"><%//=strPageInfo%> <a href="#"onclick="Edit_Info();return false;"  class="A_Add">添加</a> </div>		
			
		</div>
<div class="Warning FS12">
&nbsp;&nbsp;注：“编号*”是系统唯一识别标识，一经填写，请不要随意修改。否则，在该功能启用后将引起相关功能失效或异常。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本模块功能不一定要全部启用，您可根据运营需求启用或添加部分功能。每个功能须与系统内部功能结合才可有效，如果您发现所设定功能无效时，请与开发商联系，以期完善个性的功能模块。
</div>
	</div>
</div>


<div class="clear"></div>
<Site:Menu id="menu_foot" runat="server" Flag="Foot"   />
</body>
</html>
