<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Vendue.Robot_UI_List" GameType="1"  CodePage="65001" %>

<script>


function RemoveDlg()
{
	//removeDialogbox("#Div_AdminEdit");//Admin_Edit_Info
}

function Edit_Robot_Update(id){
	var s = GetCheckedList();
	var _IsBaseType = $("#chk_IsBaseType").attr("checked")?1:0;
	var _RobotPrice = $("#tx_RobotMinPrice").val();
	var _BasePriceByUser = $("#tx_BasePriceByUser").val();

	$.ajax({
		type: "POST",
		url: "RobotList.aspx?IsAdd=2&t=" + new Date().getTime(),
		//data:{"Vid":<%=Vid%>,"UserIdList":s,"IsBaseType":_IsBaseType,"BasePrice":_RobotPrice},
		data:{"VendueId":<%=VendueInfo.VendueId%>,"RobotIdList":s,"IsBaseType":_IsBaseType,"BasePrice":_RobotPrice,"BasePriceByUser":_BasePriceByUser},
		cache: false,
		success: function(msg){
			if(msg>0)
			{	Alert("更新成功",1);
				//RemoveDlg();
			}
			else
			AlertErr("更新失败"+msg,1);
		},
		error:function(msg)
		{
			AlertErr(msg.responseText,1);
		}
	});
}


function CheckBoxInit()
{
	var list = "<%=VendueInfo.RobotIdList%>";
	var arr = list.split(",");
	var j = 0;
	$(":checkbox[id^='th']").each(function(i,domEle)
	{
		//alert(i + "|" + domEle.value);
		for(j=0;j<arr.length;j++)	
		{
			if(domEle.value==arr[j])
			{
				domEle.checked=true;
				break;
			}
		}
	});	
}

function GetCheckedList()
{
	var s = "";
	var n =0;
	$(":checkbox[id^='th']").each(function(i,domEle)
	{		
		if(domEle.checked && domEle.value!=0)
		{
			n ++;
			s += domEle.value + ",";
		}
	//	if(n>=10) return false;
	});
	if(s.length>0 && s.substr(s.length-1,1)==",")
	s = s.substr(0,s.length-1);
	return s;
}



//11:43 2010-9-29
$(document).ready(function()
{
//	client_SetPageNo(<%=intPageNo%>);//记录页码

//初始化
CheckBoxInit();

$(":checkbox[id^='th']").click(function()
{
	if($(this)[0].value==0)// && $(this)[0].checked)
	{
		if($(this)[0].id!="tx_RobotMinPrice")
		$(":checkbox[id^='th']").attr("checked",$(this)[0].checked);
	}
});


});



</script>
<DIV CLASS="MG10">
<div style="height:auto;border:0px;width:630px;overflow:hidden1;" class="FS14 FWN ">
<div style="text-align:left;" class="FS12 FWB">机器人参与竞价设置：<br />
<hr />
<FONT class="FWN">
启用机器人：</FONT> <input type="checkbox"id="chk_IsBaseType" value="0" <%=(IsBaseType==1?"Checked":"")%> >&nbsp;&nbsp;<br />
<div style="display:none1;" class="FWN">
机器人停止出价条件:<input  style="width:60px"  type="text" id="tx_RobotMinPrice" value="<%=VendueInfo.BasePrice/100f %>" >元（如果竞拍价升至该价位仍无会员出价，将由机器人竞拍成功）<br /> 
</div>

<div style="display:none;">
会员参于成交条件:<input  style="width:60px" type="text" id="tx_BasePriceByUser" value="<%=(VendueInfo.BasePriceByUser)/100f%>" >元（如果会员总出价金额升至该价位，将由最后一位会员竞拍成功）
</div>
<hr size="1" CLASS="BdC8B8B8B" />
</div>
</div>
<div style="overflow-y:scroll;height:200px;width:630px;" class="ContBox MGT10">
<table class="Table" style="width:613px;margin:0px;">
<tr style="height:30px;	font-weight: bold;">
<TH style="width:60px"><input type="checkbox" id="th_Checkbox" value="0"></TH>
<TH style="width:60px">编号</TH>
<TH style="width:150px">昵称</TH>
<TH>用户邮箱</TH>
</tr>

<asp:Repeater id="rpList" runat="server">
<ItemTemplate>
<tr>
		<td><input type="checkbox" id="th_Checkbox_<%#Eval("id")%>" value="<%#Eval("id")%>" ></td>
		<td><%#Eval("id")%></td>
		<TD><%#Eval("UserNickName")%></td>
		<TD><%#Eval("UserEmail")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>

</table>

</div>
<div class="page" style="margin-left:-13px"><%=strPageInfo%>  
<A class1="aui_buttons" onclick="Edit_Robot_Update()" >更新</A><br />
<br />
<div class="FS14 TextLeft FFFFD9 Bg8B8B8B MGL10" >
<br />
&nbsp;&nbsp;&nbsp;&nbsp;说明:<br />
&nbsp;&nbsp;&nbsp;&nbsp;1.请选择订单少的机器人,以防止订单达到上限后造成机器人出价失效.<br />
&nbsp;&nbsp;&nbsp;&nbsp;2.每期竞拍最多限制机器人个数10个.<br />
<br />

</div>
</div>
</DIV>