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

<script type="text/javascript"> 

jQuery(document).ready(function(){



});


function SaveSub_UserMsg(){
	
	CheckBeforeSubmit();
	
		var pass= checkform();// $.formValidator.pageIsValid('4');
		if(pass){
			var queryString = $('#form_add').serialize();//.formSerialize();
			$.post("Update.aspx?IsAdd=2", queryString,function(msg){
				if(msg>0){ 
					Alert('<%=(Id>0)?"修改":"添加" %>信息成功!',1,function(){Common.Refresh();});
					//Common.Refresh();
	
				}else{
					msg = "<%=(Id>0)?"修改":"添加" %>失败,请检查各项输入是否正确或网络连接状态.代码("+ msg +")";
					AlertErr(msg,2);
				}
			});
		}
		return false;
	}


function CheckBeforeSubmit()
{
	jQuery("#FromUserIdName").val(jQuery("#Span_UserId_From").html());
	jQuery("#ToUserIdName").val(jQuery("#Span_UserId_To").html());
	
	return true;
}


function funSucc(id,msg){}
function funFail(id,msg){Common.ShowTipFaceSmile(false,msg,1);}
function checkform(){
    var ok = jQuery.checkForm2({
        ctrls: [   
        {id: "FromUserId",type:"mustRegular", par:/[\d]{1,}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"请选择发送信息的会员");}}                                
		,{id: "ToUserId",type:"mustRegular", par:/[\d]{1,}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"请选择接收信息的会员");}}
		,{id: "NoteTitle",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{2,50}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"标题字数:2~50字");}}
		,{id: "NoteText",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{2,200}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"内容字数:2~200字");}}
            ],
        success: function(){ //验证通过mustEqualTo
            },
        failed: function(msg){  //Alert("验证失败");
            }
        });
	return ok;	

}

</script>
<div class="TableUpdateDiv W500" >
	<form id="form_add" >
<div style="width:99%;">
	<table border="0" class="TableUpdate" >
	
	<tr>
	<td >
	
		<span >发送人: </span>
		<span id="Span_UserId_From" style="margin:2px;height:22px;background-color:#ddd;display:inline-block;width:200px;color:#368912"><%=FromUserIdName%> </span>
	
		<input type="button" value="选择" style="width:40px" onclick="ChooseUser1(<%=FromUserId%>,'Span_UserId_From','FromUserId',1);" />
			<input id="FromUserId" name="FromUserId" type="hidden"  class="input" style="width:100px;"  value="<%=FromUserId%>" />
			<input id="FromUserIdName" name="FromUserIdName" type="hidden"  class="input" style="width:100px;"  value="<%=FromUserIdName%>" />
		<!--
		<span id="span_FromUserId" class="span_default_value">&nbsp;0表示由本站系统发出.<%//=FromUserIdName%>&nbsp;</span>
		-->
		
	</td>	
	</tr>	
	
	
	<tr>
	<td >	
		<span for="strTitle">接收人: </span>
		<span id="Span_UserId_To" style="margin:2px;height:22px;background-color:#ddd;display:inline-block;width:200px;color:#795612"><%=ToUserIdName%></span>
	
		<input type="button" value="选择" style="width:40px"  onclick="ChooseUser1(<%=ToUserId%>,'Span_UserId_To','ToUserId',0);" />
			<input id="ToUserId" name="ToUserId" type="hidden"  class="input" style="width:100px;" value="<%=ToUserId%>" />
			<input id="ToUserIdName" name="ToUserIdName" type="hidden"  class="input" style="width:100px;" value="<%=ToUserIdName%>" />
		<!--
		<span id="span_FromUserId" class="span_default_value">&nbsp;0表示发送给本站系统.<%//=ToUserIdName%>&nbsp;</span>
		-->
		
		
	</td>	
	</tr>	
	
	<tr>
	<td >
		<span for="strTitle">标　题:</span>
		<input id="Id" name="Id" type="hidden" value="<%=Id%>" />
		<input id="NoteTitle" name="NoteTitle" type="text" class="input" style="width:300px;"  value="<%=strTitle%>" />(必填,50字以内)
		<input id="FloorNo" name="FloorNo" type="hidden" value="<%=FloorNo%>" />
	</td>	
	</tr>
	
	
	<tr>
	<td >		
		
		
		<span for="strContent">内　容:</span>
		<textarea id="NoteText" name="NoteText" type="text" class="input" style="width:300px;height:100px" ><%=strContent%></textarea>(必填,200字以内)
	</td>	
	</tr>
	
	
	<tr style="display:none;">
	<td >

		<span for="InfoType">类　型:</span>
		<select id="InfoType" name="InfoType" style="width:200px;" >
		<option value="0" style="color:red" <%=((InfoType==0)?"selected":"")%> >默认(只针对指定人)</option>
		<option value="1" <%=((InfoType==1)?"selected":"")%> >公共(对所有人均有效)</option>
		</select>
	</td>	
	</tr>	
	
	<tr>
	<td >

		<span for="IsReaded">已　读:</span>
		<input id="IsReaded" name="IsReaded" type="text"  class="input" style="width:100px;" value="<%=IsReaded%>" />次
	</td>	
	</tr>	
	
	<tr>
	<td >

		<span for="IsChecked">审　核:</span>
		<select id="IsChecked" name="IsChecked" style="width:200px;" >
		<option value="0" style="color:red" <%=((IsChecked==0)?"selected":"")%> >停用</option>
		<option value="1" <%=((IsChecked==1)?"selected":"")%> >启用</option>
		</select>
	</td>	
	</tr>

	
	<tr>
	<td >
		<div class="cb">
		注:选择公共短信类型时,接收人编号将不再记录,即记录的接收编号值为0.
		</div>
	</td>
	</tr>	
	
	
	</table>
	</div>
</form>
	
</div>

