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

<%
//InitData();
%>


<script type="text/javascript"> 


$(document).ready(function(){

});

function SaveSub()
{
		var pass=checkform();

		if(pass){
			var queryString = $('#form_add').serialize();
			$.ajax({
				type: "POST",
				url: "Update.aspx?IsAdd=2",
				data:queryString,
				cache: false,
				success: function(msg){
						if(msg=='1'){ //先保留msg这个值以备以后使用
							Alert('<%=(Id>0)?"修改":"添加" %>成功!',1,function(){Common.Refresh();});	
							//Common.Refresh();			
						}else{
							msg = "<%=(Id>0)?"修改":"添加" %>分类信息失败,请检查各项输入是否正确或网络连接状态.代码("+ msg +")";
							AlertErr(msg);
						}
				},
				error:function(msg)
				{
				}
				
			});		
			
		}
		return false;
}


function funSucc(id,msg){}
function funFail(id,msg){Common.ShowTipFaceSmile(false,msg,3);}
function checkform(){
    var ok = jQuery.checkForm2({
        ctrls: [   
		{id: "ClassName",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{2,20}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"分类名称字数:2~20字以内，允许中文。");}}
            ]
        //,success: function(){ },failed: function(msg){}
        });
	return ok;	
}

</script> 

<div class="W360">
<div style="width:340px">
	<form id="form_add">
<div class="TableUpdateDiv"  style="width:100%;">
<div style="width:98%; " class="FN">
	<table class="TableUpdate" style="text-align:left;">
	<tr>
	<td  >
		名称:	
		<input id="Id" name="Id" type="hidden" value="<%=DataInfo.ID%>" />
		<input id="ClassType" name="ClassType" type="hidden" style="width:220px;"  value="<%=DataInfo.ClassType%>" />
		<input id="ClassName" name="ClassName" type="text" class="input" style="width:220px;"  value="<%=DataInfo.ClassName%>" />
		<input id="IsReserve" name="IsReserve" type="hidden" style="width:220px;"  value="<%=DataInfo.IsReserve%>" />
		<input id="BigClassId" name="BigClassId" type="hidden" style="width:220px;"  value="<%=DataInfo.BigClassId%>" />
		<input id="SubClassId" name="SubClassId" type="hidden" style="width:220px;"  value="<%=DataInfo.SubClassId%>" />
	</td>
	</tr>
	<tr style="<%=ClassType==2?"display:none;":""%>">
	<td >
		所属上级分类:
		<select id="PClassId" name="PClassId" style="width:160px;" >
		<option value="0" >无</option>
		<%=GetPClassListOption() %>
		</select>		
	</td>
	</tr>
	<tr>
	<td>
		状态:
		<select id="IsChecked" name="IsChecked" style="width:60px;" >
		<option value="0" style="color:red" <%=((DataInfo.IsChecked==0)?"selected":"")%> >停用</option>
		<option value="1" <%=((DataInfo.IsChecked==1)?"selected":"")%> >启用</option>
		</select>	
		</td>
	</tr>		
	<tr>
	
	<tr>
	<td >
		星级:
		<select id="OrderId" name="OrderId" style="width:60px;" >
		<option value="0" style="color:red" <%=((DataInfo.OrderId==0)?"selected":"")%> >默认</option>
		<option value="1" <%=((DataInfo.OrderId==1)?"selected":"")%> >1星</option>
		<option value="2" <%=((DataInfo.OrderId==2)?"selected":"")%> >2星</option>
		<option value="3" <%=((DataInfo.OrderId==3)?"selected":"")%> >3星</option>
		<option value="4" <%=((DataInfo.OrderId==4)?"selected":"")%> >4星</option>
		<option value="5" <%=((DataInfo.OrderId==5)?"selected":"")%> >5星</option>
		</select>	
		</td>
	</tr>		
	<tr>	
	

	</table>

	</div>
</div>		
</form>
	</div>
</div>

