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


<script type="text/javascript"> 


$(document).ready(function(){
	$.formValidator.initConfig
	({
		formid:"form_add",
		validatorgroup:"4",
		autotip:true
	});
	
	$("#ClassName").formValidator({
		validatorgroup:"4",
		empty:false,
		tipid:'notetip',
		onshow:"请输入积分信息名称",
		onfocus:"积分信息名称不能为空"
	}).inputValidator({
		min:1,
		empty:{leftempty:false,rightempty:false,emptyerror:"两边不能有空格"},
		onerror:"请输入积分信息名称"
	});	

	$("#BtnSubmit").click(function(){
		var pass= true;//$.formValidator.pageIsValid('4');
		//alert(pass);
		if(pass){
			var queryString = $('#form_add').serialize();//formSerialize();
			$.ajax({
				type: "POST",
				url: APP+"/Admin/UserPoints_Update",
				data:queryString,
				cache: false,
				success: function(msg){
						if(msg=='1'){ //先保留msg这个值以备以后使用
							showtips('<%=(Id>0)?"修改":"添加" %>积分信息成功!','tips',1);
							removeDialogbox("#Div_AdminEdit");
							var urlParam = "";
							SimpleAjax(APP+"/Admin/UserPoints_List"+client_GetPageNoToUrlParam()+urlParam,"");//刷新
			
						}else{
							msg = "<%=(Id>0)?"修改":"添加" %>信息失败,请检查各项输入是否正确或网络连接状态.代码("+ msg +")";
							ShowErrorMsg(msg);
						}
				},
				error:function(msg)
				{
					ShowErrorMsg("出错啦:" + msg.responseText);
				}
				
			});		
			
		}
		else
		{
			ShowErrorMsg("出错啦:连接异常,操作失败");
		}

	});
});


</script> 


<div style="height:346px;WIDTH:520">

	<form id="form_add">
	
<div class="TableUpdateDiv"  style="width:501px;">
<div style="width:98%;">
	<table class="TableUpdate" style="text-align:left;">
	
	<tr>
	<td >
		<span>标　题:</span>
		<input id="strTitle" name="strTitle" type="text" style="width:400px" value="<%=strTitle%>" />
		<input id="Id" name="Id" type="hidden" value="<%=Id%>" />
	</td>
	</tr>
	
	<tr>
	<td>
		<span>描　述:</span><br />
		<textarea id="strText" name="strText" style="width:400px;height:100px;margin:-20px 0px 0px 45px;"  ><%=strText%></textarea>
	</td>
	</tr>	

	
	

	
		
	
	<tr>	
	<td >
		<span>状　态:</span>
		<select id="IsChecked" name="IsChecked" style="width:60px;" >
		<option value="0" style="color:red" <%=((IsChecked==0)?"selected":"")%> >停用</option>
		<option value="1" <%=((IsChecked==1)?"selected":"")%> >启用</option>
		</select>	
		</td>
	</tr>		
	
	</table>

</div>
<div style="width:98%;margin-top:5px;background-color:#F8E9C2;">
	
	<table class="TableUpdate" style="text-align:left;">
	
	<tr style="display:none">
	<td >
		<span>积分数值类型:</span>
		<select id="TypeId" name="TypeId" style="width:160px;"  >
			<option value="0" <%=(TypeId==0?"selected":"")%> >点值</option>
			<option value="1" <%=(TypeId==1?"selected":"")%> >百分比</option>
		</select>		
	</td>
	</tr>
	
	<tr >
	<td >
		<span id="Span_PointMin">积分值:</span><input id="PointMin" name="PointMin" type="text" value="<%=PointMin%>" />
	
	</td>
	</tr>
	
		
	
	<tr style="display:none">	
	<td >
		<span id="Span_PointMax">最大值:</span><input id="PointMax" name="PointMax" type="text" value="<%=PointMax%>" />
	</td>
	</tr>	
	</table>		
	
</div>
<div style="width:98%;margin-top:5px;background-color:#D7BCE4;display:none">	
	
	
	<table class="TableUpdate" style="text-align:left;">
	<tr>
	<td >
		<span><%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%>类型:</span>
		<select id="TypeId3" name="TypeId3" style="width:160px;"  >
			<option value="0" <%=(TypeId3==0?"selected":"")%> >点值</option>
			<option value="1" <%=(TypeId3==1?"selected":"")%> >百分比</option>
		</select>		
	</td>
	</tr>
	
	<tr>
	<td >
		<span id="Span_PointMin3"><%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%>值(或最小值):</span><input id="PointMin3" name="PointMin3" type="text" value="<%=PointMin3%>" />
	
	</td>
	</tr>
	
		
	
	<tr>	
	<td >
		<span id="Span_PointMax3">最大值:</span><input id="PointMax3" name="PointMax3" type="text" value="<%=PointMax3%>" />
	</td>
	</tr>	
	
	</table>

</div>
</div>
		<div class="TableUpdateDiv" style="width:99%;">
		<div style="background-color:#fafafa;width:99%;">
		<table>
		<tr>
		<td style="padding:5px 0px 5px 0px;">&nbsp;
		<button type="button" class="button"  style="margin:0px 0px 0px 0px;" id='BtnSubmit'>确认保存</button>
		&nbsp;&nbsp;
		<span id="notetip"></span>
		<span id="tips"></span> 
		&nbsp;
		</td>
		</tr>
		</table>
		</div>
		</div>		
</form>
	
</div>

<script>
/*
jQuery(function(){

	jQuery("TypeId").click(function(){

	});
});

function TypeIdSelect()
{
	var x = jQuery("#TypeId").val();
	if(x==0)
	{
		jQuery("#Span_PointMax").hide();
		jQuery("#PointMax").hide();
	}
	else
	{
		jQuery("#Span_PointMax").show();
		jQuery("#PointMax").show();	
	}
	
}
*/

</script>

