<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.UserPoints.UI_List"  CodePage="65001" %>

<script>
function SetActive(id)
{
	$("[id^='tr_']").css({"background-color":"#ffffff"});
	$("#tr_"+id).css({"background-color":"#dddefa"});
}


//编辑
function Edit_Info(id,ClassType,BigClassId)
{


	addDialogbox("#Div_AdminEdit","编辑积分配置信息",10001,531);
	//quitScreenMask();
	$.ajax({
		type: "POST",
		url: APP+"/Admin/UserPoints_Add_UI",
		data:{"id":id},
		cache: false,
		success: function(msg){
			$("#Div_AdminEdit .dialogboxContent").html(msg);
			$("#Div_AdminEdit .dialogboxContent").addClass("regWrap");
		}
	});
	////"BigClassId":BigClassId,"ClassType":ClassType},
	
	//将本行设置为选中颜色
	SetActive(id);
}

//增加
function Add_Info()
{
	addDialogbox("#Div_AdminEdit","请填写积分配置信息",10001,531);
	//quitScreenMask();
	$.ajax({
		type:"POST",
		url: APP+"/Admin/UserPoints_Add_UI",
		data:{"id":0},
		cache: false,
		success: function(msg){
			$("#Div_AdminEdit .dialogboxContent").html(msg);
			$("#Div_AdminEdit .dialogboxContent").addClass("regWrap");
		}
	});
}

//删除
function Del_Info(id)
{
SetActive(id);
	addDialogbox("#Div_AdminEdit","你确认删除本信息吗?",10001,250);
	msg='删除本分类信息将不能恢复!<br><br>	'+
			'<div class="paragraph">'+
						'<button type="button" class="button" class="f12" onclick="Del_Info_Yes('+id+')">确认删除本分类信息</button>'+
						'<button type="button" class="button" class="f12" onclick="Del_Info_No()">返回</button>'+
			'</div>';
	$("#Div_AdminEdit .dialogboxContent").html(msg);
}

//系统保留
function Del_Info(id)
{
	SetActive(id);
	addDialogbox("#Div_AdminEdit","<font color='red'>系统保留项</font>",10001,250);
	msg='删除本分类信息将不能恢复!<br><br>	'+
			'<div class="paragraph">'+
						'<button type="button" class="button" class="f12" onclick="Del_Info_Yes('+id+')">确认删除本分类信息</button>'+
						'<button type="button" class="button" class="f12" onclick="Del_Info_No()">返回</button>'+
			'</div>';
	$("#Div_AdminEdit .dialogboxContent").html(msg);
}


function Del_Info_No(){
	removeDialogbox("#Div_AdminEdit");
}

function Del_Info_Yes(id){
	$.ajax({
		type: "POST",
		url: APP+"/Admin/UserPoints_Update",
		data:{"id":id,"DeleteType":3},//DeleteType==2:删除
		cache: false,
		success: function(msg){
			//alert(msg)
			var urlParam = "";
			SimpleAjax(APP+"/Admin/UserPoints_List"+client_GetPageNoToUrlParam()+urlParam);//ajax_list
			removeDialogbox("#Div_AdminEdit");
		}
	});

}

//11:43 2010-9-29
$(document).ready(function(){
	client_SetPageNo(1);//记录页码
});


</script>



<table border="0" class="chart" style="width:100%;">

<tr style="height:30px;	font-weight: bold;">
<TH style="width:30px">序号</TH>
<TH style="width:100px">名称</TH>
<TH style="width:70px">积分类型</TH>
<TH style="width:70px">积分值</TH>

<TH style="width:100px">状态</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("strTitle")%> </td>
		<td><%#GetParentClassName(Eval("TypeId"))%></td>
		<TD><%#GetParentClassNameFormat(Eval("TypeId"),Eval("PointMin"),Eval("PointMax"))%> </td>
		<td ><%#Eval("IsChecked").Equals(1)?"<font color='green'>启用</font>":"<font color='red'>停用</font>"%></td>
		<td>
			
				<button type="button" class="button" style="width:50px;height:22px;margin:2px;" onclick="Edit_Info('<%#Eval("id")%>');" >编辑</button>
				<%//#CreateButton(Eval("id"),Eval("IsReserve"))%>
			
		</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<div class="pages cb clearfix"  style="margin-left:-13px"><%//=strPageInfo%>    
<button type="button" class="button" style="width:50px;height:22px;margin:2px;display:none;" onclick="Add_Info()" >添加</button>
</div>